PiFast33 usage
==============
Run PiFast33.exe in a dos window if you are on Windows.
On unix platforms, launch PiFast33 in a unix shell window
(You may type chmod +x PiFast33 before running it on unix).
0. First specify the menu item you want to use :
[0] To compute Pi with the Chudnovsky formula. This Pi computation method is the
fastest.
[1] To compute Pi with the Ramanujan formula. This second mode is here for
verification and is ~40% slower than mode [0].
[2] To compute E with the exponential series 1+1/1!+1/2!+1/3!+...
[3] To compute E with the inverse of the exponential series
11/1!+1/2!1/3!+... [2] and [3] give the same timings and can
be used together to check a E computation.
[4] To compute Sqrt(2) (+verification). This item is essentially here to test
PiFast on ranges that I cannot reach on my computer. The timings are at
least ten times faster compared to the Pi computation.
[5] When a computation has been completed with a compressed
output, this menu permits to decompress the corresponding data.
Decompression can be made only on given digit indexes, or on regular user specified
ranges. Different output decompression format are also available.
[6] When a pi computation (option [0] or [1]) have been completed
with a compressed result, this option rereads the compressed pi
file and check the result. It makes use of the Fabrice Bellard
formula which computes directly the nth bit of pi. The
verification is several times faster than the direct computation.
1.
[0] To make the computation run in the standard mode (no disk memory usage). This mode
should be used for not too big computations.
[1] To make the computation run in the basic disk memory mode. The disk memory mode
permits to reach a larger number of digits but is slower than
[0] when the number of digits is not large. For example, on my 128M
machine, the best timings for 32 millions digits are obtained
with the standard mode, and the disk memory mode [1] is faster for
64 millions digits.
The exact threshold depends on your machine and disk memory access
speed.
[2] To make the computation run in the advanced disk memory mode.
You should use it if you want to reach a very large number of
digits. It is asymptotically faster than the mode [1] but more disk
memory consuming (~twice than mode [1]).
The threshold highly depends on the machine. On my
128M machine, the best timings for 64 millions digits are obtained in
mode [1], the timings slightly better in mode [2] for 128
millions digits, much better in mode [2] for 256 millions digits.
2. Then specify the number of digits wanted (at least 10000). This
number does not need to be a power of two or whatever.
3. Then several possible memory management mode are proposed to you,
depending on the available physical memory at running time. They
correspond to an FFT size expressed in k. Choose the fastest which
fits in your free physical memory, and enter the corresponding FFT size.
4. Specify if you would like the output to be directly compressed by
PiFast. If the compressed output mode is choosen, the compressed data
can be decompressed by running PiFast again with choice [5] in the
menu. Different output format are also available while decompressing
the data.
5. (Disk memory mode with Pi computations only)
In the disk memory mode, you can achieve your computation in
several runs. That means that you can for example run the program
only during the night or when you do not work on your computer.
You should specify a time threshold (Tmax) in hours (floating point
values are valid). The computation stops as soon as the timing since
the beginning of the run is more than Tmax, at the end of a step
of the algorithm. Specify a zero value for Tmax if you do not want
to use this feature.
The time threshold is not really precise since a complete step must
be performed before the execution is stopped.
After a run which has been stopped at some step, a new execution of
the program detects the existence of a parameter file ("ParamPiFast")
and automatically continue the computation at the next step. (Do not
kill the other files "AA", "PP" and "QQ", they are needed to continue
the execution).
You must also specify a time threshold for this second execution, that
can brings you to a third run, etc.
A timing summary of each of your steps appears as a header in the
result file pi.txt.
Trick : entering the time threshold of 1 stops the run at the
end of the series computation.
The PiFast program has an easy autoverification (it compares some
of the digits computed with some precomputed digits in a table).
NOTE : the amount of disk space specified in the disk memory mode
takes into account the needed disk space to write the output
data.
Execution sample (example in the disk memory huge mode, with compressed
output) :
 > C: PiFast33
 PiFast, version 3.3
 Menu :
 [0] Compute Pi with Chudnovsky method (Fastest)
 [1] Compute Pi with Ramanujan method
 [2] Compute E by the exponential series exp(1)
 [3] Compute E by the exponential series 1/exp(1)
 [4] Compute Sqrt(2) (useful for testing)
 [5] Decompress a result file
 [6] Check a compress result Pi file
 Enter your choice : 0

 Choose your computation mode :
 [0] standard mode (no disk memory used)
 [1] basic disk memory mode (for big computations)
 [2] advanced disk memory mode (for huge computations)
 Enter your choice : 2

 Number of decimal digits : 1000000
 Possible FFT modes, with approximate needed memory :

 FFT Size= 32 k, Mem=1536 K, MemDisk=3906 k (Fastest mode)
 FFT Size= 16 k, Mem=768 K, MemDisk=3906 k (Time: Fastest mode * 1.1)
 FFT Size= 8 k, Mem=384 K, MemDisk=3906 k (Time: Fastest mode * 1.2)
 FFT Size= 4 k, Mem=192 K, MemDisk=3906 k (Time: Fastest mode * 1.4)
 FFT Size= 2 k, Mem=96 K, MemDisk=3906 k (Time: Fastest mode * 1.9)
 FFT Size= 1 k, Mem=48 K, MemDisk=3906 k (Time: Fastest mode * 2.5)
 ...

 Enter FFT Size in k :16

 Compressed output (also useful to specify output format) ? [0=No, 1=Yes] : 1

 In the disk memory use mode, you can do your computation
 in several runs by entering a time threshold for the current
 run. The next run will start where the current run has stopped.
 Time threshold in hours (0 if single run wanted) : 0

 Total Physical Memory Allocated = 868 Kbytes
 Computing series with index N=70529
 Starting step 4
 Starting step 3 .....
 Starting step 2 .....
 Starting step 1 .....
 Starting step 0 .....
 Series computing time : 70.61
 Inverse : Done
 Division time : 13.19
 SquareRoot : Done
 InvSqrt time : 5.50
 Final huge multiplication time : 5.83
 
 Computation time of this run : 95.56 seconds
 Total computation time : 95.56 seconds(~0.03 hours)
 Writing informations into file pi.txt

 The computation seems OK
 Compressing result file ...
