Comparison of multiple-precision floating-point software

Sage GMP MPF MPFR PARI NTL CLN ARB MPFI
free (GPL) free (LGPL) free (LGPL) free (GPL) free (GPL) free (GPL) free (GPL) free (LGPL)
8.1 6.1.2 4.0.1 2.9.4 11.0.0 1.3.4 2.13.0 1.5.3
interactive 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 (in digits). Those timings were obtained on a 8-core AMD Ryzen 5 2400G at 1.5Ghz (gcc67.fsffrance.org) with 32GB of RAM under Debian GNU/Linux 9.4 (stretch). The version of GCC is 6.3.0 (Debian 6.3.0-18+deb9u1).

Sage 8.1 is using MPFR 3.1.5. GMP was configured with --disable-shared. MPFR was configured with --with-gmp-build and after make tune; ARB was configured with FLINT 2.5.2 and that version of MPFR. PARI was built with GMP support (we used the PARI library at C level, and not the interactive GP program). NTL was built with native support and GMP as primary long integer package. CLN has been built with GMP support.

An entry "na" means a function not available in the corresponding software tool. The boldface entries are the fastest in each row.

100 digits Sage MPF MPFR Pari NTL CLN ARB MPFI
mult 0.000351 0.000043 0.000046 0.000043 0.000097 0.000076 0.000066 0.000137
sqr 0.000320 0.000032 0.000033 0.000036 0.000092 0.000067 0.000058 0.000076
div 0.000390 0.000119 0.000120 0.000150 0.000213 0.000201 0.000134 0.000304
sqrt 0.000626 0.000172 0.000174 0.000191 0.000405 0.000262 0.000202 0.000379
exp 0.00423 na 0.00234 0.00440 0.0256 0.00845 0.000756 0.00495
log 0.00651 na 0.00433 0.00638 0.143 0.0111 0.000587 0.00996
sin 0.00401 na 0.00252 0.00388 0.0270 0.0104 0.000727 0.00833
cos 0.00324 na 0.00198 0.00347 0.0287 0.00910 0.000728 0.00694
acos 0.0234 na 0.0160 0.0114 na 0.0138 0.00153 0.0397
atan 0.0197 na 0.0136 0.0108 na 0.0123 0.000674 0.0330
1000 digits Sage MPF MPFR Pari NTL CLN ARB MPFI
mult 0.00302 0.00150 0.00117 0.00173 0.00155 0.00167 0.00119 0.00289
sqr 0.00154 0.00086 0.00068 0.00170 0.00100 0.00098 0.00073 0.00152
div 0.00360 0.00151 0.00203 0.00237 0.00263 0.00316 0.00149 0.00475
sqrt 0.00314 0.00125 0.00124 0.00172 0.00256 0.00216 0.00127 0.00288
exp 0.152 na 0.0695 0.147 0.875 0.146 0.0416 0.156
log 0.128 na 0.0537 0.0815 7.05 0.178 0.0434 0.123
sin 0.143 na 0.0650 0.127 0.952 0.139 0.0476 0.165
cos 0.136 na 0.0618 0.123 0.993 0.129 0.0476 0.159
acos 0.243 na 0.141 0.317 na 0.219 0.0569 0.329
atan 0.231 na 0.134 0.312 na 0.203 0.0482 0.318
10000 digits Sage MPF MPFR Pari NTL CLN ARB MPFI
mult 0.121 0.0450 0.0403 0.0443 0.0438 0.0447 0.0403 0.0937
sqr 0.0620 0.0327 0.0253 0.0331 0.0331 0.0333 0.0255 0.0531
div 0.197 0.0795 0.0802 0.102 0.103 0.204 0.0781 0.186
sqrt 0.170 0.0485 0.0484 0.0669 0.0829 0.122 0.0486 0.105
exp 8.60 na 3.60 4.84 136 6.05 2.24 7.98
log 8.29 na 2.35 3.20 1456 7.63 2.34 5.13
sin 19.0 na 6.19 8.99 149 7.72 2.56 14.1
cos 19.1 na 6.20 8.87 352 7.31 2.48 14.5
acos 15.4 na 6.35 13.5 na 12.4 3.85 14.0
atan 13.7 na 5.77 13.4 na 11.7 3.59 12.0

The source file of these tests is available for Sage, MPF, MPFR, Pari, NTL, CLN, ARB, MPFI.

Back to the MPFR 4.0.1 page.