Re: Transformation Methods for Pi
- To: mathgroup at smc.vnet.net
- Subject: [mg22390] Re: Transformation Methods for Pi
- From: Chris Tiee <choni at my-deja.com>
- Date: Sun, 27 Feb 2000 18:55:30 -0500 (EST)
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
In article <892q74$pn9 at smc.vnet.net>, sniff <sniff at home.com> wrote: > In Mathematica 4, the usage of N[Pi,10000000] (with $MaxPrecision = > Infinity) strongly suggests that the people at Wolfram Research are still > not using the best way to calculate Pi. It is very slow. Are they still > using a calculus based method (such as arctan functions) to compute this > number? On my old NT system, 8,388,608 digits of Pi are calculated in 2,851 > seconds when using compiled C code of a transformation method and FFT to > speed up multiplications. Using Mathematica 4, I terminated the calculation after 17 > hours. - It was still not done. > Where can I find more information regarding Mathematica 4 and its way to > compute Pi. The documentation states that the Chudnovsky method for calculating Pi up to 10 million digits (right on the dot for the calculation to your precision). I'm actually not too familiar with various algorithms and I so from experience I have no idea how the calculation gets done or nor any idea of its rate of growth. Keep in mind that Mathematica uses a lot of system resources, as it is a far more general mathematical application than just a pi-digit calculator. Obviously, especially on older systems, the performance of a program specialized to do pi calculation and *only* pi calculation should be vastly more efficient. I conducted an experiment on my computer, a new Pentium 3 550 MHz, with 128 MB memory and 16 GB free space on the hard drive; so this was not exactly what you'd call a resource-deprived system. I set Mathematica on calculation of Pi to 10 million digits, while I continued to actively use the computer. It took approximately 3800 seconds to complete (just over an hour). I then rebooted, freed the system of any resource-hoggers, and disabled the screensavers, etc. and set Mathematica to the task while I left the computer alone. I came back, the job was done in approx 750 seconds. Major improvement. Finally, before I went to sleep, I set it up to calculate pi separately for 1 million, 2 million, 3million, and so on up to 10 million, and show the timing for each in a list. The results I got the next morning were interesting, and I set the computer do the task again. Results were similar, just as interesting: #of digits (in millions) Time Taken (in Seconds) 1 76.67 2 123.91 3 197.57 4 266.11 5 284.02 6 555.73 7 566.60 8 627.63 9 723.42 10 764.40 When looking at just 1 and 10, it appears that the Chudnovsky algorthm has a perfectly linear rate of growth with respect to # of digits. But look between 4 and 5 million, and you notice that's a pretty small gap. And then between 5 and 6, huge difference! What is going on here, anyway (as I said before, I'm not exactly experienced with algorithms of this sort). Oh yes and, what algorithm does Pi calculation beyond 10 million digits use (documentation specifically states Chudnovsky's is used only up to 10 million) -- Chris Tiee "Choni" | Primary email: choni at ucla.edu Alternate emails: choni at cyberjunkie.com, ch0ni at hotmail.com Sent via Deja.com http://www.deja.com/ Before you buy.