Why does it help to use $640320^3 = 8\cdot 100100025\cdot 327843840$ when you calculate $\pi$?

230 Views Asked by At

A Ramanujan-type formula due to the Chudnovsky brothers used to break a world record for computing the most digits of $\pi$:

$$ \frac{1}{\pi} = \frac{1}{53360 \sqrt{640320}} \sum_{n=0}^\infty (-1)^n \frac{(6n)!}{n!^3(3n)!} \times \frac{13591409 + 545140134n}{640320^{3n}} \tag{$*$} $$ For implementations, it may help to use $640320^3 = 8\cdot 100100025\cdot 327843840$.

How does this help?

3

There are 3 best solutions below

0
On BEST ANSWER

It's likely just for computational efficiency. Some totally unverified ideas:

$327,843,840 = 2^{15} \times 3 \times 5 \times 23 \times 29$. This concentrates a whole bunch of left-shifts (with the powers of $2$).

$100,100,025$ is a perfect square and also has a whole bunch of zeroes in it, which makes it faster to multiply with an arbitrary-precision library (zero times anything is zero, after all).

And the $8$ is three left-shifts.

0
On

Since: $$327,843,840=2^{15}\cdot(3\cdot5\cdot23\cdot29), \quad 100,100,025= (3\cdot5\cdot23\cdot29)^2$$

So to calculate $6403203^{3n}$, you just need to calculate $(3\cdot5\cdot23\cdot29)^{3n}$ and then use a bit shift.

2
On

$$e^{\pi\sqrt{163}}\ \simeq\ 640,320^3+744\qquad\iff\qquad\pi\ \simeq\ \frac{\ln(640,320^3+744)}{\sqrt{163}}$$ See Heegner number for more details. The precision is $30$ decimals.