Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!crds From: crds@NCoast.ORG (Glenn A. Emelko) Newsgroups: comp.misc Subject: Here are FORMULAS for PI! Message-ID: <1991Jan6.233340.808@NCoast.ORG> Date: 6 Jan 91 23:33:40 GMT Organization: North Coast Public Access *NIX, Cleveland, OH Lines: 97 Okay, okay -- I waited to see if anyone was going to actually put forth any formulas for Pi before I throw in my $1.85 worth of commentary. Here are some formulas for Pi which have historical significance, as best that I can represent them in textual form: ------------------------------------------------------------------------- John Wallis, 1665, VERY slow to converge: WALLIS' PRODUCT Pi 2*2 4*4 6*6 8*8 -- = --- * --- * --- * --- .... 2 1*3 3*5 5*7 7*9 ------------------------------------------------------------------------- James Gregory, 1671, VERY slow to converge: GREGORY'S SERIES Pi 1 1 1 1 -- = 1 - - + - - - + - .... 4 3 5 7 9 ------------------------------------------------------------------------- John Machin, 1706, reasonable convergence: MACHIN'S FORMULA Pi -- = 4 * arctan(1/5) - arctan(1/239) 4 n^3 n^5 n^7 arctan(n) = n - --- + --- - --- + .... 3 5 7 ------------------------------------------------------------------------- John Gauss, about 1850, VERY slow to converge: Pi^2 1 1 1 1 ---- = 1 + --- + --- + --- + --- .... 6 2*2 3*3 4*4 5*5 This is notable because Gauss succeeded in solving the elusive summation of the reciprocals of the squares of the natural numbers -- other than that it has little value. Gauss went on to find similar equations for Pi^3 thru Pi^26! infinity Pi^2 ____ 1 ---- = \ --- 6 /___ n^2 n=1 ------------------------------------------------------------------------- Srinivasa Ramanujan, 1914, fast convergance (about 8 digits per term): infinity 1 sqr(8) ____ (4n)! * (1103+26390n) -- = ------ * \ --------------------- Pi 9801 /___ (n!)^4 * 396^(4n) n=0 Note that by definition, 0! = 1. ------------------------------------------------------------------------- Johnathan M. Borwein and Peter B. Borwein, 1986, EXTREMELY fast: (A computer iterative approach, the number of correct digits increases by a factor of four for each term! This is not the fastest converging algorithm they developed, but it may be the most efficient. This is *the* algorithm used on supercomputers to produce the 1986 record of 29,360,000 decimal places on a Cray-2 by David H. Bailey, iterating it only 12 times, also to set the 1987 record of 134,217,000 places on a NEC SX-2 by Yasumasa Kanada and his colleagues.) Y(0) = sqr(2) - 1 A(0) = 6 - 4sqr(2) For each iteration (start with n=0): 1 - (1-Y(n)^4)^(1/4) Y(n+1) = -------------------- 1 + (1-Y(n)^4)^(1/4) Compute the result Y(n+1) and then use it in the following: A(n+1) = [(1+y(n+1)^4) * A(n)] - [2^(2n+3) * Y(n+1) * (1+Y(n+1)+Y(n+1)^2)] If you wish to do another iteration, increment n and go for it. When you are done, Pi = 1/A(n+1). My sincere apologies to Borwein and Borwein for butchering this so badly (it's accurate but hardly readible) ------------------------------------------------------------------------- The article mentioned in the bibliography below about Ramanujan is very interesting, and I highly recommend it for all to read. It also contains most of the the formulas I transcribed above, plus numerous others and alot of the theory that went along with their development. Enjoy! Glenn A. Emelko ------------------------------------------------------------------------- Bibliography: Ramanujan and Pi, Jonathan M. Borwein and Peter B. Borwein, Scientific American, February 1988, Volume 258 Number 2 A History of Pi, Peter Beckmann, The Golam Press, 1977.