Dec 062017
 
Calculate pi to million digits with ASM source and FoxPro demo (spigot alg.).
File PICALC.ZIP from The Programmer’s Corner in
Category Assembly Language
Calculate pi to million digits with ASM source and FoxPro demo (spigot alg.).
File Name File Size Zip Size Zip Type
PI386.ASM 38945 11717 deflated
PI386.COM 1024 951 deflated
PI386.LST 63310 15354 deflated
PICALC.ASM 3983 1524 deflated
PICALC.COM 85 85 stored
SPIGOT.PRG 9779 4039 deflated
SPIGOT.TXT 5174 1235 deflated
TPCREAD.ME 199 165 deflated

Download File PICALC.ZIP Here

Contents of the SPIGOT.TXT file



Compute base value for error comparisons that follow...

2096 3.1415926535 8979323846 2643383279 5028841971 6939937510 5820974944
5923078164 0628620899 8628034825 3421170679 8214808651 3282306647
0938446095 5058223172 5359408128 4811174502 8410270193 8521105559
6445229489 5493038196 4428810875 6659334461 2847564823 3786783165
2712019091 4564856692 3460348610 4543266482 1339360726 0249141273
7245870066 0631558817 4881520920 9628292540 9171536436 7892590360
0113305305 4882046652 1384146951 9415116094 3305727036 5759591953
0921861173 8193261179 3105118548 0744623799 6274956735 1885752724
8912279381 8301194912 9833673362 4406566430 8602139494 6395224737
1907021798 6094370277 0539217276 2931767523 8467481846 7669405132
0005681271 4526356082 7785771342 7492810264 0641

Double array size repeatedly to check error estimate--press key

size calculated value of with about 12 slack decimals
---- --------------------------------------------------
1 2.0000000000 00
2 2.6666666666 66
4 3.0476190476 190
8 3.1371295371 2953
16 3.1415797881 3759582
32 3.1415926534 4763572428 01
64 3.1415926535 8979323843 8940102933 86
128 3.1415926535 8979323846 2643383279 5028841962 5480107417 7
256 3.1415926535 8979323846 2643383279 5028841971 6939937510 5820974944
5923078164 0628620709 1712489513
512 3.1415926535 8979323846 2643383279 5028841971 6939937510 5820974944
5923078164 0628620899 8628034825 3421170679 8214808651 3282306647
0938446095 5058223172 5359408128 4811057856 1463553
1024 3.1415926535 8979323846 2643383279 5028841971 6939937510 5820974944
5923078164 0628620899 8628034825 3421170679 8214808651 3282306647
0938446095 5058223172 5359408128 4811174502 8410270193 8521105559
6445229489 5493038196 4428810875 6659334461 2847564823 3786783165
2712019091 4564856692 3460348610 4543266482 1339360726 0249141273
7245870059 9061593117 9
2048 3.1415926535 8979323846 2643383279 5028841971 6939937510 5820974944
5923078164 0628620899 8628034825 3421170679 8214808651 3282306647
0938446095 5058223172 5359408128 4811174502 8410270193 8521105559
6445229489 5493038196 4428810875 6659334461 2847564823 3786783165
2712019091 4564856692 3460348610 4543266482 1339360726 0249141273
7245870066 0631558817 4881520920 9628292540 9171536436 7892590360
0113305305 4882046652 1384146951 9415116094 3305727036 5759591953
0921861173 8193261179 3105118548 0744623799 6274956735 1885752724
8912279381 8301194912 9833673362 4406566430 8602139494 6395224737
1907021798 6094370277 0539217276 2931767523 8467481846 7669405132
0005681271 4526355840 4952993673

Ratio of estimate 0.5**(size+n/2) to relative error (-picalc)/--press key

array error less times less adjusted
n size ratio /2 size *7/16 ratio
-- ---- -------- -------- -------- -------- --------
0 1 1.375969 0.489742 0.489742 -0.285706 0.171996
1 2 1.169362 0.283135 0.566270 -0.209179 0.657766
2 4 1.044706 0.158479 0.633915 -0.141533 0.816176
3 8 0.972135 0.085908 0.687267 -0.088182 0.865808
4 16 0.931504 0.045277 0.724439 -0.051009 0.880563
5 32 0.909589 0.023362 0.747587 -0.027862 0.884717
6 64 0.898115 0.011888 0.760805 -0.014644 0.885836
7 128 0.892226 0.005999 0.767928 -0.007520 0.886127
8 256 0.889241 0.003014 0.771636 -0.003813 0.886202
9 512 0.887738 0.001511 0.773529 -0.001920 0.886221
10 1024 0.886983 0.000756 0.774485 -0.000963 0.886225
11 2048 0.886605 0.000378 0.774966 -0.000483 0.886227

Slow radix 10, showing some asterisk bumps--press key

1024 3.1415926535 8979323846 2643383279 4*28841971 6939937510 5820974944
5923078164 0628620899 8627*34825 3421170679 8214808651 3282306647
0938446095 5058223172 5359408128 4811174502 841026*193 8521105559
6446229489 5493038196 4428810975 6659334461 2847564823 3786783165
2711*19091 4564856692 3460348610 4543266482 1339360725 *249141273
724586*059 9061593117 9

Slow radix 100, showing a double asterisk bump--press key

2048 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 3460348610 4543266482 1339360726 0249141273
7245870066 0631558817 4881520920 9628292540 9171536436 7892590360
0113305305 4882046652 1384146951 9415116094 3305727036 5759591953
0921861173 8193261179 3105118548 0744623799 6274956735 1885752724
8912279381 8301194912 9833673362 4406566430 8602139494 6395224737
1907021798 6094370277 0539217176 2931767523 8467481846 7669405131
**05681271 4526355840 4952993673


 December 6, 2017  Add comments

Leave a Reply