Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Mathematica .nb by a .m script, and adapt fateman.jl
This saves LOT OF lines, and seems to be the correct way of comparing the time of the calculation. The time returned is the minimum time of performing 5 times the calculation. To be fair, fateman.jl also computes 5 times and returns the minimum one. A fair comparison of what Mathematica does, one has to compare with fateman2 or fateman4 output.
- Loading branch information
Luis Benet
committed
Aug 7, 2015
1 parent
f9791da
commit 4c622dd
Showing
3 changed files
with
34 additions
and
88,393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(* Timing a test by Fateman | ||
In a mac, run this as | ||
/Applications/Mathematica.app/Contents/MacOS/MathematicaScript -script ./timing_Fateman.m) | ||
The `timeit` function is slightly modified from | ||
https://github.com/JuliaLang/julia/blob/master/test/perf/micro/perf.nb | ||
which is licensed under MIT | ||
*) | ||
|
||
ClearAll[timeit]; | ||
SetAttributes[timeit, HoldFirst]; | ||
timeit[ex_, name_String] := Module[ | ||
{t}, | ||
t = Infinity; | ||
Do[ | ||
t = Min[t, N[First[AbsoluteTiming[ex]]]]; | ||
, | ||
{i, 1, 5} | ||
]; | ||
Print["mathematica,", name, ",min(time),", t]; | ||
]; | ||
|
||
(* Print[First[AbsoluteTiming[Function[n,Expand[(1+x+y+z+w)^n * (1+(1+x+y+z+w)^n)]][20]]]] *) | ||
|
||
timeit[Function[n,Expand[(1+x+y+z+w)^n * (1+(1+x+y+z+w)^n)]][20],"fateman"] |
Oops, something went wrong.