Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 5552

8-bit acorn software: other • Re: Computing pi in two iterations (AGM method)

$
0
0
With a bit of help from @scruss, I've got a little further in understanding what's going on - I was finding that the cost to compute pi wasn't going up consistently as the number of digits goes up. That was most unexpected, and long story short it turned out I was measuring the wrong thing - I was measuring the time it took to see how accurate the result was, which was dominating the calculation.

So, using gp, I get these results:
original method 1430651 digits
1.21 real 1.18 user 0.02 sys
original better method 1500140 digits
1.23 real 1.19 user 0.03 sys
second method 1430652 digits
0.98 real 0.95 user 0.02 sys
And this prompts me to ask, is there a better version of the second method? It is 25% faster but delivers 5% fewer digits.

I notice (owlet link) that the final error - the difference to pi - from Schoenhage's formulation is half that of Brent's original. What I'd like to do is figure out the equivalent improvement that Brent notes (switching from a^2 to (a+b)/2 squared) in Schoenhage's formulation.

Statistics: Posted by BigEd — Sun Jul 20, 2025 12:28 pm



Viewing all articles
Browse latest Browse all 5552

Trending Articles