My prior post "inspired me" to generate more digits. Amazing how fast 
modern hardware is compared to "super computers" of 20 years ago...

$ time ./pi 25
  Version 2.0 of the super_pi for Linux OS
  Fortran source program was translated into C program with version 19981204 of
  f2c, then generated C source program was optimized manually.
  pgcc 3.2-3 with compile option of "-fast -tp px -Mbuiltin 
-Minline=size:1000 -Mnoframe -Mnobounds -Mcache_align -Mdalign 
-Mnoreentrant" was used for the
  compilation.
  ------ Started super_pi run : Fri Jan 8 18:38:51 CST 2010
  Start of PI calculation up to 33554432 decimal digits
  End of initialization. Time=      23.996 Sec.
  I= 1 L=       0        Time=      76.185 Sec.
  I= 2 L=       0        Time=      84.991 Sec.
  I= 3 L=       1        Time=      85.697 Sec.
  I= 4 L=       2        Time=      84.602 Sec.
  I= 5 L=       5        Time=      84.055 Sec.
  I= 6 L=      10        Time=      84.457 Sec.
  I= 7 L=      21        Time=      83.957 Sec.
  I= 8 L=      43        Time=      85.108 Sec.
  I= 9 L=      87        Time=      85.022 Sec.
  I=10 L=     174        Time=      84.239 Sec.
  I=11 L=     349        Time=      86.323 Sec.
  I=12 L=     698        Time=      85.690 Sec.
  I=13 L=    1396        Time=      84.695 Sec.
  I=14 L=    2794        Time=      87.071 Sec.
  I=15 L=    5588        Time=      87.726 Sec.
  I=16 L=   11176        Time=     106.115 Sec.
  I=17 L=   22353        Time=     108.253 Sec.
  I=18 L=   44707        Time=      84.235 Sec.
  I=19 L=   89415        Time=      83.708 Sec.
  I=20 L=  178831        Time=      84.253 Sec.
  I=21 L=  357662        Time=      83.539 Sec.
  I=22 L=  715326        Time=      82.344 Sec.
  I=23 L= 1430652        Time=      79.633 Sec.
  I=24 L= 2861304        Time=      74.834 Sec.
  End of main loop
  End of calculation.    Time=    2137.256 Sec.
  End of data output.    Time=       6.110 Sec.
  Total calculation(I/O) time=    2143.366(     571.308) Sec.
  ------ Ended super_pi run : Fri Jan 8 19:15:15 CST 2010

real    36m23.268s
user    26m46.226s
sys     8m57.306s

So, 36.4 minutes to calculate, format and store 1+2^25 digits of Pi 
(actually they throw in the initial 3. gratutiously...).

The host system was a Core 2 Duo running Red Hat Linux -

model name      : Intel(R) Pentium(R) 4 CPU 3.00GHz
cpu MHz         : 2992.654
cache size      : 2048 KB
MemTotal        : 1553460 kB

$ ja
    version ''
Installer: j602a_linux32.sh
Engine: j602/2008-03-03/16:45
Library: 6.02.023java version "1.4.2" gij (GNU libgcj) version 4.1.2 
20070626 (Red Hat 4.1.2-13)

    $pifmt =. fread 'PI.DAT'
37312536
    300 {. pifmt  NB. Formatted output from Super Pi
  PI=3.
  1415926535 8979323846 2643383279 5028841971 6939937510 5820974944 
5923078164 0628620899 8628034825 3421170679
  8214808651 3282306647 0938446095 5058223172 5359408128 4811174502 
8410270193 8521105559 6446229489 5493038196
  4428810975 6659334461 2847564823 3786783165 2712019091 4564856692 3460

    $pi =. pifmt -. 'PI= ',LF   NB. Includes the initial 3 and the 
decimal point.
33554434
    2^25x
33554432

    ] pidigits =. 48 0 -"2 1~ (~. ,: #/.~) a.i.pi -. '.'  NB. ASCII 
codepoint for 0 is 48
       3       1       4       5       9       2       6       8       7       0
3355076 3355566 3357258 3356382 3355866 3356627 3353819 3354116 3354632 3355091

    hist =: ~. ,: #/.~               NB. histogram of numeric vector
    shist =: ] {"1~ [: /: 0 { ]      NB. sort on row 0 of matrix
    rl =: [: #;.1~ 1 , 2 ~:/\ ]      NB. run lengths

    shist hist pirls =. rl pi-.'.'   NB. run lengths of digits in pi
        1       2      3     4    5   6  7 8 9
27181722 2718768 270560 27026 2684 286 34 1 1

    shist (~. pirls),: (I. ~: pirls) { +/\pirls  NB. First occurance 
of run lengths
1  2   3    4     5   6      7        8        9
1 26 156 1593 17539 768 710107 22931753 24658610

    (((I. ~: pirls) { +/\pirls) +/ i:10){pi-.'.'  NB. show the first runs.
226097306314159265358
238462643383279502884
081284811174502841027
113499999983729780499
728909777727938000816
667680000010652624854
537333333386381390842
694444444436403113618
477777777724846769425

    NB. First run above is a little confusing since 226097306
    NB. is the last 9 of the  33554433 digits...
    NB. Also a bit confusing is that Feynman's point occurs before
    NB. runs of 4 and 5 digits.

    ~~~

Hours of fun playing with Pi.

You can find the SuperPi binaries for OS/X, Linux, and Windows with a 
Google search.

If anyone wants the data I generated, I could make the 18 megabyte 
zip file of the formatted version available to download, might be a 
little quicker than generating it again, or maybe not....

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to