There are so many π programs available, that I thought it would be nice to have a central repository for the various programs. Here's my stab at such a place...


7/18/05 Has been a while... A few updates, and a reorg. More coming.

3/17/02 Added hfloatpi, fixed a few inaccuracies. My next task is to get pidigit 2 to compile. Hmm...

3/12/02 Well, this page is new, and likely to get a fair bit of updating in the next few days.

Thanks to all the folks whose programs I have tested. Without them, I wouldn't have anything to do with my free time! Special thanks to Jason Papadopoulos and Stuart Lyster for inspiration.

Mac OS MacOS X

Test System: Apple PowerMac G5, 1.8GHZ PowerPC G5, 512MB RAM

Software: MacOS X 10.3.9, compiled programs built with Apple's gcc 3.3, build 1671 (bundled), using flags -O3 -funroll-loops -ffast-math -mcpu=970..

Comparison: Number of seconds taken to compute 1 million digits of π by the top 5 programs

Program Time
gmp-chudnovsky 7.88
pi_css5 14.61
pi-agm 2.3.1 15.63
chud14 28.41
aptest 2.4.1 95.82



Test System: Dell Precision 470N, 3.2GHZ Intel Xeon, 2048MB RAM

Software: Debian GNU/Linux 3.0, compiled programs built with Intel C compiler 9.0 and optimizations of -O2 -xN. Windows programs run under Wine 20050628.

Comparison: Number of seconds taken to compute 1 million digits of π by the top 5 programs.

Program Time
gpi 3.1 2.53
pifast 4.3 3.27
Schnell_pi 1.0 4.25
gmp-chudnovsky 5.21
pi_css5 6.83


Alphabetical Listing

Here are listed all the π computation programs I've found that are capable of calculating more than 30000 digits. For programs where the source code is available I include binaries only for the fastest few. They should be easy enough to build...

