Manual
Manual
0 Documentation
Copyright (c) 2000-2006 S. Pagliarulo
To properly view this document in Notepad, maximize the Notepad window and
make sure a fixed-width font such as Courier is selected. To print this
document, open it in Notepad or any other word processor and select Print from
the File menu.
INSTALLATION
DISTRIBUTION NOTES
The files that comprise the QPI40.ZIP file including the QPI v4.0 executable
are freely available for distribution. If you plan to distribute QuickPi to
friends, associates or online, you must distribute the entire file set as
originally received. Do not distribute individual files.
-----------------
QUICKPI OVERVIEW
USAGE INFORMATION
QuickPi is a command line program and as such you will need to start a Command
Prompt window to use it. Refer to your Windows help guide for information on
how to start a Command Prompt window.
Once a Command Prompt window has been started, be sure the QuickPi application
QPI.EXE (or QPI64.EXE) is located in your system path. If it's not, then
change the current working directory to that chosen when the program was first
installed. Again, refer to your Windows help guide for information on PATHs
and the CHDIR command.
Entering QPI on the command line without any parameters will produce the
following information:
qpi 2k
qpi 1mi
The output will be sent to the console screen. To save the output to a text
file, simply specify a destination file name following the digits
specification:
This will save the output to the file "pi.txt" as well as providing progress
information to the console screen. Note, the output of QuickPi 4.0 can also
be "routed" with the > operator as with previous versions of QuickPi. In this
case however, no progress information will be provided to the console screen.
Entering QPI on the command line with the -h option will produce the following
additional information:
-OPTIONS-
-OUTPUT FORMAT-
-fancy:dpc,dpr, dpc - digits per column [default=10]
dpb,bs,dc, dpr - digits per row [default=50]
fl dpb - digits per block [default=500]
bs - block spacing [default=1]
dc - digit counting (none,row,block) [default=row]
fl - flags (noindent,indent) [default=noindent]
-COMPUTATION-
-formula[n] use alternate formula (1-n) for computation
-inverse compute multiplicative inverse
-MEMORY MANAGEMENT-
-mem:size set upper memory limit (affects performance)
-swap:path specify the location of swap files
-noswap disable swap file creation
-MISCELLANEOUS-
-train train program for optimal performance
-binary compress output and create binary file
-stats output computation statistics only (suppress digit data)
-checksum include checksum of computation result
-save save options as default values
-license display software license information
OPTION DESCRIPTIONS
-agm[1|2|3]
This option causes QuickPi to compute Pi using one of the AGM (Arithmetic-
Geometric-Mean) formulas first discovered by Gauss and Legendre and later
independently by Brent and Salamin. QuickPi actually uses optimized algorithm
variants of these formulas.
The AGM formulas are iterations that are quadratic in nature (the number of
digits doubling with each iteration). To compute a million digits of Pi, the
AGM typically uses 19 iterations.
-borwein
This option causes QuickPi to compute Pi using a quartic iteration discovered
by Jonathan and Peter Borwein. A quartic iteration quadruples the number of
digits at each iteration (at the cost of more operations per iteration). To
compute two million digits of Pi, the Borwein quartic formula only requires 10
iterations.
-chudnovsky
This is the default option for QuickPi when no other options are specified.
This option causes QuickPi to compute Pi using a Ramanujan series formula
discovered by David and Gregory Chudnovsky. This formula provides
approximately 14 correct digits per term. This is currently QuickPi's fastest
method for computing Pi.
-ramanujan
This option causes QuickPi to compute Pi using one of the many series formulas
discovered by Srinivasa Ramanujan. The particular formula used by QuickPi
provides approximately 8 digits per term and runs predictably slower than the
series by the Chudnovsky brothers.
-machin
This option causes QuickPi to compute Pi using the arctangent formula
discovered by John Machin in 1706. Machin's refinement on the
Gregory/Leibniz series yielded a formula with a significantly greater rate of
convergence: pi/4 = 4 arctan(1/5) - arctan(1/239)
-stormer
This option causes QuickPi to compute Pi using an arctangent formula
discovered by F.C.W. Stormer in 1896. This is one of the same formulas used
by Yasumasa Kanada of the University of Tokyo (2) and his team to compute Pi
to a record 1 trillion digits: pi/4 = 44 arctan(1/57) + 7 arctan(1/239) - 12
arctan(1/682) + 24 arctan(1/12943)
-exp -e
This option causes QuickPi to compute the natural logarithmic base, e. The
constant e = exp(1) is defined as: 1 + 1/1! + 1/2! + 1/3! + ...
-catalan
This option causes QuickPi to compute Catalan's constant. Catalan is defined
by the following series: 1/1^2 - 1/3^2 + 1/5^2 - 1/7^2 + 1/9^2 - ... and is
usually denoted as K, G or sometimes C. QuickPi uses a faster series by
Alexandru Lupas for this computation.
-gamma
This option causes QuickPi to compute Euler's constant (or Mascheroni's
constant) and is defined as the limit of: 1 + 1/2 + 1/3 + 1/4 + 1/5 + ... +
1/n - ln(n). The constant is usually denoted by the lower-case Greek letter
Gamma. QuickPi uses a faster method due to Brent and McMillan for this
computation.
-ln2
This option causes QuickPi to compute the natural log of 2. Ln2 is the
solution to the equation: e^x = 2.
-ln10
This option causes QuickPi to compute the natural log of 10. Ln10 is the
solution to the equation: e^x = 10.
-phi
This option causes QuickPi to compute the Golden Mean. Also known as the
Golden Ratio or the Golden Section, it is usually represented by the Greek
letter Phi. QuickPi uses Newton's iteration for computing Phi (see -sqrt2).
The formula for Phi is: (1 + sqrt(5)) / 2.
-sqrt2 -2
This option causes QuickPi to compute Pythagoras' constant, the square root of
2. QuickPi uses Newton's iteration for computing the square root of 2. With
an initial estimate (x) for the square root of 2, Newton's iteration converges
quadratically using the sequence: x = (x/2 + 1/x).
-zeta3
This option causes QuickPi to compute Apery's constant, Zeta(3). Zeta(3) is
defined by the formula: 1 + 1/2^3 + 1/3^3 + 1/4^3 + ... QuickPi uses a faster
series discovered by Amdeberhan and Zeilberger for this computation.
-fancy:
This option allows the formatted output of QuickPi to be customized. The
default format is 10 digits per column, 50 digits per row and 500 digits per
block. Blocks are separated by 1 blank line, digits are counted after each
row and lines are not indented. Specifying each (in order) as follows can
change these parameters:
-fancy:dpc,dpr,dpb,bs,dc,fl
For example, the following parameters cause QuickPi to output 5 digits per
column, 50 digits per row, 1000 digits per block with lines indented. Note
that any missing parameters remain unchanged.
-fancy:5,50,1000,,,indent
There are two other valid parameters for this option. They are -fancy:default
and -fancy:raw. The first causes the QuickPi to revert to its original
default parameters and the second causes QuickPi to produce unformatted
output. Unformatted output is simply a stream of digits without spaces or
line termination.
-formula[n]
This option enables QuickPi to use an alternate formula for a computation.
Specifying -formula1 causes QuickPi to use its primary (default) formula and
specifying -formula2 thru -formula9 causes QuickPi to use an alternate
(generally slower) formula. Alternate formulas are useful to verify the
correctness of a computation. The following constants have alternate
formulas:
-catalan -formula2
-exp -formula2
-ln2/ln10 -formula2
-phi -formula2
-sqrt2 -formula2
-zeta3 -formula2
-inverse
This option causes QuickPi to compute the multiplicative inverse or reciprocal
result. This option is not available for all constants.
-mem:size
This option sets the upper limit of memory use for QuickPi. The size
parameter may be followed by an m to indicate megabytes (1048576 bytes). The
smallest value that can be specified is 32 megabytes, smaller values are
ignored. When the upper limit of memory is reached, QuickPi will reduce its
memory consumption and may swap memory to disk unless the creation of swap
files is disabled (see -noswap option). Note, very large computations may
still push QuickPi over the specified memory limit.
-swap:path
Normally, QuickPi creates swap files in the current directory. This option
causes QuickPi to use the specified path as the location for creating swap
files. A drive letter may be included as part of the path. The path must
already exist. Swap files are placed in the current working directory if a
path is not specified.
-noswap
This option prevents QuickPi from creating swap files when running low on
memory.
-train
This option causes QuickPi to train or configure itself for a specific
computer environment. Once trained, QuickPi will usually run faster than its
default configuration. Training will normally take several minutes to
complete. Training information is saved to a QPI.INI file located in the same
directory as QPI.EXE. QuickPi will then read the training information the
next time it's run. It is recommended that all Windows applications be closed
and any background tasks (including screensavers) be disabled prior to
initiating training.
-binary
This option causes QuickPi to write its output as a compressed binary file.
Compressed files are generally 1/2 to 1/3 the size of QuickPi's normal output.
A secondary reader program QRD (included) is required to view compressed
binary files. The QuickPi Reader program is described below.
-stats
This option causes QuickPi to output computation statistics only and suppress
the output of digit data. This can be useful when only the statistics of a
computation are desired for comparison purposes.
-checksum
This option will cause QuickPi to calculate and display a checksum for a
computation result. A checksum can be useful to validate a result without
having to perform a digit by digit comparison.
-save
This option causes QuickPi to save the settings of the above specified options
to a QPI.INI file located in the same directory as QPI.EXE. The next time
QuickPi is started; it will automatically read the QPI.INI file and default to
the saved options. This is particularly useful for the -fancy option and its
various parameters.
-license
This option displays the QuickPi license information.
----------------
READER OVERVIEW
USAGE INFORMATION
The QuickPi Reader is a command line program and as such you will need to
start a Command Prompt window to use it. Refer to your Windows help guide for
information on how to start a Command Prompt window.
Once a Command Prompt window has been started, be sure the Reader program
QRD.EXE (or QRD64.EXE) is located in your system path. If it's not, then
change the current working directory to that chosen when the program was first
installed. Again, refer to your Windows help guide for information on PATHs
and the CHDIR command.
Entering QRD on the command line without any parameters will produce the
following information:
qrd pi.bin
The output will be sent to the console screen. To save the output to a text
file, simply specify a destination file name after the source file name:
Entering QRD on the command line with the -h option will produce the following
additional information:
options:
OPTION DESCRIPTIONS
-stats
This option causes the QuickPi Reader to output computation statistics only
and suppress the output of digit data. This option can be used to obtain a
summary of a compressed binary file's contents.
-nostats
This option causes the QuickPi Reader to suppress the output of computation
statistics that normally precede the digit data. This option should be used
when only digit data is desired.
-range:
This option causes the QuickPi Reader to limit the range of digits output. A
starting point, an ending point, or both starting and ending points can be
entered, separated by a dash. Multiple ranges can be specified by separating
them with a comma or by entering multiple -range options from the command
line. For example, the following parameters will output the first and last
100 digits of 20k computed digits:
-range:1-100,20381-20480
-skip:
This option causes the QuickPi Reader to skip across the full range of
computed digits and to only occasionally output a specified number of them.
The first parameter specifies the number of digits to output. The second
parameter specifies the skip amount. For example, the following parameters:
-skip:100,10000
cause the QuickPi Reader to produce the following output with 20k computed
digits of Pi:
3.
1415926535 8979323846 2643383279 5028841971 6939937510 : 50
5820974944 5923078164 0628620899 8628034825 3421170679 : 100
-fancy:
This option allows the formatted output of the QuickPi Reader to be
customized. The default format is saved as part of the compressed binary file
created by QuickPi. Unless changed when using QuickPi, the default format is
10 digits per column, 50 digits per row and 500 digits per block. Blocks are
separated by 1 blank line, digits are counted after each row and lines are not
indented. Specifying each (in order) as follows can change these parameters:
-fancy:dpc,dpr,dpb,bs,dc,fl
For example, the following parameters cause QuickPi Reader to output 5 digits
per column, 50 digits per row, 1000 digits per block with lines indented.
Note that any missing parameters remain unchanged.
-fancy:5,50,1000,,,indent
There are two other valid parameters for this option. They are -fancy:default
and -fancy:raw. The first causes the QuickPi Reader to revert to its original
default parameters and the second causes the QuickPi Reader to produce
unformatted output. Unformatted output is simply a stream of digits without
spaces or line termination.
-inverse
This option causes the QuickPi Reader to compute and output the multiplicative
inverse or reciprocal of a result.
-square
This option causes the QuickPi Reader to compute and output the square of a
result.
-binary
This option causes the QuickPi Reader to write its output as a compressed
binary file. This option is useful when combined with the -inverse or -square
options.
-license
This option displays the QuickPi Reader license information.
-------------------
PROGRAM LIMITATIONS
The upper limit for the 32-bit version of QuickPi is 1 billion digits. The 64-
bit version has been successfully tested with over 100 billion digits and has
a theoretical upper limit of 500 billion digits. The exact upper limit
depends on several factors including but not limited to the amount of memory
and disk space available. Each new release of QuickPi should continue to
perform faster and with higher precision.
The author and the contributors to this work disclaim all warranties as to
this software, whether express or implied, including without limitation any
implied warranties of merchantability, fitness for a particular purpose,
functionality or data integrity or protection.
In no event shall the author, nor the contributors be liable for any direct,
indirect, incidental, consequential, special or punitive damages which may
result from the use of this software, including loss or interruption of
business, accidental loss of data, or damage to computer equipment.
ACKNOWLEDGEMENTS
My thanks and appreciation to all the Beta testers who have assisted with the
testing of this version over the past few months. With the benefit of their
help, QuickPi has become a far superior program. A special thanks to Shigeru
Kondo for his extra dedication, enthusiasm, helpful feedback and suggestions.
WEBSITES DEDICATED TO PI