Comparison benchmarktest for number cruncher testreport
(Version 5)
created 30th of December 2007 by Stefan Steinhaus

Misc. operation

IO Test and descriptive statistics

fn="D:\\mathematik\\ncrunch5\\currency2.txt";

MyFile[fn_]:=Developer`ToPackedArray@N@Import[fn,"Table","HeaderLines"->1,"IgnoreEmptyLines"->True]

LimitsArea={1,261,522,784,1045,1305,1565,1827,2088,2349,2610,2871,3131,3159};

Timing[
	datamat=MyFile[fn];
	Do[
		Do[
			YearData=Take[datamat,{LimitsArea[[j]],LimitsArea[[j+1]]-1},{1,37}];
			YDcols=Transpose[YearData];
			MinYear=Map[Min,YDcols];
			MaxYear=Map[Max,YDcols];
			MeanYear=Mean[Transpose[YDcols]];
		GainLossYear=100-(First[YearData]+0.00000001)/(Last[YearData]+0.00000001)*100,
		{j,1,13}];,
	{k,1,2000}]
	]

Loop 15000x15000

a=1;
Timing[
Do[
Do[a=a+i+j,{i,1,15000,1}];,
{j,1,15000,1}];
]

2000x2000 random matrix ^ 1000

Totaltime=0;
Do[
	a=RandomReal[1/100,{2000,2000}]+1;
	t=AbsoluteTime[];
	a^1000;
	Totaltime=Totaltime+AbsoluteTime[]-t;
,{j,1,200,1}];
Print[Totaltime]

1000000 values sorted in ascending order

Totaltime=0;
Do[
	a=RandomReal[{0,1},1000000];
	t=AbsoluteTime[];
	Sort[a];
	Totaltime=Totaltime+AbsoluteTime[]-t;,
{j,1,100,1}];
Print[Totaltime]

Analysis

FFT over 1048576 random values

Totaltime=0;
Do[
	a=RandomReal[{0,1},1048576];
	t=AbsoluteTime[];
	Fourier[a];
	Totaltime=Totaltime+AbsoluteTime[]-t;,
{j,1,100,1}];
Print[Totaltime]

Algebra

Determinant of a 1500x1500 random matrix

Totaltime=0;
Do[
	a=RandomReal[{0,1},{1500,1500}];
	t=AbsoluteTime[];
	Det[a];
	Totaltime=Totaltime+AbsoluteTime[]-t;,
{j,1,100,1}];
Print[Totaltime]

Inverse of a 1500x1500 random matrix

Totaltime=0;
Do[
	a=RandomReal[{0,1},{1500,1500}];
	t=AbsoluteTime[];
	Inverse[a];
	Totaltime=Totaltime+AbsoluteTime[]-t;,
{j,1,100,1}];
Print[Totaltime]

Eigenvalues of a 1200x1200 randommatrix

a=RandomReal[{0,1},{1200,1200}];

Timing[Eigenvalues[a];]

Cholesky decomposition of a 1500x1500-matrix

Totaltime=0;
Do[
	a=RandomReal[{0,1},{1500,1500}];
	a=Transpose[a].a;
	t=AbsoluteTime[];
	CholeskyDecomposition[a];
	Totaltime=Totaltime+AbsoluteTime[]-t;
,{j,1,100,1}];
Print[Totaltime]

1500x1500 cross-product matrix

Totaltime=0;
Do[
	a=RandomReal[{0,1},{1500,1500}];
	t=AbsoluteTime[];
	Transpose[a].a;
	Totaltime=Totaltime+AbsoluteTime[]-t;
	,{j,1,100,1}];
Print[Totaltime]

Number theory

Calculation of 10000000 fibonacci numbers

gr=N[GoldenRatio];w5=N[(Sqrt[5])];
fiboN[n_]=((gr^n)-(((-gr))^(-n)))/w5;

SeedRandom[16];a=RandomInteger[{100,1000},10000000];

Timing[fiboN[a];]

Stochastic & statistic

Principal component analysis over a 10000x1000 matrix

<<"MultivariateStatistics`";

a=RandomReal[{0,1},{10000,1000}];

Timing[PrincipalComponents[a];]

Gamma function over a 1500x1500 matrix

Totaltime=0;
Do[
	a=RandomReal[{0,1},{1500,1500}];
	t=AbsoluteTime[];
	Gamma[a];
	Totaltime=Totaltime+AbsoluteTime[]-t;
	,{j,1,100,1}];
Print[Totaltime]

Gaussian error function over a 1500x1500 matrix

Totaltime=0;
Do[
	a=RandomReal[{0,1},{1500,1500}];
	t=AbsoluteTime[];
	Erf[a];
	Totaltime=Totaltime+AbsoluteTime[]-t;,
	{j,1,100,1}];
Print[Totaltime]

Linear regression over a 1000x1000 matrix

Totaltime=0;
Do[
	a=RandomReal[NormalDistribution[],{1000,1000}];
	b=Range[1000];
	t=AbsoluteTime[];
	LinearSolve[a,b];
	Totaltime=Totaltime+AbsoluteTime[]-t;,
	{j,1,100,1}];
Print[Totaltime]