Simon Plouffe wrote:
I was reading an article on the ENIAC, that monster could add 100,000 10 digits numbers in 1 second. At the time it was impressive in 1946 of course.
I made this simple test, a naive test. I took maple 11, with a 3.0 Ghz PC pentium. ##################################### Digits:=10: som:=0: for i from 1 to 1e99 do: som:=som+1.0/i: if i mod 100000 = 0 then lprint(i,som) fi: od: ##################################### It displays the partial sum of the harmonic series every 100000 terms. this is not optimized, a lazy program.
Well, this is the bad news. That loop made on a modern computer with one of the top programs goes at the SAME speed. It takes 1 second to display each step.
Mma seems comparable: Timing[Block[{s = 0}, For[{n = 1}, n <= 100000, s += 1/N[n++, 10]]; s]] {0.906 Second, 12.09014613} Macsyma (using 16 digit doublefloats instead of 10 digit bigfloats): (c4) (showtime:true,block([s:0],for n thru 100000 do s:s+1.0d0/n,s)) Time= 1594 msec. (d4) 12.0901461298633d0 (c5) harm(n):=block([s:0.0d0],mode_declare([n,k,s],float),for k thru n do s:s+1.0d0/k,s) Time= 0 msec. (d5) harm(n):=block([s:0.0d0],mode_declare([n,k,s],float), 1.0d0 for k thru n do s : s + -----, s) k (c6) harm(100000.0) Time= 1672 msec. (d6) 12.0901461298633d0 BUT (c7) compile(harm) time= 0 msec. (d7) [harm] (c8) harm(100000.0) Time= 78 msec. (d8) 12.0901461298633d0 Why does everybody ignore Macsyma? It should be mentioned that these were run in conflict with a second, rogue Mma process trying to FactorInteger repunit 71. Pausing continued to hog cpu, and subsession won't enter, so I just whacked the process priority. --rwg