home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / misc / math / ecalc / ecalc.doc < prev    next >
Encoding:
Text File  |  1995-10-03  |  6.4 KB  |  184 lines

  1. ***********************************************
  2. eCalc - A program to find e - about 2.718281828
  3. ***********************************************
  4.  
  5. Requirements to using eCalc V2.6:
  6. - Amiga with 68020 or better CPU  (a FPU is not needed and not used anyway)
  7. - Workbench/Kickstart 2.04 or better (I haven't tested it with less than 3.0)
  8. - About 130 % as much bytes memory as the accuracy you want e
  9. - Time (and patience!)
  10.  
  11. It uses no external libraries.
  12.  
  13. This program is Freeware: It may be distributed freely for non-commercial
  14. purposes. It should be free and a copying fee must not exceed £2.
  15. This program may not be distributed with any magazine-coverdisk without
  16. written permission. It may be included in any PD-library or on CDs including
  17. PD software, such as the Fish, Aminet and other series including similar
  18. free software.
  19.  
  20. The program and this docfile may not be changed or modified!
  21.  
  22. YOU USE THIS PROGRAM ON YOUR OWN RISK. THE AUTHOR CAN NOT AND WILL NOT
  23. GUARANTEE ITS ACCURACY, NOR ANY OTHER DAMAGES ARISING FROM ANY USE OR
  24. MISUSE OF THIS PROGRAM AND DOCUMENTATION.
  25.  
  26. If publishing a result produced by eCalc, please give credit to the author
  27. and state which version of the program you used (V2.6).
  28.  
  29. History
  30. -------
  31.  
  32. This program was ported from my piCalc 2.6 program in about half an hour
  33. It is many times faster than piCalc though and should be able to calculate
  34. 100000 decimal places e in less than an hour (on the slowest 68020 machines).
  35.  
  36. How to use it
  37. -------------
  38.  
  39. eCalc is Shell/CLI-only utility. To use it you have to open a shell-window.
  40. In its simplest form you write (from Shell)
  41.  
  42. You can always stop the program with Ctrl-C.
  43.  
  44. "eCalc XXXXX" where XXXXX is the number of decimals eCalc should calculate.
  45.  
  46. The higher number of decimals the more time the calculation will take. If you
  47. think of calculating many decimals (more than 20000) you should run eCalc
  48. with the "ESTIMATE" option:
  49.  
  50. "eCalc estimate 100000" will estimate how much time a calculation of 100000
  51. decimals will take, so that you won't be surprised by how slow things are
  52. going.
  53.  
  54. If you want to save the result to a file, use "SAVEFILE=filename", the result
  55. will be written to this file when it has finished.
  56.  
  57.  
  58. Those options in full
  59. ---------------------
  60.  
  61. Type "eCalc ?" for the eCalc Template:
  62.  
  63. DECIMALS/N,EVERY/N,SAVEFILE,SAVEEVERY/N,NOTIFY/S,NOOUTPUT/S,ESTIMATE/S
  64.  
  65.  
  66. DECIMALS
  67. is the number of decimal places you want eCalc to calculate, this must be
  68. between 1 and 2,147,483,647. Except when "ESTIMATE" is selected, you will
  69. need about 130 % as much memory free as the number of decimal places you
  70. want to calculate e to. (e.g. 1,000,000 decimals requires less than 900 kb
  71. memory.)
  72. (If not specified, the program uses 50 decimals)
  73.  
  74. EVERY
  75. is how often you want eCalc to output its current calculation of e. If you
  76. use "EVERY 10000" eCalc will output to screen (StdOut) when it has 10000, 
  77. 20000, 30000 and so on of decimals. This option is probably most useful when
  78. used with the "NOTIFY" option.
  79.  
  80. SAVEFILE
  81. when specified eCalc will save its calculation to the specified file, this
  82. it a much nicer method than running eCalc with a ">" redirection file.
  83. Beware: If eCalc can't create this file it would not give any error messages,
  84. just continue on!
  85.  
  86. SAVEEVERY
  87. specifies how often eCalc should save its current calculation to SAVEFILE.
  88. Beware: This will slow eCalc considerably down because eCalc has to perform
  89. a binary to decimal conversion each time.
  90.  
  91. NOTIFY
  92. is a very useful option in conjunction with the EVERY and SAVEFILE
  93. options. It notifies you how far it has come, writing "Dec: XXXX"  to the
  94. Shell-window, where XXXX is how many decimals it has calculated so far, so
  95. you have some kind of control of the process. Write NOTIFY EVERY 1000 to
  96. have eCalc notify you every time it has calculated 1000 new decimals.
  97.  
  98. NOOUTPUT
  99. is useful when you use the SAVEFILE option and don't want e to be
  100. echoed to screen as this can take quite a while with many decimals.
  101.  
  102. ESTIMATE
  103. will estimate the TIME needed to calculate e. The estimating may take
  104. a number of seconds (2-6) but will display a rough indication on how
  105. long the calculation will take: You should not touch the mouse or keyboard
  106. during this test, as this will cause eCalc to over-estimate the time needed.
  107.  
  108.  
  109. Is eCalc calculating the right value for e?
  110. ---------------------------------------------
  111.  
  112. Actually I don't know, it uses the same routines as piCalc and piCalc seems
  113. calculate pi correctly. The first decimals of e seems to be correct, as I
  114. have made another (extremely much slower) program using the definition and
  115. got the same value. You should not depend on eCalc giving you the right
  116. value, but it is probably correct (I hope).
  117.  
  118. Please don't have a large number of other programs running when eCalc
  119. is busy calculating. A single bug in any of the programs running alongside
  120. eCalc could accidentally write to a memory location used by eCalc and
  121. giving a wrong result as eCalc does absolutely NONE checking on the
  122. result as this would decrease performance considerably.
  123.  
  124.  
  125. Program technicals (programmers)
  126. ---------------------------------
  127.  
  128. This program uses 32/64 bit integer math, using the Mulu.L/Divu.L instructions
  129. heavily. The speed of this program therefore is largely dependent on the speed
  130. the CPU carries out such multiplications and dividitions. The program stores
  131. e as a long binary chunk.
  132.  
  133. Why is 68020 required?
  134.  
  135. Just because I was able to make the program 3 times faster when I could
  136. 68020 instructions instead of 68000 only.
  137.  
  138.  
  139. Program technicals (math)
  140. -------------------------
  141.  
  142. Calculation method:
  143.  
  144. e = 1/0! + 1/1! + 1/2! + 1/3! + 1/4! + 1/5! ...
  145.  
  146. where
  147. 0! = 1
  148. 1! = 1
  149. 2! = 1 * 2 = 2
  150. 3! = 1 * 2 * 3 = 6
  151. 4! = 1 * 2 * 3 * 4 = 24 and so on
  152.  
  153. If you know a better formula/method or know another e-calculation program
  154. (that is faster), please write to me!
  155.  
  156.  
  157. Author
  158. ------
  159.  
  160. Write if you know of any SERIOUS bugs (e is not accurate, fails on 68060,
  161. etc.) If you have calculated e with more than 1,000,008 decimals using this
  162. program or know a more efficient formula or another Amiga program that is
  163. faster, please email/write! 
  164.  
  165. PS: Also try my program piCalc V2.6 that is identical to eCalc V2.6 except
  166. that it calculates pi=3.14159265...)
  167.  
  168. My email-address is: steffent@stud.unit.no
  169. My WWW-homepage is:  http://www.stud.unit.no/~steffent
  170.  
  171. My snail-mail address: (safe, but slow: 1-3 weeks)
  172. Steffen Thorsen
  173. Fjordg 8a
  174. N-4300 Sandnes
  175. Norway
  176.  
  177. Snail-mail while im studying (usually fast, except during my holidays
  178. (Christmas, Easter, Summer: [June-August]):
  179.  
  180. Steffen Thorsen
  181. Stud.post 198, NTH
  182. N-7043 Trondheim
  183. Norway
  184.