Comparison of multiple-precision floating-point software

MPIR MPF Sage GMP MPF MPFR PARI NTL CLN ARB MPFI
free (LGPL) free (GPL) free (LGPL) free (LGPL) free (GPL) free (GPL) free (GPL) free (LGPL) free (LGPL)
3.0.0 8.1 6.1.2 4.0.1 2.9.4 11.0.0 1.3.4 2.13.0 1.5.3
library 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. MPIR was configured with --enable-gmpcompat, and the default gmp-mparam.h file was replaced by the values obtained by make tune.

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

100 digits MPIR Sage MPF MPFR Pari NTL CLN ARB MPFI
mult 0.000073 0.000351 0.000043 0.000046 0.000043 0.000097 0.000076 0.000066 0.000137
sqr 0.000031 0.000320 0.000032 0.000033 0.000036 0.000092 0.000067 0.000058 0.000076
div 0.000139 0.000390 0.000119 0.000122 0.000150 0.000213 0.000201 0.000134 0.000304
sqrt 0.000236 0.000626 0.000172 0.000175 0.000191 0.000405 0.000262 0.000202 0.000379
exp na 0.00423 na 0.00231 0.00440 0.0256 0.00845 0.000756 0.00495
log na 0.00651 na 0.00414 0.00638 0.143 0.0111 0.000587 0.00996
sin na 0.00401 na 0.00267 0.00388 0.0270 0.0104 0.000727 0.00833
cos na 0.00324 na 0.00190 0.00347 0.0287 0.00910 0.000728 0.00694
acos na 0.0234 na 0.0155 0.0114 na 0.0138 0.00153 0.0397
atan na 0.0197 na 0.0132 0.0108 na 0.0123 0.000674 0.0330
1000 digits MPIR Sage MPF MPFR Pari NTL CLN ARB MPFI
mult 0.00314 0.00302 0.00150 0.00107 0.00173 0.00155 0.00167 0.00119 0.00289
sqr 0.00100 0.00154 0.00086 0.00065 0.00170 0.00100 0.00098 0.00073 0.00152
div 0.00428 0.00360 0.00151 0.00199 0.00237 0.00263 0.00316 0.00149 0.00475
sqrt 0.00258 0.00314 0.00125 0.00122 0.00172 0.00256 0.00216 0.00127 0.00288
exp na 0.152 na 0.0692 0.147 0.875 0.146 0.0416 0.156
log na 0.128 na 0.0511 0.0815 7.05 0.178 0.0434 0.123
sin na 0.143 na 0.0635 0.127 0.952 0.139 0.0476 0.165
cos na 0.136 na 0.0608 0.123 0.993 0.129 0.0476 0.159
acos na 0.243 na 0.138 0.317 na 0.219 0.0569 0.329
atan na 0.231 na 0.132 0.312 na 0.203 0.0482 0.318
10000 digits MPIR Sage MPF MPFR Pari NTL CLN ARB MPFI
mult 0.140 0.121 0.0450 0.0381 0.0443 0.0438 0.0447 0.0403 0.0937
sqr 0.0523 0.0620 0.0327 0.0244 0.0331 0.0331 0.0333 0.0255 0.0531
div 0.276 0.197 0.0795 0.0803 0.102 0.103 0.204 0.0781 0.186
sqrt 0.143 0.170 0.0485 0.0485 0.0669 0.0829 0.122 0.0486 0.105
exp na 8.60 na 3.55 4.84 136 6.05 2.24 7.98
log na 8.29 na 2.31 3.20 1456 7.63 2.34 5.13
sin na 19.0 na 6.17 8.99 149 7.72 2.56 14.1
cos na 19.1 na 6.18 8.87 352 7.31 2.48 14.5
acos na 15.4 na 6.35 13.5 na 12.4 3.85 14.0
atan na 13.7 na 5.77 13.4 na 11.7 3.59 12.0

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

The Pari/GP developers have a similar benchmark (maybe with different versions of the software tools).

Back to the MPFR 4.0.1 page.