Comparison of other software to MPFR

NOTE: this page was adapted from http://www.medicis.polytechnique.fr/~pphd/mpfr/timings-220.html (as of Fri Sep 30 2005, now a dead link, modern version), maintained by the MPFR authors. We added two columns for the current stable version 2.3.0 of PARI, made on the same machines (the MPFR maintainers restricted their tests to stable version available at the time: 2.1.5), with native kernel and GMP kernel respectively. PARI and GMP-4-1-4 were linked statically to the bench program.

Raw bench results [ix86 | x86_64]. Bench source code.

Maple MuPAD Mathematica Magma GMP MPF MPFR Pari NTL CLN ArPrec MAPM Pari Pari
commercial commercial commercial commercial free (LGPL) free (LGPL) free (GPL) free (GPL) free (GPL) non-commercial freeware free (GPL) free (GPL)
9.01 2.5.3 5.0.0 2.11-2 4.1.4 2.2.0 2.1.5 5.3.1 1.1.9 2004-11-23 4.9 2.3.0 2.3.0-gmp
interactive interactive interactive interactive library library library library library library library library library

The following tables give the cpu time in milliseconds spent by several systems or libraries for different operations, at different precisions. The precision is only one digit.

Only MPFR provides directed rounding.

CLN has been built with GMP support. MPFR has been built with --with-gmp-build option. NTL and PARI have been built with native support.

na: Not-available (Function missing or enable to provide a reliable bench).

na*: Not-available due to segfault.

32-bit machine: laurent5.medicis.polytechnique.fr.

These timings were obtained on a bi-athlon MP 2200+ 1800Mhz 2 Gb running Linux. libraries were compiled with gcc 3.2 20020903 with their native flags, except GMP and MPFR which were built with GCC 3.3.5

100 digits Maple MuPAD Mathematica Magma MPF MPFR Pari NTL CLN ArPrec MAPM Pari-2.3.0 Pari-2.3.0-gmp
mult 0.031 0.0029 0.0019 0.00134 0.00047 0.00048 0.00059 0.0025 0.00072 0.0090 0.0098 0.00066 0.00057
div 0.035 0.0035 0.009 0.0022 0.0012 0.0010 0.0015 0.0036 0.0013 0.012 0.11 0.0014 0.0011
sqrt 0.16 0.010 0.0098 0.0099 0.0015 0.0014 0.0065 0.0241 0.0016 0.050 0.16 0.0031 0.0015
exp 0.34 0.1 0.055 0.08 na 0.017 0.034 0.28 0.055 0.57 2.58 0.034 0.032
log 0.46 0.20 0.075 0.12 na 0.031 0.075 1.4 0.069 1.5 3.2 0.049 0.037
sin 0.61 0.11 0.074 0.08 na 0.022 0.042 0.30 0.060 0.49 1.28 0.034 0.031
cos 0.64 0.1 0.073 0.069 na 0.017 0.034 0.32 0.053 0.48 1.4 0.030 0.029
acos na 0.32 0.16 0.27 na 0.32 0.18 na 0.078 1.3 6.3 0.12 0.085
atan 1.5 0.26 0.15 0.24 na 0.28 0.15 na 0.068 1.3 6.6 0.10 0.077

1000 digits Maple MuPAD Mathematica Magma MPF MPFR Pari NTL CLN ArPrec MAPM Pari-2.3.0 Pari-2.3.0-gmp
mult 0.14 0.076 0.025 0.061 0.017 0.013 0.031 0.077 0.021 0.46 0.084 0.034 0.017
div 0.13 0.084 0.075 0.059 0.030 0.028 0.046 0.13 0.032 0.64 2.54 0.043 0.030
sqrt 1.2 0.22 0.04 0.16 0.021 0.020 0.13 1.4 0.027 1.6 3.1 0.051 0.021
exp 10 5.5 2.6 4.5 na 0.75 2.4 32 1.9 130 110 2.5 1.4
log 2.9 7.7 1.8 6.0 na 0.74 4.3 260 1.6 52 67 1.8 0.92
sin 19 6.6 1.7 5.3 na 0.80 3.0 35 1.4 na* 61 2.6 1.5
cos 20 6.6 1.7 5.1 na 0.76 2.8 32 1.3 na* 65 2.5 1.4
acos na 18 2.7 13 na 7.9 10 na 2.1 na* 200 6.4 3.7
atan 19 17 2.6 13 na 6.9 9.6 na 2.0 na* 210 6.3 3.6

