π= 16 arctan 1/5-4 arctan 1/239
This formula was discovered by John Ma Qing, a British astronomy professor, in 1706. He used this formula to calculate the pi of 100. Ma Qing formula can get 1.4 decimal precision for each calculation. Because its multiplicand and dividend are not greater than long integers in the calculation process, it is easy to program on the computer.
There are many arctangent formulas similar to Ma Qing's formula. Of all these formulas, Ma Qing's seems to be the fastest. Even so, if we want to calculate more digits, such as tens of millions, Ma Qing's formula is not enough. The algorithm described below takes about one day to calculate on PC, and the precision of pi exceeding 1 100 million bits can be obtained. These algorithms are more complicated to implement with programs. Because the calculation process involves multiplication and division of two large numbers, FFT (Fast Fourier Transform) algorithm should be used. FFT can shorten the multiplication and division time of two large numbers from O(n2) to O(nlog(n)).
2. Ramanukin formula
19 14 years, Indian mathematician Ramanukin published a series of *** 14 formulas for calculating pi in his paper. This formula can get the precision of 8 decimal places for each calculation. 1985, Gosper used this formula to calculate the digits of17,500,000 of pi.
1989 David chudnovski and Gregory chudnovski improved Lamanukin formula, which is called chudnovski formula, and the decimal precision of 15 can be obtained every time. 1994, Chu and Denovski brothers used this formula to calculate 4.044 billion. Another form of chudnovski formula that is more convenient for computer programming is:
3.AGM (arithmetic-geometric average) algorithm.
Gauss-Legendre formula:
Every iteration of this formula will get double decimal precision, for example, to calculate 654.38+0 million bits, 20 iterations is enough. 1September, 1999, Japanese Gao Qiao Jing Daole and Jintian were using this algorithm to calculate the digits of pi of 206158,430,000, setting a new world record.
4. Four iterations of Polvin:
This formula was published by Jonathan Bowen and Peter Bowen in 1985, and it converges to pi four times.
5. Bailey-Bovine-Plouffe algorithm.
This formula, abbreviated as BBP formula, was published by David Bailey, Peter Bowen and simon plouffe in 1995 * * *. It breaks the traditional algorithm of pi, and can calculate any nth bit of pi without calculating the previous n- 1 bit. This provides feasibility for distributed computing of pi. 1997, Browder found a formula 40% faster than BBP:
pi/4 = 1- 1/3+ 1/5- 1/7+ .......
a= 1/5- 1/3/5^3+ 1/5/5^5- 1/7/5^7+ 1/9/5^9- 1/ 1 1/5^ 1 1+ ....
b= 1/239- 1/3/239^3+ 1/5/238^5- 1/7/239^7+ 1/9/239^9- 1/ 1 1/239^ 1 1+ ...
π/4 = 4A-B