Fred lunnon: Magma running on iMac core-i7 is 10x faster.. q := 31415; time squsq := foursquares(q); Time: 0.170 #squsq; 829 HansH>Since Bill Gosper was using his own timing function (as opposed to one of Mathematica's built-in timing functions), I guess it needs to be asked: Is your time absolute or CPU-time only? ----------- My timer is absolute: SetAttributes[tim, HoldAll]; tim[xp_] := ReleaseHold[(Print[#1]; If[#1 > 69, Speak[#1]]; #2) & @@ AbsoluteTiming[xp]] Retrying, In[37]:= tim[Length[PowersRepresentations[31415, 4, 2]]] During evaluation of In[37]:= 0.000200 Out[37]= 829 Harrumph. In[38]:= ClearSystemCache[]; tim[Length[PowersRepresentations[31415, 4, 2]]] During evaluation of In[38]:= 0.000229 Out[38]= 829 Harrumph. Did someone say "memoizing"? Switching to system timing in 9.0.0 In[34]:= Timing[Length[PowersRepresentations[3, 4, 2]]] Out[34]= {0.019141, 1} In[35]:= Timing[Length[PowersRepresentations[31415, 4, 2]]] Out[35]= {1.698000, 829} --rwg
participants (1)
-
Bill Gosper