PARI library benchmarks: floating point arithmetic
This page refers to version 2.9.5 of the PARI/GP system
[ bench
source code ], with native kernel and GMP
kernel respectively. PARI and GMP-6.0.0 were linked dynamically to the bench
program. This benchmark was adapted from the
MPFR bench, with a minor change: we precompute log(2) and
π.
The following tables give the cpu time in milliseconds spent by the PARI
kernels for different operations, at different (decimal) digitsizes.
64-bit machine: pari.math.u-bordeaux.fr
Xeon E5540 @ 2.53Ghz, running Linux 3.16.0-5-amd64.
Libraries were compiled with gcc 7.3.0 and native flags.
| 100 digits |
pari-2.9.5-gmp |
pari-2.9.5 |
mpfr-4.0.1 |
| x*y |
0.000099 |
0.000098 |
0.00013 |
| x*x |
0.000081 |
0.000082 |
0.000097 |
| x/y |
0.00028 |
0.00035 |
0.00026 |
| sqrt(x) |
0.00042 |
0.0012 |
0.00042 |
| exp(x) |
0.0092 |
0.0090 |
0.0077 |
| log(x) |
0.013 |
0.019 |
0.010 |
| sin(x) |
0.0083 |
0.0091 |
0.0071 |
| cos(x) |
0.0074 |
0.0072 |
0.0053 |
| arccos(x) |
0.024 |
0.038 |
0.043 |
| arctan(x) |
0.022 |
0.037 |
0.036 |
|
| 1000 digits |
pari-2.9.5-gmp |
pari-2.9.5 |
mpfr-4.0.1 |
| x*y |
0.0035 |
0.0035 |
0.0029 |
| x*x |
0.0033 |
0.0033 |
0.0017 |
| x/y |
0.0058 |
0.0057 |
0.0044 |
| sqrt(x) |
0.0041 |
0.0068 |
0.0030 |
| exp(x) |
0.31 |
0.31 |
0.17 |
| log(x) |
0.18 |
0.25 |
0.13 |
| sin(x) |
0.27 |
0.27 |
0.16 |
| cos(x) |
0.26 |
0.26 |
0.16 |
| arccos(x) |
0.71 |
0.87 |
0.33 |
| arctan(x) |
0.70 |
0.85 |
0.32 |
|
| 10000 digits |
pari-2.9.5-gmp |
pari-2.9.5 |
mpfr-4.0.1 |
| x*y |
0.13 |
0.23 |
0.11 |
| x*x |
0.093 |
0.15 |
0.073 |
| x/y |
0.29 |
0.35 |
0.20 |
| sqrt(x) |
0.18 |
0.30 |
0.13 |
| exp(x) |
13 |
21 |
9.6 |
| log(x) |
8.7 |
14 |
6.2 |
| sin(x) |
24 |
41 |
16 |
| cos(x) |
24 |
40 |
16 |
| arccos(x) |
37 |
58 |
16 |
| arctan(x) |
37 |
58 |
15 |
|
32-bit machine: pari.math.u-bordeaux.fr
Xeon E5540 @ 2.53Ghz, running Linux 3.16.0-5-amd64.
Libraries were compiled with gcc 7.3.0 -m32 and native flags.
| 100 digits |
pari-2.9.5-gmp |
pari-2.9.5 |
mpfr-4.0.1 |
| x*y |
0.00024 |
0.00026 |
0.00026 |
| x*x |
0.00017 |
0.00025 |
0.00020 |
| x/y |
0.00067 |
0.00045 |
0.00067 |
| sqrt(x) |
0.00082 |
0.0015 |
0.00074 |
| exp(x) |
0.016 |
0.016 |
0.013 |
| log(x) |
0.018 |
0.025 |
0.020 |
| sin(x) |
0.014 |
0.016 |
0.012 |
| cos(x) |
0.013 |
0.013 |
0.0085 |
| arccos(x) |
0.046 |
0.056 |
0.080 |
| arctan(x) |
0.041 |
0.049 |
0.067 |
|
| 1000 digits |
pari-2.9.5-gmp |
pari-2.9.5 |
mpfr-4.0.1 |
| x*y |
0.0077 |
0.019 |
0.0067 |
| x*x |
0.0050 |
0.012 |
0.0040 |
| x/y |
0.019 |
0.020 |
0.016 |
| sqrt(x) |
0.014 |
0.020 |
0.010 |
| exp(x) |
0.67 |
1.2 |
0.36 |
| log(x) |
0.56 |
0.89 |
0.46 |
| sin(x) |
0.60 |
1.2 |
0.35 |
| cos(x) |
0.57 |
1.1 |
0.34 |
| arccos(x) |
2.2 |
2.7 |
0.90 |
| arctan(x) |
2.2 |
2.7 |
0.85 |
|
| 10000 digits |
pari-2.9.5-gmp |
pari-2.9.5 |
mpfr-4.0.1 |
| x*y |
0.22 |
0.74 |
0.20 |
| x*x |
0.15 |
0.56 |
0.13 |
| x/y |
0.65 |
1.6 |
0.54 |
| sqrt(x) |
0.48 |
1.2 |
0.39 |
| exp(x) |
30 |
77 |
18 |
| log(x) |
19 |
54 |
15 |
| sin(x) |
42 |
135 |
31 |
| cos(x) |
41 |
133 |
31 |
| arccos(x) |
75 |
219 |
35 |
| arctan(x) |
75 |
218 |
31 |
|
|