To decompress digits between position 999000 and 1000000, rerun PiFast33
again, choose mode 5 and you are lead to
 Decompress :
 [0] The latest Pi compressed file
 [1] The latest E compressed file
 [2] The latest Sqrt2 compressed file
 Enter your choice : 0
 *******************************************************

 Decompressing Pi file

 ===========================
  OUTPUT FILE 
 ===========================

 Output [0=standard output, 1=file] : 0
 ===========================
  DIGITS RANGE 
 ===========================

 The file contains 1000000 decimal digits.
 All digits [0], range specification [1], x digits every y digits [2] ? : 1
 Enter start index of digit : 999000
 Enter end index of digit : 1000000
 ===========================
  OUTPUT FORMAT 
 ===========================

 Enter output format [0=Default, 1=Custom] : 0

 ++++++++++++++++++++++++++++++++++++++++++++++++++

 Pi digits between digit 999001 and digit 1000000
 3036010723 4368901360 6427581425 2839878594 9179979611 : 999050
 2196379757 6519245218 6709608809 2137111977 5000878159 : 999100
 3043072934 4883930957 5741592413 7528597779 7291893453 : 999150
 8505080383 1986774590 0251865791 7237080857 4164297153 : 999200
 8078840607 1306868036 1982419715 7747638950 7253468404 : 999250
 5691927595 3193722370 2229015580 0656076047 3854735990 : 999300
 4477996748 7499697694 2713766869 5533195125 3377640985 : 999350
 8709668386 3263926164 9456086841 4037456842 0719405950 : 999400
 7017430354 6918215090 0466493998 5517413893 8519757312 : 999450
 1568261622 8622318810 9672974760 6013028331 1937161140 : 999500
 8747270676 2558567775 1199566674 8615196491 2970193318 : 999550
 0849941096 1813929649 2789360902 1253544332 7375064260 : 999600
 6242994120 3273625582 4417498345 0947309453 4366159072 : 999650
 8416319368 3075719798 0682315357 3715557181 6122156787 : 999700
 9364250138 8711702327 5555779302 2667858031 9993081083 : 999750
 0576307652 3320507400 1393909580 7901637717 6292592837 : 999800
 6487479017 7274125678 1905555621 8050487674 6991140839 : 999850
 9779193765 4232062337 4717324703 3697633579 2589151526 : 999900
 0315614033 3212728491 9441843715 0696552087 5424505989 : 999950
 5678796130 3311646283 9963464604 2209010610 5779458151 : 1000000