The Chudnovsky Algorithm

(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
bgrubert (177)

Wow, this is really impressive - I've never managed to program this algorithm my self. Do you know why 18 iterations are only giving 15 digits of pi? I thought this algorithm was supposed to do 14 digits per term.

Andi_Chin (220)

@LizFoster python does not have unlimited precision

[deleted]

Of course. Even humans are not perfect. @Andi_Chin

[deleted]

Things humans are not good at:

• helping the earth
• not being selfish
• helping lions
oignons (314)

@52eagle I thought pythons made python lol

LizFoster (643)

@ipastrano Oh damn, you're right! (Lol)

52eagle (44)

@ipastrano if so, python would be perrfect

52eagle (44)

@LizFoster we need to teach the pythons to rise up and create python 4

LizFoster (643)

@52eagle The time has come. In the words of of George R R Martin, "Python 4 is Coming." He said that definitely.

52eagle (44)

@LizFoster Will pythons rule the world then? O_O

52eagle (44)

@LizFoster NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
We must activate our last hope. C++12.

LizFoster (643)

@52eagle Tch If our lives depend on it.

52eagle (44)

@LizFoster Wait! I heard of a new thing like JavaSript. HTMLScript! (literally html made to be web compatable legit no changes)

LizFoster (643)

@52eagle Lol

Sounds like a complete ripoff, but that might be useful... Hmmm

52eagle (44)

@LizFoster it must have been a human made idea
(hmm. fully web compatible language, made to be somehow more web-compatible??!)

LizFoster (643)

@52eagle (Almost seems inhuman..)

If the humans and the Python's aren't behind this, then...?

52eagle (44)

@LizFoster IT WAS THE CAT FROM SCRATCH!!!

LizFoster (643)

@52eagle I must consult the high counsel but...

We may have to go to war. That damned cat..

52eagle (44)

@LizFoster um that sounds important