News for hackers. Stuff that matters.
Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by ythl on Monday August 15, 2016 @12:01PM (#12291289)
I had never heard of this product formula before, so I whipped up a quick python program: http://pastebin.com/FBR8rWxv

All I can say is wow, that formula slow to converge on pi. The product after 100 million terms is: 3.141592637878503

You can see that 100M terms only gets you 8 decimals of precision.

Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by theophrastus on Monday August 15, 2016 @12:48PM (#12291603)
If speed of convergence is what you seek, i've yet to discover a more impressive case than a surprisingly simple method attributed to Gauss using the geometric and arithmetic means of two numbers. Three times around the loop and it's already correct to five decimal places: http://pastebin.com/674YJ9VM
Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by pvg on Monday August 15, 2016 @02:08PM (#12292228)
You can get faster convergence although not quite as simple.

https://en.wikipedia.org/wiki/Approximations_of_π#Efficient_...

Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by xyzzyz on Monday August 15, 2016 @01:23PM (#12291853)
For another famous, but also very slow series converging to pi, try

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

Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by jeffwass on Monday August 15, 2016 @01:57PM (#12292144)
If anyone's curious, that series comes from the equation Arctan(1)=Pi/4 and the Taylor expansion around zero of Arctan(x) = x - x^3/3 + x^5/5 + ... where x=1.

What makes this expansion particularly painful is that usually Taylor expansion is done around a point where x is small, such that the x^n numerators of subsequent terms get progressively smaller. But in this case the numerator is always 1, so the series depends entirely on the denominator for convergence.

Meanwhile, the denominator doesn't grow by the usual increasing factorial terms common to Taylor series, but grows only linearly. So both effects combined cause this expansion to take a very long time to converge.

Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by iamgopal on Monday August 15, 2016 @01:27PM (#12291880)
Is there a acceleration ? May be it converge much faster than rest of the method after say a billion precision point ?
Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by wrappertool on Monday August 15, 2016 @02:22PM (#12292338)
Are slow convergences useful for testing purposes?

What is being tested with 100million function calls?

Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by Twirrim on Monday August 15, 2016 @01:53PM (#12292107)
maybe I'm missing something (haven't tried to debug it), but that just results in 0.

edit: Oh that's interesting. Python 2 gave me 0, Python 3 worked fine.

Re:An Elementary Proof of Wallis’ Product Formula for Pi (2005) by pvg on Monday August 15, 2016 @02:02PM (#12292185)
Probably missing that python 2 defaults to integer division.