Methods of approximation

Add a reply

Posted by mick 626 days ago:
I was curious what methods people are using for this challenge. I had originally tried the simplest approximation I could find:

pi/4 = 1 - 1/3 + 1/5 -1/7 + 1/9 ...

But it converges much too slowly to be useful...I don't think it's possible to get 1000 digits of precision in the 4-second time limit.

Now I'm using Machin's formula plus the Taylor series approx for arctan:

pi/4 = 4*arctan(1/5) - arctan(1/239)
arctan(x) = x - x^3/3 + x^5/5 - x^7/7 + x^9/9 ...

Anyone else care to suggest a good approximation function for this challenge?
Posted by Trinary 612 days ago:
You couldn't get anywhere using those, mainly because of precision limitation. bcmath is also not available.
Posted by hendrik 89 days ago:
I used the Rabinowitz method. Fast and short. Can be found quickly by googling.

Add a reply