(02-07-2020 10:55 PM)pinkman Wrote: First iteration: 2.6666...
2nd: 2.844444...
3rd: 2.9...
10th: 3.067...
50th: 3.126...
Yes the product seems to approach PI/2, but soooooo slowly!
.
.
.
My other program included a loop until the precision of the calculator has been reached:
I tried it a few times and breaked the program after several minutes to get 7 correct significant digits of pi after... 100E6 iterations.
.
Try this:
Code:
00 { 73-Byte Prgm }
01▸LBL "WALLIS"
02 0
03 STO 00
04 1
05 STO 01
06▸LBL 00
07 1
08 STO+ 00
09 RCL 00
10 X↑2
11 4
12 ×
13 ENTER
14 X<>Y
15 1
16 -
17 ÷
18 STO× 01
19 RCL 01
20 STO+ ST X
21 64
22 RCL× 00
23 RCL ST X
24 72
25 +
26 RCL× 00
27 23
28 +
29 X<>Y
30 56
31 +
32 RCL× 00
33 15
34 +
35 ÷
36 ×
37 STOP
38 GTO 00
39 END
Usage: XEQ WALLIS R/S R/S...
or that:
Code:
00 { 76-Byte Prgm }
01▸LBL "WALLIS"
02 STO 03
03 STO 04
04 0
05 STO 00
06 1
07 STO 01
08▸LBL 00
09 1
10 STO+ 00
11 RCL 00
12 X↑2
13 4
14 ×
15 ENTER
16 X<>Y
17 1
18 -
19 ÷
20 STO× 01
21 RCL 01
22 DSE 03
23 GTO 00
24 64
25 RCL× 04
26 RCL ST X
27 72
28 +
29 RCL× 04
30 23
31 +
32 X<>Y
33 56
34 +
35 RCL× 04
36 15
37 +
38 ÷
39 ×
40 STO+ ST X
41 END
Usage: n XEQ WALLIS
Convergence gets worse as n increases, but it won’t take long before you can recognize the constant.