10000 digits Maple MuPAD Mathematica Magma MPF MPFR Pari NTL CLN ArPrec MAPM Pari-2.3.0 Pari-2.3.0-gmp
mult 4.7 7.0 0.8 5.3 0.56 0.48 2.9 3.8 0.81 8.8 1.6 2.3 0.57
div 4.3 6.7 2.5 4.7 1.2 1.2 3.8 12 2.4 61 67 3.6 1.2
sqrt 30 22 1.2 16 0.81 0.81 13 170 1.6 45 91 3.2 0.82
exp 860 1400 56 1200 na 54 623 9100 72 4200 12000 204 59
log 490 2200 51 1600 na 34 1200 94000 80 1900 6000 149 40
sin na* 1800 150 1500 na 78 810 9800 130 37000 8400 493 133
cos na* 1800 150 1400 na 77 770 44000 120 37000 7200 493 132
acos na 4900 230 3600 na 720 2700 na 150 6000 16000 583 153
atan na* 4900 220 3600 na 610 2700 na 150 6100 17000 580 151

64-bit machine : marie.medicis.polytechnique.fr

The following timings were obtained on a Bi-Opteron 246 (2GHz) with 1Mo of cache and 8Gb of RAM under Linux 2.6.8-1.521smp. GCC is 3.3.3 (GCC 3.3.5 for GMP and MPFR)

100 digits Maple Mathematica Magma MPF MPFR Pari NTL CLN ArPrec MAPM Pari-2.3.0 Pari-2.3.0-gmp
mult 0.022 0.0015 0.0013 0.00025 0.00024 0.00029 0.00064 0.00034 0.0075 0.0063 0.00014 0.00013
div 0.026 0.0059 0.0021 0.00071 0.00052 0.0012 0.0011 0.00083 0.0091 0.081 0.00058 0.00052
sqrt 0.11 0.0062 0.0089 0.0010 0.00089 0.0049 0.0079 0.0010 0.032 0.11 0.0016 0.00084
exp 0.25 0.041 0.08 na 0.012 0.028 0.11 0.029 0.42 1.90 0.016 0.019
log 0.31 0.055 0.11 na 0.016 0.066 0.62 0.040 1.1 2.4 0.026 0.021
sin 0.46 0.050 0.07 na 0.014 0.034 0.12 0.038 0.36 0.96 0.014 0.017
cos 0.46 0.049 0.07 na 0.011 0.028 0.12 0.034 0.36 1.0 0.012 0.016
acos na 0.10 0.26 na 0.18 0.19 na 0.048 0.87 4.8 0.055 0.046
atan 1.1 0.093 0.21 na 0.16 0.13 na 0.043 0.93 5.0 0.053 0.046

1000 digits Maple Mathematica Magma MPF MPFR Pari NTL CLN ArPrec MAPM Pari-2.3.0 Pari-2.3.0-gmp
mult 0.10 0.017 0.06 0.0093 0.0062 0.015 0.021 0.010 0.31 0.060 0.0056 0.0094
div 0.093 0.050 0.049 0.018 0.016 0.023 0.034 0.017 0.55 1.8 0.012 0.016
sqrt 0.85 0.029 0.15 0.011 0.010 0.067 0.34 0.012 1.2 2.2 0.014 0.011
exp 8.53 1.9 4.5 na 0.42 1.3 9.1 0.79 110 82 0.52 0.82
log 1.93 1.4 5.3 na 0.37 2.3 74 0.82 37 48 0.43 0.46
sin 15.1 1.2 5.1 na 0.39 1.5 10 0.65 230 44 0.48 0.77
cos 15.2 1.2 5.1 na 0.37 1.4 11 0.60 230 47 0.46 0.75
acos na 2.0 13 na 4.5 5.20 na 1.1 110 144 1.5 1.7
atan 14 1.9 12 na 3.9 4.8 na 0.97 110 150 1.5 1.7

10000 digits Maple Mathematica Magma MPF MPFR Pari NTL CLN ArPrec MAPM Pari-2.3.0 Pari-2.3.0-gmp
mult 3.4 0.58 5.5 0.37 0.30 1.4 0.84 0.43 3.9 1.2 0.41 0.37
div 3.0 1.8 4.5 0.75 0.73 1.5 2.8 1.3 26 45 0.80 0.73
sqrt 21 0.82 15 0.47 0.46 4.9 36 0.79 21 59 0.60 0.46
exp 710 40 1200 na 35 300 2500 36 2200 7900 38 34
log 401 36 1600 na 20 480 26000 42 830 4300 28 23
sin na* 110 1500 na 49 400 2700 61 17000 5700 91 84
cos na* 110 1500 na 49 370 12000 58 17000 5000 89 83
acos na 170 3600 na 460 1100 na 81 2700 11000 112 92
atan na* 160 3500 na 390 1100 na 78 2800 12000 111 91

The source file of these tests is available for Maple, MuPAD, MPF, MPFR, Mathematica, Pari, MAPM, ArPrec, NTL, CLN, and Magma.

Thanks to the Medicis center for providing a machine with all those systems installed on it.