Program Author Notes Download
ahppi 2 Alan Pittman ahppi2 is Alan Pittman's π program based on the fftw fft package. It is a much faster and improved version of ahppi, itself a program with a reasonably lengthy history. chud14 is faster and newer though. Limited to 4m digits. source 8k
aptest 2.4.1 Mikko Tommila Originally intended as a demonstration of the power of Mikko Tommila's apfloat C++ numerics package, aptest has acquired a number of remarkable features: it has a multiprocessing version, and it can go up to 1.9 billion digits. See the apfloat homepage
blokpi Jason Papadopoulos blokpi is Jasonp's fastest offering which uses Gosper's series, and has x86 assembly for added speed. Medium performance, but good reference if you want to see how to assembly code multiplication. Also interesting because of its ability to frazzle compilers (Intel's vaunted compiler give considerably worse performance on it than gcc on it, for instance). source 16k
calculate pi 1.5 Martin Mamo calculate pi is an adaptation of the program winpi for Macintosh. Slow, but historical: I remember my original discovery of it fondly (calculating 100,000 digits on a 120MHZ PowerMac 8500 in about an hour). Limited to 1 million digits. Mac only (no source). macosx 64k
chud 1.4 Alan Pittman chud14 is Alan Pittman's newest π program based on the fftw fft package, and using the Chudnovsky formula. Goes up to 32m digits. Reasonably fast. source 12k
giopi 4.1p Giovanni Ciampa giopi41p is a port of Giovanni's original program for Atari, which once won an award for speed. Doesn't run under Wine. windows 148k
gmp-pi (gmp-chudnovsky, gmp-gauss, gmp-ramanujan) Hanhong Xue gmp-pi popped up not long after pifast was released. So-named because of its use of the gmp library for fast multiplication, it was nonetheless a surprising demonstration of how useful gmp could be. Plus the Chudnovsky variant is the only open-source program faster than pi_css5 (hello Alpha...). Can be built anywhere gmp can (which is basically anywhere you've got a decent C compiler). Unfortunately limited by the gmp library to 4 million digits.

source 8k

windows 156k

macosx 100k

linux 100k

hfloatpi Jorg Arndt hfloatpi is a rather comples pi program, although it can calculate much more than pi. While it does have source, I couldn't get it to build. It does however demonstrate the power of the hfloat numerics package which it is based on. Medium speed. The author also wrote much of the book "Pi Unleashed", an excellent reference in all respects. Up to 8 million digits. See the hfloat page.
megapi Alan Pittman megapi is Alan's earlier, arctangent based pi program, using Gauss' formula. Pretty slow. source 4k
pi32 Terje Mathisen pi32 is an all assembly program, using Machin's formula, of middling speed. Runs under Wine. windows 24k
pi4-8 Giovanni Ciampa Pi4 and Pi8 are Windows programs using the Gauss-Legendre formula and Takuya Ooura's fft code. Rather fast, with a limit of 2 million digits. Doesn't run in Wine. windows 100k
pi8 Carey Bloodworth pi8 is an ancient, but easy to understand program which can use a multitude of formulas to calculate pi. It was also Carey's starting point, leading on to pi-agm. Quite slow. source 4k
pi-agm 2.3.1 Carey Bloodworth pi agm was the first pi program I started playing with (and was for a period, the fastest one around). It holds the distinction of having calculated 32 million digits on a 486, in less time than David Bailey did on his Cray some 7 years before. It also became the first program to calculation 1 billion digits on a personal computer. Sadly it has not been updated recently. A good open-source program and an excellent example of many different mechanisms for doing fast multiplication. Depending on the version, can go up to at least 256m digits.

source 520k

pialpern Dario Alpern The antecedent of pidpmie, pialpern is also written in assembly, and has the added bonus of testing one's Spanish skills. Slow. Doesn't run in Wine. windows 24k
pibellard Fabrice Bellard Written around its own fft, pibelard, pibelard, while not fast, provides a good insight into how to design a pi program. Fabrice has moved on to bigger things since, including a miniature c compiler and a CPU-level emulator. source 12k
pi_c50 Jason Papadopoulos pi_c50 is Jason's earlier pi program and uses machin's formula. Rather slow for more than a few digits. Max of 200,000 or so digits. Simple though. source 4k
pi_c51f Jason Papadopoulos pi_c51f is the floating point version of pi_c50. source 4k
pi_css5 Takuya Ooura While not the fastest, or the most elegant, pi_css5 is open source, reasonably fast, and highly portable. Can compute up to 64 million digits. See my other page.
pidig12 Joachim Podlich pidig12 uses its own multiplication scheme, and Borwein's or Newton's formula. Pretty slow. source 16k
pidpm Jan Kraak Jan Kraak's rewrite of Dario Alpern's pialpern. It uses Machin's formula. Doesn't run under Wine. 16k
pidpmie Dario Alpern pidpmie is Dario Alpern's all assembly pi calculator, using a rather complex arctangent formula. It can also calulate ln2, or output pi in any base from 2 to 36. Doesn't run in Wine. Middling speed. 16k
pifast 4.3 Xavier Gourdon For large numbers of digits, pifast is pifastest. A huge variety of options, including a disk mode that lets you compute vast numbers despite limited memory. Pifast is right now the record holder in terms of digits calculated on a PC (~17 billion). Current version is only available for Windows (and closed source). Works with Wine. 156k
piologie Sebastian Wedeniwski piologie is a Windows program to calculate π, e, and lots more besides based on the numerics package of the author. Both recently disappeared. Somewhat slow. Limited to 8m digits. Runs in Wine. 268k
pirabern Landon Rabern Another ancient calculator that uses Machin's formula. Pretty slow. source 4k
piw131 Harry J. Smith Perhaps the oldest calculator I've found. Windows (runs under Wine) and with an amusing interface. Slow. 192k
qpi 3.1 Steve Pagliarulo Up to around 8 million digits, this is the fastest π calculating program out there. Period. Has a number of choices in terms of formulas, and can calculate other mathematical constants too. Limited to 256 million digits. Windows only (closed source) but runs under Wine. 226k
roypi Roy Pilhofer Old, slow and simple. roypi was actually part of a rather interesting website, but the website disappeared a long time ago, along with the author. source 4k
Schnell_pi 1.0 Dominique Delande Schnell_pi popped up out of the blue one day, and proved itself one of the fastest programs at the time. Alas, it has not been updated since, and it's website has since disappeared. One of the very few closed-source Linux programs I've come across. Goes to 512m digits. 230k
Super_pi Yasumasa Kanada Began as one of the faster programs, by the same folks at the U of Tokyo who currently hold the world record on π computation. While it is no longer in the top tier, it remains interesting, for its authors as much as anything else. Closed source, but widely ported. 32m digit maximum. See their FTP archive
winpi Martin Mamo An old, slow, arctangent calculator. 1 million digits is the limit. No source code, but runs under Wine. 24k

Send comments or questions to zdjahromi@zgmail.com (remove the letter 'z' from the address before sending).

Pages last updated: July 21, 2005

valid xhtml