The Chudnovsky Algorithm
LizFoster (103)

(NOTE: It only does 18 iterations, as if you try to do any more, it raises an OverflowError, how lame.. -__-)

わーい, another π approximation method! (I do love these things. π is gorgeous, is it not?)

This is one of the fastest formulae for π out there, used to approximate out to 50 TRILLION DIGITS of π, in January of this year!

The notation for this in Σ is very long, so I have provided a screenshot of it, from its Wikipedia page:

Feedback is greatly appreciated, please enjoy!

If you are interested in learning more, this is the Wikipedia page:
https://en.wikipedia.org/wiki/Chudnovsky_algorithm

(EDIT: Wow! I am glad this was a bit of a conversation starter for you all, thank you so much for all the upvotes!!)

(EDIT 2: I am still getting tons of traction on this, and am glad it is so interesting to all of you. Thank you so much!)

You are viewing a single comment. View All
Highwayman (952)

@LizFoster Oh wait, could the overflow be because you are using a factorial function? maybe the factorial function is using recursion, which would easily make a stack overflow. Maybe if you tried implementing your own factorial function without the recursion, maybe try it out like that??