Post Reply 
[VA] SRC #010 - Pi Day 2022 Special
03-15-2022, 03:11 PM (This post was last modified: 03-18-2022 08:57 AM by Ángel Martin.)
Post: #3
RE: [VA] SRC #010 - Pi Day 2022 Special
Valentín, many thanks for the very interesting contribution, you've done it again !

As you guys know I'm "stuck" in the 41 world, which means can't really duplicate Valentín's results due to its "venerable"(read: severely limited) data precision/accuracy design: a 10-digit mantissa in user code definitely ain't going to cut it, and sure enough my FOCAL routines did not work at all.

I decided to give MCODE a chance to see how much of an improvement 3 additional digits would make, and interestingly enough it works, well sort of works because again, the benchmark is always up against the same barrier. The ink is still fresh, I *think* it's all correct but there may be errors...

For anyone who may care about the details, in the attached pdf you can see the MCODE listing for PPIE, based on Valentín's product formula plus adding the two correction factors. Cutting to the chase the final results show that the sweet spot appears for n=495 terms, which gives a 10-digit value of 3.141592703 , i.e. a delta of 1.55972E-08 (in percent absolute value) versus the 10-digit native pi value.

So on one hand the restrictions won't allow going much further, but at least it doesn't take an exorbitant number of terms to reach such "local optima", for the lack of a better definition (yes, I know: poor man's consolation at play...)

Here's the complete table with all logged results - note how things go south quite rapidly for N>500, which I can only attribute to the inadequate platform for this type of exercise - unless someone can spot other flaws to my reasoning?

Code:
n       result          |Delta|
10      3.157699001     0.005126809
100     3.141749935     5.00641E-05
200     3.14163147      1.23555E-05
300     3.141608481     5.03789E-06
400     3.141598986     2.01554E-06
450     3.141595562     9.25645E-07
475     3.141593955     4.14121E-07
480     3.141593627     3.09716E-07
490     3.141592941     9.13549E-08
494     3.141592753     3.15127E-08
495     3.141592703     1.55972E-08
496     3.141592601     1.68704E-08
500     3.141592352     9.61296E-08
505     3.141592156     1.58518E-07
510     3.141591874     2.48282E-07
550     3.141589274     1.07589E-06
600     3.141585534     2.26637E-06
800     3.141568893     7.56336E-06
900     3.141557011     1.13455E-05
1000    3.141540165     1.67078E-05
1010    3.141538781     1.71483E-05
1020    3.141537075     1.76913E-05
1050    3.141531634     1.94233E-05
1100    3.14152368      2.19551E-05
1200    3.14150274      2.86205E-05
1300    3.141478162     3.64439E-05
1500    3.141419233     5.52016E-05
2000    3.141179128     0.000131629

Anyway, thanks to Valentín for the opportunity to play around with this, I'm really enjoying it. It goes without saying that PPIE will make its way into the forthcoming PIE ROM, soon to be released.

Best,
ÁM

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #010 - Pi Day 2022 Special - Ángel Martin - 03-15-2022 03:11 PM



User(s) browsing this thread: 2 Guest(s)