Wallis' product exploration
|
02-07-2020, 10:55 PM
Post: #1
|
|||
|
|||
Wallis' product exploration
Last week my cousin told me Wallis' product was quite his favorite formula in mathematics.
I remembered the thread opened on this forum about PI approximations (like 355 / 113), and we decided to program Wallis product on Free42 while having a coffee... We built it this way: Code:
The usage is simple: - initiate n with value 0 in register 00: 0 STO 00 - then initiate product with value 1 in register 01: 1 STO 01 - execute the product as many times as you want: XEQ WALLIS We were really disapointed! 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: Code:
I tried it a few times and breaked the program after several minutes to get 7 correct significant digits of pi after... 100E6 iterations. Despite the fact that Wallis' product is really slow (and it's very deceptive), I have one question: What do you think about calculations precisions? - I mean, at first iteration the number is rounded, because pi/2 is approximated by 1.3333.... so errors will appear, and will be multiplied at each loop. I even wondered if those approximations could be a reason for the convergence being so slow. - I also mean, each time we iterate, we calculate a square of big numbers, approaching the limit of the calculator, leading to (4n^2) = (4n^2 - 1) => (4n^2)/(4n^2 - 1) = 1, but, unless my algorithm is wrong, I did not reach the limit. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)