View
8
Download
0
Category
Preview:
Citation preview
Comparison of Numerical Performance of Mathematica 11.3 and
Maple 2018Summary���������������������������������������������������������������������������������������������������������������������������������������������
�������������������������������������
���� �� ����� ������ ��� ���� ������� ��������� ���������� ����������� ��� ���������� ������ ��� ���������� ������ ������������ ���� ������� ��� ���� ������� ����
����������������������������������������������������������������������������������������
Category Tests Median Mathematica speed
Real data operations 20 9 times faster
Real data operations (manual type override) 20 3 times faster
Complex number data operations 16 5 times faster
Complex number data operations (manual type override) 16 5 times faster
Sparse real data operations 7 80,000 times faster
Integer data operations 14 43 times faster
Integer data operations (manual type override) 13 37 times faster
Extended precision data operations (50 digits) 16 8 times faster
Extended precision data operations (1,000 digits) 16 4 times faster
Random number generation 9 7 times faster
Elementary & special functions 90 1,926 times faster
Elementary & special functions (manual type override) 66 17 times faster
Complex elementary & special functions 90 38 times faster
Complex elementary & special functions (manual type override) 90 35 times faster
Elementary & special functions (50 digits) 90 83 times faster
High-precision function evaluation 9 30 times faster
Exact functions 4 8 times faster
GPU operations 1 3 times faster
Total 587 50 times faster
�����������������������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������
Machine-Precision Real Linear Algebra��������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������
��� ����� ������������� ������ ��� ��� ���� ������� ����� ��� �������� �������� ���������������� ������������ ������ �������� ��������� ������ �������� ��� ���������
�������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������
500 1000 1500 2000size
0.2
0.4
0.6
0.8
1.0
1.2
1.4
timeCholesky
500 1000 1500 2000size
0.05
0.10
0.15
0.20
0.25
0.30
0.35time
Convert matrix to vector
500 1000 1500 2000size
0.5
1.0
1.5
2.0time
Covariance
500 1000 1500 2000size
0.5
1.0
1.5
2.0
2.5
3.0time
Det
500 1000 1500 2000size
0.2
0.4
0.6
0.8
1.0
1.2
1.4
timeDot
200 400 600 800 1000size
1
2
3
timeEigenvalues
200 400 600 800 1000size
1
2
3
4
5
6
7
timeEigenvectors
2000000 4000000size
2
4
6
8
10time
Fit
500000 1000000size
0.2
0.4
0.6
0.8
1.0
1.2time
Fourier
500 1000 1500 2000size
1
2
3
4time
Inverse
500 1000 1500 2000size
1
2
3
4
5
6
7
timeLinearProgramming
500 1000 1500 2000size
0.1
0.2
0.3
0.4
timeLinearSolve
100 200 300 400size
0.05
0.10
0.15
0.20
0.25
0.30
0.35
timeMatrixExp
500 1000 1500 2000size
0.5
1.0
1.5
2.0
2.5
timeMatrixPower
1000 2000 3000 4000 5000 6000size
20
40
60
80
timeMatrixRank
2
5000000 10000000size
0.01
0.02
0.03
0.04
0.05
0.06
0.07
timeMean
500 1000 1500 2000size
0.1
0.2
0.3
0.4
0.5
0.6
0.7time
Power
500000 1000000size
1
2
3
4time
Sort
500000 1000000size
0.5
1.0
1.5
2.0
timeSort by absolute value
500 1000 1500 2000size
0.01
0.02
0.03
0.04
0.05time
Transpose
Mathematica 11.3
Maple 2018
��������������������
����������������������������������������������������������������������
Machine-Precision Complex Linear Algebra�����������������������������������������������������������������������������������������������������������������������������������
500 1000 1500 2000size
0.5
1.0
1.5
timeDet
500 1000 1500 2000size
0.5
1.0
1.5
2.0
2.5
3.0
timeDot
200 400 600 800 1000size
2
4
6
8
10
timeEigenvalues
200 400 600 800 1000size
5
10
15
20
timeEigenvectors
500 1000 1500 2000size
0.2
0.4
0.6
0.8
1.0time
Power
500 1000 1500 2000size
0.2
0.4
0.6
0.8
1.0
timeConvert matrix to vector
500000 1000000size
0.05
0.10
0.15
0.20
timeFourier
500 1000 1500 2000size
1
2
3
4
5time
Inverse
500 1000 1500 2000size
0.5
1.0
1.5
timeLinearSolve
3
100 200 300 400 500size
0.5
1.0
1.5
2.0
timeMatrixExp
200 400 600 800 1000size
0.2
0.4
0.6
0.8
1.0
1.2
1.4time
MatrixPower
1000 2000 3000 4000 5000 6000size
100
200
300
400
timeMatrixRank
5000000 10000000size
0.2
0.4
0.6
0.8
1.0
1.2
1.4
timeMean
500000 1000000size
0.5
1.0
1.5
2.0
timeSort by absolute value
500 1000 1500 2000size
0.02
0.04
0.06
0.08
0.10
timeTranspose
Mathematica 11.3
Maple 2018
��������������������
��������� ��� �������� ����������� ��������� ����� ����� ��� ����� ��������� ���� ����� �������� ���� ����� ���������� ���� ����� ������������ ������
�������������������������������������������������������������������������������������������������
Sparse Data��������������������������������������������������������������������������������������������������������������������������������������
��� ����������� ������� ���� ������ �������� ������������ �������� ���������� �� ������ ������� ��� ��������� ��������� ���������� ��������� ���� ����
�����������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������
5000 10000 15000 20000size
10-40.001
0.010
0.100
1
10
100
timeConvert matrix to vector
5000 10000 15000 20000size
5.×10-40.001
0.0050.010
0.0500.100
0.500
timeDot
1000 2000 3000 4000 5000 6000size
0.10
0.50
1
5
timeLinearSolve
2000 3000 4000 5000 6000 7000 8000size
0.001
0.010
0.100
1
10
100
timeMatrixPower
50000000 100000000size
10-5
10-4
0.001
0.010
0.100
1
timeMean
5000 10000 15000 20000size
0.001
0.100
10
timePower
10000 20000 30000 40000size
10-4
0.001
0.010
0.100
timeTranspose
Mathematica 11.3
Maple 2018
4
��������������������
���������������������������������������������������������������������������������������������������������������������������
Integer Linear Algebra���� ������������ ���� ������ ���� �������� ������ �������� ������������ ��������� ������ ���� ������ ��������������� ����� ���� ����� ��� �������� �����
��������� �������� ������������ ���� ��� ���� �������� ������������ ��� ����� ����� �������� ���� ����� ���������� ������� ������������������������� �������
�����������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������
100 200 300 400 500 600size
5
10
15
timeDet
500 1000 1500 2000size
200
400
600
800
1000
1200
1400
timeDot
10 20 30 40 50 60size
1
2
3
4
timeEigenvalues
500 1000 1500 2000size
0.5
1.0
1.5
2.0
2.5
3.0
timePower
500 1000 1500 2000size
0.05
0.10
0.15
0.20
0.25time
Convert matrix to vector
20 40 60 80size
1
2
3
4
5
timeInverse
100 200 300 400 500size
0.5
1.0
1.5
2.0
2.5
3.0
3.5
timeLinearSolve
10 20 30 40size
5
10
15
20
25
30
35
timeMatrixExp
100 200 300 400 500size
10
20
30
40
50
60
timeMatrixPower
500 1000 1500 2000size
5
10
15
20
25
timeMatrixRank
500000 1000000size
0.02
0.04
0.06
0.08
0.10
timeMean
500000 1000000size
0.05
0.10
0.15
timeSort
500000 1000000size
0.5
1.0
1.5
2.0
2.5
3.0
timeSort by absolute value
500 1000 1500 2000size
0.01
0.02
0.03
0.04
0.05
0.06
timeTranspose
Mathematica 11.3
Maple 2018
��������������������
5
������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������
Extended-Precision Data���� ������������ ���� ������ ������� �������������������� ������������ ����� ������������ ������� ���� ������� ��� ��������� ������� ��� ���� �������� ��� �����
����������������������������������������������������������������������������������������������������������������������������������������������
20 40 60 80 100size
1
2
3
4time
Cholesky
50 100 150 200size
2
4
6
8
timeDet
20 40 60 80size
0.5
1.0
1.5
timeDot
10 20 30 40 50 60size
1
2
3
4
5
timeEigenvalues
20 40 60 80size
5
10
15
20
25
30
timeEigenvectors
200 400 600 800 1000size
2
4
6
8
10
timePower
500 1000 1500 2000size
0.05
0.10
0.15
timeConvert matrix to vector
20 40 60 80size
0.5
1.0
1.5
timeInverse
20 40 60 80 100size
0.1
0.2
0.3
0.4
0.5time
LinearSolve
20 40 60 80 100size
5
10
15
20
25
30
timeMatrixExp
20 40 60 80size
1
2
3
4
5
6
timeMatrixPower
50 100 150 200size
10
20
30
40
50
timeMatrixRank
20000 40000 60000 80000 100000size
0.05
0.10
0.15
timeMean
1000000 2000000size
5
10
15
20
timeSort
1000000 2000000size
20
40
60
80
timeSort by absolute value
6
500 1000 1500 2000size
0.1
0.2
0.3
0.4
0.5
timeTranspose
Mathematica 11.3
Maple 2018
��������������������������������������������������������������������������������������������������������������������������������
20 40 60 80 100size
5
10
15
timeCholesky
50 100 150 200size
10
20
30
40
timeDet
20 40 60 80 100size
2
4
6
8
timeDot
20 40 60 80size
10
20
30
40
timeEigenvalues
20 40 60 80size
50
100
150
200
timeEigenvectors
200 400 600 800 1000size
10
20
30
40
timePower
500 1000 1500 2000size
0.2
0.4
0.6
0.8
1.0
timeConvert matrix to vector
20 40 60 80size
2
4
6
8
timeInverse
20 40 60 80size
0.5
1.0
1.5
2.0
2.5
timeLinearSolve
10 20 30 40 50 60size
100
200
300
400
500time
MatrixExp
20 40 60 80size
5
10
15
20
timeMatrixPower
20 40 60 80 100size
5
10
15
20
timeMatrixRank
20000 40000 60000 80000 100000size
0.05
0.10
0.15
0.20
0.25
timeMean
500000 1000000size
5
10
15
20time
Sort
500000 1000000size
10
20
30
40
50
60time
Sort by absolute value
7
500 1000 1500 2000size
0.1
0.2
0.3
0.4
0.5
timeTranspose
Mathematica 11.3
Maple 2018
��������������������
���� ������ ���������� ���� �������� ��� ������������������ ��������� ���� ����� �������� ������ ���� ���� ���� �������� ����� ����� �������� ���� ����� ����
���������������������������
Scalability of Data Operations��� ������ ��� �������� ������������ ��� �������������� ��� ������� ������� ������������ ��� �������� ������ ��������� �� ���� ��� ���� ����������� ������� ��� ����
��������� ��������� ����� ����� ������������ ��� ������ ����� ������� �������� ������������ ���� ������� ���� �������� ������ ���� ����� ������������ �����
��������������������������������������
500000 1000000
100
200
300
400
500
600× faster
Sort
500000 1000000
5×106
10×106
15×106
Fit
float
float[8]
0 100 200 300 400 500
500
1000
1500
× fasterPower
100000 200000 300000
500
1000
1500
2000
Mean
complex
complex[8]
0 20 40 60 80
10
20
30
40
50
60
× fasterInverse
0 100 200 300 400 500 600
1
2
3
4
Det
integer
integer[8]
100 200 300 400
100
200
300
400
500
600
MatrixRank
500 1000 1500 2000
1000
2000
3000
Dot
integer
integer[8]
8
Random Numbers������������������������������������������������������������������������������������������������������������
�������� ����� ������ �� ������ ��������� ����� ���������� ���� ����� ������� ����� ������ �� �������� ������������� ���������� �������� �������� ���� ���������
������������������������������������������������� ��������
78×
11×
17×
57×
����
������
�������
��������
�������
���������
������
�������
��������
0
2
4
6
8
Maple time
Mathematica time
��������������������
�������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������
������� �������� ���� ��������� �������������� ����� ������ ��������� ��������������� ��������� ����� ��������� ������ ������������ ���������� ����������
����������
Function Evaluation���������������������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������
9
�����
����� ���� �������� ����� ����� ��� ���������� ����� ���� ����� ������ �������� ������ ��� ���������� ���������� ����� ��������� ��� ������������� ����� ����
������������������������������
���������������������������������������������������������������������Sin
Cos
Tan
ArcTan
Sec
Csc Cot
Exp
Sinh
Cosh
Tanh
Erf
Gamma
ArcSinh
sin(cos(x))
erf(sin(x))
ⅇx2
500
1000
5000
104
Maple time
Mathematica time
Map
~
map
19×
21×
BesselJ
BesselK
BesselY
Zeta
0
5
10
15
Maple time
Mathematica time
451×
506×
941×
491×
510×
Sqrt
ArcSin
ArcCos
Log
Log10
ArcCosh
ArcTanh
�+���(�)+�����
+�
�+���(�)
xlog(sinh
(x))
0
100
200
300
400
Map
~
map
������ ������������ ���� ��� ��������� ��� ������ ��� ��������� ����������� ���� ������������ ����� ��� ���� ��������� ����� ������ ��������� ����� ������ ���
����������������������������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������
�����
���������������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������
����
����
278×
263×
295×
����
����
����
����
279×
490×
193×
193×
119×
38×
719×
33×
441×
42×
657×
272×
465×
����
����
33×
����
����
493×
1553
����
����
143×
Sqrt
Sin
Cos
Tan
ArcSin
ArcCos
ArcTan
Sec
Csc Cot
Exp
Sinh
Cosh
Tanh
Log
Log10
Erf
Gamma
0
5
10
15
20
Maple time
Mathematica time
Map
~
map
10
���������
�����������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������Sqrt
Sin
Cos
Tan
ArcSin
ArcCos
ArcTan
Sec
Csc Cot
Exp
Sinh
Cosh
Tanh
Log
Log10
Erf
Gamma
BesselJ
BesselK
BesselY
ArcSinh
ArcCosh
ArcTanh
Zeta
�+���(�)+�����
+�
�+���(�)
sin(cos(x))
xlog(sinh
(x))
erf(sin(x))
ⅇx2
1
10
100
1000
Maple time
Mathematica time
Map
~
map
������������������������������������������������������������������������������������������������������������������������������������������
Sqrt
Sin
Cos
Tan
ArcSin
ArcCos
ArcTan
Sec
Csc Cot
Exp
Sinh
Cosh
Tanh
Log
Log10
Erf
Gamma
BesselJ
BesselK
BesselY
ArcSinh
ArcCosh
ArcTanh
Zeta
�+���(�)+�����
+�
�+���(�)
sin(cos(x))
xlog(sinh
(x))
erf(sin(x))
ⅇx2
1
10
100
1000
Maple time
Mathematica time
Map
~
map
������������������
�����������������������������������������������������������������������������������������������������������������������������������������������
������������������������������
11
Sqrt
Sin
Cos
Tan
ArcSin
ArcCos
ArcTan
Sec
Csc Cot
Exp
Sinh
Cosh
Tanh
Log
Log10
Erf
Gamma
BesselJ
BesselK
BesselY
ArcSinh
ArcCosh
ArcTanh
Zeta
�+���(�)+�����
+�
�+���(�)
sin(cos(x))
xlog(sinh
(x))
erf(sin(x))
ⅇx2
5
10
50
100
Maple time
Mathematica time
Map
~
map
������� ���� ����� ������������ ���� ��� ������ ��������� ����������� ������� ���������� ���� ���������� ������� ������� �������������� ��� ���������� ����
��������������������������������������������������������������������������������������������������������������������������������������������
���������������������������
��������������������
������������������������������������������������������������������������������������������������������������������������������
High-Precision Evaluation����������������������������������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������������������������������������
���� ��� �������� ���� �������� ����� ������ ������������ ������ ������������ ���������� ���� ���������� ������������ ��� ����� ���������� ����� �� ������� ��������
���������������������������������
76×
69×
202×
π 2 sin(1) +1
1+sin1ⅇ log(5) tan(1+ ⅈ) K2(3) Γ
11
3 erf(10)
0
10
20
30
40
Maple time
Mathematica time
��������������������
�������������������������������������������������������������������
�����������������������������������������������������
12
Exact Numeric Functions����� ������������ ������ �������� �������� ���� ������ ��� ����������� ��������� ���� ���������� ����� ��� �π� ��� ��������� ��������� ������������� ��������
���������������������������������������
Function Largest test value Mathematica speed
BernoulliB 6,000 2 times faster
Fibonacci 500,000 3 times faster
HarmonicNumber 10,000 Maple cannot compute for n > 500
Zeta 100,000 13 times faster
Binomial 1014 280 times faster
��������������������
�������������������������������������������������������������������������������������
GPU Performance����������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������
2000 4000 6000size
2
4
6
8
10
12
timeDot
����������� �
����� ��
��������������������
�����������������������������������������������������������
General Testing Methodology����� ����� ���������� ������ �������� �� ������� ����� ����� ���� ���������� ������ ��� ����������� ����� ��� ��� ��� ����� ����� ������ ����� �� ������
����������� ���� ����� ���� ������ ���� ���� ��� ��� ����� ������ ����� ���������� ������ ������ ����� ���� ������������ ����� �������� ���������������
���������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������������������
����� ��������� ������ ���������� ������� �������� ���� ���������� �������������� ������ ����� ����� ���������� ���� ������ ��������� ������������ ������
�������������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������+��������������������������������������������������������������������������������������
���������������
13
�������������������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������
Revision Notes�����������������������������������������������������
•���������������������������������������������������������������������������������������������������������������
�����������������������������������������������������
•���������������������������������������������������������
•��������������������������������������������������������������������������������������
•������������������������������������������
�����������������������������������������������������
•���������������������������������������������������������
•������������������������������
•����������������������������������������������
•���������������������������������������������������������������������������������������������
•���������������������������������
�����������������������������������������������������
•���������������������������������������������������������
•�����������������������������������������������������������
•������������������������������������������
•�������������������������������������������������������������
•���������������������������������������������������������������������������������������������������
•���������������������������������������������
•���������������������������������������������������������������������
•������������������������������������������������
Appendix: Test Source Code
Mathematica code
��������������
$HistoryLength = 0;steps = 10;repeats = 5;maxVector = 10^6;maxMatrix = 2000;maxSparseMatrix = 20000;
14
makeData[type_, i_] := Switchtype,
"RealVector", RandomReal[{-10, 10}, i],"RealMatrix", RandomReal[1, {i, i}],"ExtendedMatrix", RandomReal[1, {i, i}, WorkingPrecision → 50],"ExtendedMatrix1000", RandomReal[1, {i, i}, WorkingPrecision → 1000],"ExtendedVector", RandomReal[1, {i}, WorkingPrecision → 50],"ExtendedVector1000", RandomReal[1, {i}, WorkingPrecision → 1000],"IntegerMatrix", RandomInteger[100, {i, i}],"IntegerVector", RandomInteger[100, i],
"SparseMatrix", SparseArrayTable
{RandomInteger[{1, i}], RandomInteger[{1, i}]} → Random[], i^2 10000, {i, i},
"SparseVector", SparseArrayTableRandomInteger[{1, i}] → Random[],
Floori 10000 , {i},
"MediumSparseMatrix", SparseArrayTable
{RandomInteger[{1, i}], RandomInteger[{1, i}]} → Random[], i^2 200 , {i, i},
"ComplexMatrix", RandomComplex[{0, 1 + I}, {i, i}],"ComplexVector", RandomComplex[{0, 1 + I}, {i}],_, Print[type]
;
timedReport[path_, fn_, hi_, type_] := Block{data},
Export"Mathematica" <> ToString[$VersionNumber] <> path <> ".txt", Table{Floor[t],
Mean[Table[data = makeData[type, Floor[t]];AbsoluteTiming[fn[data]][[1]], {repeats}]]}
, t,hi
steps, hi,
hi
steps, "Table";
highPrecisionReport[path_, fns_, n_] :=Export["Mathematica" <> ToString[$VersionNumber] <> path <> ".txt",Map[AbsoluteTiming[N[#, n]][[1]] &, fns]]
NumericTest[path_, fns_List, n_, type_] :=Block[{data}, Export["Mathematica" <> ToString[$VersionNumber] <> path <> ".txt",
Table[data = makeData[type, n];AbsoluteTiming[i[data]][[1]], {i, fns}]]];
evaluateTest[path_, expr_Hold] :=Export["Mathematica" <> ToString[$VersionNumber] <> path <> ".txt",Apply[List, First /@ Map[AbsoluteTiming, expr]]]
�������������������
fnList = {Sqrt, Sin, Cos, Tan, ArcSin, ArcCos, ArcTan, Sec, Csc, Cot, Exp, Sinh, Cosh,Tanh, Log, Log10, Erf, Gamma, BesselJ[0, #] &, BesselK[1, #] &, BesselY[3, #] &,ArcSinh, ArcCosh, ArcTanh, Zeta, # Sin[Log[#] + 2 * Sqrt[#] + 3] + Sqrt[#] + Log[#] &,Sin[Cos[#]] &, # Log[Sinh[#]] &, Erf[Sin[#]] &, Exp[#^2] &};
15
NumericTest["ElementaryFunctions", fnList, 10 maxVector , "RealVector"];NumericTest["ElementaryFunctionsSM", fnList, maxVector , "RealVector"];NumericTest["ElementaryFunctionsComplex", fnList, maxVector , "ComplexVector"];
NumericTest"ElementaryFunctionsExtended", fnList, maxVector 10, "ExtendedVector";
NumericTest"ElementaryFunctionsExtended1000",
fnList, maxVector 100, "ExtendedVector1000";
NumericTest["ElementaryFunctionsSparse", fnList, 100000 maxVector , "SparseVector"];
����������������������
timedReport["FourierReal", Fourier, maxVector, "RealVector"];timedReport["SortReal", Sort, maxVector, "RealVector"];timedReport["SortCustomReal", SortBy[#, Abs] &, maxVector, "RealVector"];timedReport["MeanReal", Mean, 10 maxVector, "RealVector"];timedReport["DotReal", #.# &, maxMatrix , "RealMatrix"];timedReport["InverseReal", Inverse, maxMatrix, "RealMatrix"];Quiet@
timedReport["LinearSolveReal", LinearSolve[#, #[[1]]] &, maxMatrix, "RealMatrix"];timedReport["CholeskyReal", CholeskyDecomposition[Transpose[#].#] &,
maxMatrix, "RealMatrix"];timedReport["MatrixPowerReal", MatrixPower[#, 5] &, maxMatrix, "RealMatrix"];timedReport["DetReal", Det, maxMatrix, "RealMatrix"];timedReport["TransposeReal", Transpose, maxMatrix, "RealMatrix"];timedReport["FlattenReal", Flatten, maxMatrix, "RealMatrix"];
timedReport"EigenvaluesReal", Eigenvalues, maxMatrix 2, "RealMatrix";
timedReport"EigenvectorsReal", Eigenvectors, maxMatrix 2, "RealMatrix";
timedReport["LinearProgrammingReal",LinearProgramming[Abs[#[[1]]], Abs[#], Abs[#[[2]]], Method → "CLP"] &,maxMatrix, "RealMatrix"];
timedReport["ElementPowerReal", #^5 &, maxMatrix, "RealMatrix"];timedReport["MovingAverageReal", MovingAverage[#, 10] &, maxVector, "RealVector"];
timedReport"FitReal", Function[{data}, Fit[data, x, x]][Transpose[{#, #}]] &;,
4 * maxVector, "RealVector";
timedReport"MatrixExpReal", MatrixExp, maxMatrix 5, "RealMatrix";
timedReport["CovarianceReal", Covariance, maxMatrix, "RealMatrix"];timedReport["MatrixRank", MatrixRank, 3 maxMatrix, "RealMatrix"];
16
�������������������������
timedReport["FourierComplex", Fourier, maxVector, "ComplexVector"];timedReport["SortCustomComplex", SortBy[#, Abs] &, maxVector, "ComplexVector"];timedReport["MeanComplex", Mean, 10 maxVector, "ComplexVector"];timedReport["DotComplex", #.# &, maxMatrix , "ComplexMatrix"];timedReport["InverseComplex", Inverse, maxMatrix, "ComplexMatrix"];timedReport["LinearSolveComplex",
LinearSolve[#, #[[1]]] &, maxMatrix, "ComplexMatrix"];timedReport["CholeskyComplex", CholeskyDecomposition[ConjugateTranspose[#].#] &,
maxMatrix, "ComplexMatrix"];
timedReport"MatrixPowerComplex", MatrixPower[#, 5] &, maxMatrix 2, "ComplexMatrix";
timedReport["DetComplex", Det, maxMatrix, "ComplexMatrix"];
timedReport"EigenvaluesComplex", Eigenvalues, maxMatrix 2, "ComplexMatrix";
timedReport"EigenvectorsComplex", Eigenvectors, maxMatrix 2, "ComplexMatrix";
timedReport["TransposeComplex", Transpose, maxMatrix, "ComplexMatrix"];timedReport["FlattenComplex", Flatten, maxMatrix, "ComplexMatrix"];timedReport["ElementPowerComplex", #^5 &, maxMatrix, "ComplexMatrix"];
timedReport"MatrixExpComplex", MatrixExp, maxMatrix 4, "ComplexMatrix";
timedReport["MatrixRankComplex", MatrixRank, 3 maxMatrix, "ComplexMatrix"]
������������������������
timedReport["DotSparse", #.# &, maxSparseMatrix, "SparseMatrix"];
Quiet@timedReport"LinearSolveSparse",
LinearSolve[#, #[[1]]] &, maxSparseMatrix 3, "MediumSparseMatrix";
timedReport["TransposeSparse", Transpose, 2 * maxSparseMatrix, "SparseMatrix"];timedReport["FlattenSparse", Flatten, maxSparseMatrix, "SparseMatrix"];timedReport["ElementPowerSparse", #^5 &, maxSparseMatrix, "SparseMatrix"];timedReport["MeanSparse", Mean, maxVector * 100, "SparseVector"];
timedReport"MatrixPowerSparse",
MatrixPower[#, 5] &, 2 * maxSparseMatrix 5, "SparseMatrix";
timedReport["MovingAverageSparse", MovingAverage[#, 10] &,10 maxVector, "SparseVector"];
�������������������������
timedReport["DotInteger", #.# &, maxMatrix , "IntegerMatrix"];
timedReport"InverseInteger", Inverse, maxMatrix 25, "IntegerMatrix";
timedReport"LinearSolveInteger",
LinearSolve[#, #[[1]]] &, maxMatrix 4, "IntegerMatrix";
timedReport"MatrixPowerInteger", MatrixPower[#, 5] &, maxMatrix 4, "IntegerMatrix";
timedReport["DetInteger", Det, 600 , "IntegerMatrix"];timedReport["TransposeInteger", Transpose, maxMatrix, "IntegerMatrix"];timedReport["FlattenInteger", Flatten, maxMatrix, "IntegerMatrix"];timedReport["MeanInteger", Mean, maxVector, "IntegerVector"];timedReport["SortInteger", Sort, maxVector, "IntegerVector"];timedReport["SortCustomInteger", SortBy[#, Abs] &, maxVector, "IntegerVector"];
timedReport"EigenvaluesInteger", Eigenvalues, maxMatrix 30, "IntegerMatrix";
timedReport["ElementPowerInteger", #^5 &, maxMatrix, "IntegerMatrix"];timedReport["MatrixExpInteger", MatrixExp, 40, "IntegerMatrix"];timedReport["MatrixRankInteger", MatrixRank, maxMatrix, "IntegerMatrix"];
17
�����������������������������
timedReport"DotExtended", #.# &, maxMatrix 25 , "ExtendedMatrix";
timedReport"InverseExtended", Inverse, maxMatrix 25, "ExtendedMatrix";
timedReport"CholeskyExtended",
CholeskyDecomposition[Transpose[#].#] &, maxMatrix 20, "ExtendedMatrix";
timedReport["EigenvaluesExtended", Eigenvalues, 60, "ExtendedMatrix"];timedReport["EigenvectorsExtended", Eigenvectors, 80, "ExtendedMatrix"];
timedReport"ElementPowerExtended", #^5 &, maxMatrix 2, "ExtendedMatrix";
timedReport"LinearSolveExtended",
LinearSolve[#, #[[1]]] &, maxMatrix 20, "ExtendedMatrix";
timedReport"DetExtended", Det, maxMatrix 10, "ExtendedMatrix";
timedReport["TransposeExtended", Transpose, maxMatrix, "ExtendedMatrix"];timedReport["FlattenExtended", Flatten, maxMatrix, "ExtendedMatrix"];
(*timedReport"FourierExtended",Fourier,maxVector100,"ExtendedVector";
Maple converts to floats*)
timedReport"MeanExtended", Mean, maxVector 10, "ExtendedVector";
timedReport["SortExtended", Sort, 2 * maxVector, "ExtendedVector"];timedReport["SortCustomExtended", SortBy[#, Abs] &, 2 * maxVector, "ExtendedVector"];
timedReport"EigenvectorsExtended", Eigenvectors, maxMatrix 25, "ExtendedMatrix";
timedReport"MatrixPowerExtended",
MatrixPower[#, 5] &, maxMatrix 25, "ExtendedMatrix";
timedReport["MatrixExpExtended", MatrixExp, 100, "ExtendedMatrix"];
timedReport"MatrixRankExtended", MatrixRank, maxMatrix 10, "ExtendedMatrix";
��������������������������������
timedReport"DotExtended1000", #.# &, maxMatrix 20 , "ExtendedMatrix1000";
timedReport"InverseExtended1000", Inverse, maxMatrix 25, "ExtendedMatrix1000";
timedReport["CholeskyExtended1000",CholeskyDecomposition[Transpose[#].#] &, 100, "ExtendedMatrix1000"];
timedReport["EigenvaluesExtended1000", Eigenvalues, 80, "ExtendedMatrix1000"];timedReport["EigenvectorsExtended1000", Eigenvectors, 80, "ExtendedMatrix1000"];
timedReport"ElementPowerExtended1000", #^5 &, maxMatrix 2, "ExtendedMatrix1000";
timedReport"LinearSolveExtended1000",
LinearSolve[#, #[[1]]] &, maxMatrix 25, "ExtendedMatrix1000";
timedReport"DetExtended1000", Det, maxMatrix 10, "ExtendedMatrix1000";
timedReport["TransposeExtended1000", Transpose, maxMatrix, "ExtendedMatrix1000"];timedReport["FlattenExtended1000", Flatten, maxMatrix, "ExtendedMatrix1000"];
timedReport"MeanExtended1000", Mean, maxVector 10, "ExtendedVector1000";
timedReport["SortExtended1000", Sort, maxVector, "ExtendedVector1000"];timedReport["SortCustomExtended1000",
SortBy[#, Abs] &, maxVector, "ExtendedVector1000"];
timedReport"MatrixPowerExtended1000", MatrixPower[#, 5] &,
maxMatrix 25, "ExtendedMatrix1000";
timedReport["MatrixExpExtended1000", MatrixExp, 60, "ExtendedMatrix1000"];
timedReport"MatrixRankExtended1000", MatrixRank, maxMatrix 20, "ExtendedMatrix1000"
18
���������������
evaluateTest["ExactFunctions", Hold[Table[BernoulliB[i], {i, 6000}],Table[Fibonacci[i], {i, 0, 500000, 1000}],(*Table[HarmonicNumber[i],{i,10000}], Maple fails*)Table[Zeta[i], {i, 0, 100000, 10000}],Table[Binomial[i^2, i], {i, 1, 10000}]
]];
��������������
evaluateTest["RandomNumbers", Hold[makeData["RealMatrix", 2000],makeData["RealMatrix", 2000],makeData["IntegerMatrix", 2000],makeData["IntegerMatrix", 2000],makeData["ExtendedMatrix", 2000],makeData["ExtendedMatrix1000", 2000],RandomVariate[NormalDistribution[0, 1], 10^7],RandomVariate[PoissonDistribution[4], 10^7],RandomVariate[BinomialDistribution[10, 0.2], 10^7]
]];
��������������
highPrecisionReport"ManyDigits",
Pi, Sqrt[2], Sin[1] +1
1 + Sin[1], Exp[1], Log[5], Tan[1 + I], 1000000;
highPrecisionReport"FewerDigits", BesselK[2, 3], Gamma11 3, Erf[10], 5000;
Maple
��������������
��������������������
�������������������������
�������������������������
�����������������
�����������������������������������
������������������
�������������������
�������������������
������������������
������������
���������������
����������
�����������
����������������
����������������
�����������������������
�����������������������������������������
����������������������������������������������������������������������
��������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
����������������������������������������������������������������������
����������������������������������
���������������������������������������������������
��������������������������������������������������������������
����������������������������������������������������������������������������
��������������������������������
����������������������������������������������������
�����������������������������������������������������������������
����������������������������������������������������������������
��������������������������������
19
���������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������
����������������������������������������������������������
��������������������������������������������������������������
����������������������������������������������������������
�������������������������������������������������������������������
������������������������������������������������������������
������������������������������������������������������������������
������������������������������������������������������������
��������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
�����������������������
�������������
����������������������������������������������������������������������
�������������
�����������������������������������������������
���������������������������������������������������
���������������������������
�������������������������������������������
���������������������������������������������
��������������������������������������������������������������������������������������������������������
����������
��������������������������������������������
������������������������
�����������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������
��������������������������������������������������������������������������������������������������
���������
������������������������������������������������
����������������������������������������������������������������������������������������������
���������
���������������������������������������������������
������������������������
�����������������������������������
������������������������������������������������
������������������������
������������������������������
�������������������������������������
��������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������
��������������������������������
������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
������������������������
�������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������
�������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������
�����������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������
20
����������������������
��������������������������������������������������������������������
�����������������������������������������������������
�������������������������������������������������������
�������������������������������������������������������������������
�����������������������������������������������������������������
�����������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������
�����������������������������������������������������������
���������������������������������������������������������������
��������������������������������������������������������������������������������������������
�������������������������������������������������������������������������
���������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������
���������������������������
�����������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������
�����������������������������������������������������������������������������
�����������������������������������������������������������������������
����������������������������������������������������������������������������
����������������������������������������������������������������������������
�������������������������������������������������������������
����������������������������������������������������������������
���������������������������������������������������������������������������
�������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������
�������������������������������������������������������������������
�����������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������
�����������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������
���������������������������������
������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������
�������������������������������������������������������������������������������
�������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������
���������������������������
���������������������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������
�������������������������
������������������������������������������������������������������������������
���������������������������������������������������������������
����������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������
���������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������
����������������������������������������������������������
�������������������������������������������������������������������������������������������
���������������������������������������������������������������������
�����������������������������������������������������������������������������������
�������������������������������������������������������������������������������������
�������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������
��������������������������������������������������������������������������������
����������������������������������������������������������������
������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������
�����������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������
�����������������������������������������������������������
���������������������������������������������������������������������������������������������
21
�����������������������������������������������������������������������
�������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������
���������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
�����������������������������������
�������������������������������������������������������������������������������������������������������
������������������������������������
�������������������������
������������������������������������������������������������������������������
����������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������
���������������������������������������������������������������
�������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
���������������������������������������������������������������
������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������
�����������������������������������������������������������������
���������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������
��������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������
���������
���������������������������������������������������������������������������
�������������������������������������������������������������������������
����������
�����������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������
���������������
����������������������������������������
���������������������������������������������������
�������������������������������������������������
������������������������������������������������������
���������������������������������������������
�����
��������������
���������������������������������������
�����������������������������������������������
��������������������������������������������
���������������������������������������������
����������������������������������������������
�����������������������������������������������
���������������������������������������������������
��������������������������������������������������������
������������������������������������������������������
����������������������������������������������������������������������
�����
�������������������
�������������������������������������������������������������������������������
������������������������������������������������������������������������������
��������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������
22
��������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������
�������������������������������������������������������������������
��������������
�������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������
�����������������������������
�����������
����������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������
�������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������
�������������������������������������������������������������������
������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������
����������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������
������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
��������������������������������
�������������
������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������
�����������������������������������������
��������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������
������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������
����������������������������������
��������������������������������������������������������������������������������������������������
23
Recommended