They first told me that pi was 22/7, and we solved problem like the circumference of a circle with a diameter of 7 inches being 22 inches. Later I found out that 22/7 was only an approximate value for pi. Pi was the first number like this for me. When I got a numerical answer containing, for example, the square root of 2 I knew how to compute the answer because I knew how to compute the square root of 2. When an answer contained pi, it was a little less known.
Later when we got into logarithms, exponentials, and trigonometric functions, many numerical answers were only approximations, but pi was the first for me.
The first time I tried to compute pi to more places than is normally needed, I computed it to 50 decimal places using paper, pencil, and a hand calculator. The equation used was
ArcTan(1/x) = 1/x − 1/(3 * x**3) + 1/(5 * x**5) − ...
This was done in the early 1970's. The equation was derived in 1706 by John Machin (1685-1751). After I got my Apple II+ computer in 1979, I computed pi to 15,300 decimal places using Apple Pascal and the equation
This is the same equation I used in 1989 to compute a 114,632 decimal place value using Borland Turbo Pascal on an IBM AT compatible computer. The equation is due to Carl Friedrich Gauss (1777-1855).
I now have developed a package on a PC that computes pi in the 1,000,000 decimal digit range and runs in a time of approximately O(n Log(3n)).
The algorithms used are documented in Scientific American, February 1988, Ramanujan and Pi, by Jonathan M. Borwein and Peter B. Borwein.
Algorithm a:
y[n] = (1 − SqRt(1 − y[n−1]^2)) / (1 + SqRt(1 − y[n−1]^2))
x[n] = ((1 + y[n])^2 * x[n−1]) − 2^n * y[n]
Algorithm b:
y[n] = (1 − SqRt(SqRt(1 − y[n−1]^4))) / (1 + SqRt(SqRt(1 − y[n−1]^4)))
x[n] = ((1 + y[n])^4 * x[n−1]) − 2^(2n+1) * y[n] * (1 + y[n] + y[n]^2)
For both algorithms, x[n] converges to 1/π. Algorithm a is quadratically convergent and algorithm b is quartically convergent.
-Harry
Return to Computing Pi
Return to Harry's Home Page