Test data
These function times give the average cpu time per call, where many calls were made with
arguments with size ranging from about 1/500 to 500 in a geometric sequence.
See the TOMS 2011 paper for more details.
For functions with restricted domains like asin(x), the values were chosen from the intersection
of the interval ( -500 , 500) and the function's domain.
For some of the special functions, the values were chosen from the interval ( 0 , 100).
The runs were made on a newer (2023) machine than the one that was used for the 2011 paper.
The faster times here, compared to those in the 2011 paper, are due to faster hardware, as well
as some code-tuning speedups made since 2011.
FM was compiled with: gfortran fm.f95 -funroll-loops -c -O3
Precisions in the table range from 50 to 10,000 significant digits.
Times using the gfortran compiler (seconds/call)
| 50 s.d. | 100 s.d. | 1,000 s.d. | 10,000 s.d. | |
| + or - | .000 000 04 | .000 000 05 | .000 000 21 | .000 007 |
| * | .000 000 15 | .000 000 28 | .000 003 | .000 145 |
| / | .000 000 19 | .000 000 33 | .000 003 | .000 210 |
| sqrt(x) | .000 000 28 | .000 000 47 | .000 011 | .000 242 |
| acos(x) | .000 005 | .000 009 | .000 295 | .020 |
| acosh(x) | .000 005 | .000 008 | .000 183 | .012 |
| asin(x) | .000 004 | .000 008 | .000 291 | .019 |
| asinh(x) | .000 004 | .000 007 | .000 180 | .012 |
| atan(x) | .000 003 | .000 007 | .000 272 | .019 |
| atanh(x) | .000 003 | .000 006 | .000 163 | .012 |
| cos(x) | .000 003 | .000 006 | .000 162 | .012 |
| cosh(x) | .000 003 | .000 007 | .000 162 | .012 |
| exp(x) | .000 004 | .000 008 | .000 171 | .013 |
| ln(x) | .000 003 | .000 006 | .000 169 | .011 |
| sin(x) | .000 003 | .000 006 | .000 159 | .013 |
| sinh(x) | .000 003 | .000 007 | .000 165 | .013 |
| tan(x) | .000 004 | .000 008 | .000 197 | .013 |
| tanh(x) | .000 004 | .000 007 | .000 181 | .013 |
| x ** y | .000 008 | .000 015 | .000 359 | .024 |
| beta(x,y) | .000 068 | .000 182 | .009 | 1.9 |
| binomial(x,y) | .000 076 | .000 202 | .009 | 1.9 |
| c(x) | .000 011 | .000 019 | .001 447 | .120 |
| chi(x) | .000 010 | .000 019 | .000 619 | .043 |
| ci(x) | .000 011 | .000 021 | .000 636 | .060 |
| ei(x) | .000 012 | .000 025 | .001 002 | .069 |
| e_1(x) | .000 019 | .000 038 | .001 150 | .072 |
| erf(x) | .000 009 | .000 020 | .001 071 | .075 |
| erfc(x) | .000 016 | .000 033 | .001 645 | .078 |
| gamma(x) | .000 014 | .000 034 | .002 904 | .613 |
| igamma1(x,y) | .000 034 | .000 076 | .002 799 | .576 |
| igamma2(x,y) | .000 053 | .000 133 | .005 670 | 1.210 |
| j_1(x) | .000 007 | .000 013 | .000 457 | .039 |
| li(x) | .000 023 | .000 046 | .001 263 | .090 |
| log_gamma(x) | .000 014 | .000 029 | .002 519 | .594 |
| psi(x) | .000 010 | .000 024 | .003 124 | .721 |
| s(x) | .000 011 | .000 019 | .001 460 | .120 |
| shi(x) | .000 006 | .000 011 | .000 429 | .035 |
| si(x) | .000 007 | .000 014 | .000 458 | .039 |
| y_1(x) | .000 065 | .000 129 | .004 201 | .679 |
Comments
The functions in this list that need Bernoulli numbers are beta, binomial, gamma, both
incomplete gammas, log_gamma, and psi. They use Bernoulli numbers only when precision
exceeds 110 to 150 significant digits. Then the first call to one of these functions is
usually much slower than subsequent calls. The Bernoulli numbers are very slow to compute
and many of them may be needed at high precision. The value of each one is saved at the
highest precision previously used, so often a later call to one of these functions will be
able to use the saved values instead of having to re-compute them. These functions have
times over 0.5 sec/call in the last column of the table, showing that even when the
Bernoulli numbers are available these functions are slower than the other special functions.