Why no one uses the product formula for sine function to calculate $\pi$?

109 Views Asked by At

$$\sin(\pi x)=\pi x \prod_{n \ge 1}\left(1-\frac{x^2}{n^2}\right)$$

$$\pi = \frac{\sin(\pi x)}{x\prod_{n \ge 1}\left(1-\frac{x^2}{n^2}\right)}$$ Let $x=\frac{1}{2}$ $$\pi = \frac{2}{\prod_{n \ge 1}\left(1-\frac{1}{4 n^2}\right)}$$

The question is Why no one uses this formula to calculate $\pi$? Maybe I am wrong but I have never seen anyone uses this. The answer must be that this formula converge very slowly to $\pi$ and not efficient at all. But how slowly it converge to $\pi$? How much terms it need to reach the correct first 10, 100, 1000 decimals ?

3

There are 3 best solutions below

0
On BEST ANSWER

Let $$\tilde\pi_{(m)} = \frac{2}{\prod_{n= 1}^m\left(1-\frac{1}{4 n^2}\right)}=\pi \,\frac{ \Gamma (m+1)^2}{\Gamma \left(m+\frac{1}{2}\right) \Gamma \left(m+\frac{3}{2}\right)}$$

$$\frac{\tilde\pi_{(m+1)}-\tilde\pi_{(m)}} {\tilde\pi_{(m)}}=\frac{1}{(2 m+1) (2 m+3)}\sim \frac 1{4m^2}$$

So, if you want that between two successive terms the relative difference be $10^{-k}$, you need $$m \sim \frac 12 \sqrt{10^k}$$

5
On

But how slowly it converge to ?

Are you not able to run numerical calculations yourself?

Let $x_N = 2/\prod_{n=1}^N (1 - 1/(4n^2))$. We have $$ x_{100} = 3.133\ldots, \ x_{10^3} = 3.1408\ldots, \ x_{10^4} = 3.1415141\ldots, \ $$ $$ x_{10^5} = 3.1415847\ldots, \ x_{10^6} = 3.1415918\ldots, \ x_{10^7} = 3.14159257\ldots. $$ So it looks like multiplying the number of terms in a partial product by a factor of $10$ typically leads to just one additional correct digits in the partial product. The millionth partial product only gives us $5$ correct digits past the decimal point, which is only halfway to the $10$ correct digits after the decimal point that you asked about. In short, the numerical data point to this product expression having terrible convergence.

0
On

It's obviously slow. Let the sequence be $x_n$ then $\dfrac{x_n}{x_{n-1}}=\frac{1}{1-\frac{1}{4n^2}}\approx1+\frac{1}{4n^2}$

Let's say you wanna have $100$ significant digits then $\frac{1}{4n^2}<\frac{1}{10^{100}}$ hence $n > 2.5 \cdot10^{49}$

Another reason is that long multiplication is a lot slowlier than long addition