Mysticial / Mini-Pi

A miniature program that can compute Pi to millions of digits.
Creative Commons Zero v1.0 Universal
134 stars 23 forks source link

New method of calculating PI #11

Open rennokki opened 4 months ago

rennokki commented 4 months ago

I just found out about the paper and I figured out that there is a way to calculate PI's digits faster: https://www.youtube.com/watch?v=rGd7Db52w1Q

Mysticial commented 4 months ago

Interesting formula. But it does not look faster than the Chudnovsky formula. (or even close to it) I haven't worked out the cost model parameters, but given that the polynomial degree for the BSR recursion is at least 3 and I don't see another large term to go with it, it stands no chance against Chudnovsky.

rennokki commented 4 months ago

Long story short, at the time of the writing I wasn't able to dig into the math, but the math is mathing.

Yes, the Chudnovsky is way faster. The new formula is way too complex, Chudnovsky yields 14 digits per computation and converges fast while the new formula is actually a series; when lambda = [10, 100], 30 computations converge to just 10 decimal places. The Pochhammer index is actually yikes.

The complexity seems to be O(n^2) for both, but it's irrelevant since the Chudnovsky yields 14 digits.

Glad you took a look at it! Thanks! 👍🏼