2022-10-15 12:44:02 +00:00
==============
Math Functions
==============
2022-06-15 19:57:46 -04:00
2022-10-15 12:44:02 +00:00
.. include :: check.rst
2022-06-15 19:57:46 -04:00
2022-10-18 03:12:33 +00:00
.. raw :: html
<style> .green {color:green} </style>
.. role :: green
2022-06-15 19:57:46 -04:00
.. contents :: Table of Contents
:depth: 4
:local:
2022-10-15 12:44:02 +00:00
Source Locations
================
2022-06-15 19:57:46 -04:00
2022-10-15 12:44:02 +00:00
- The main source is located at: `libc/src/math <https://github.com/llvm/llvm-project/tree/main/libc/src/math> `_ .
- The tests are located at: `libc/test/src/math <https://github.com/llvm/llvm-project/tree/main/libc/test/src/math> `_ .
- The floating point utilities are located at: `libc/src/__support/FPUtil <https://github.com/llvm/llvm-project/tree/main/libc/src/__support/FPUtil> `_ .
2022-06-15 19:57:46 -04:00
Implementation Requirements / Goals
===================================
* The highest priority is to be as accurate as possible, according to the C and
IEEE 754 standards. By default, we will aim to be correctly rounded for `all rounding modes <https://en.cppreference.com/w/c/numeric/fenv/FE_round> `_ .
The current rounding mode of the floating point environment is used to perform
computations and produce the final results.
- To test for correctness, we compare the outputs with other correctly rounded
2022-06-17 09:32:06 -04:00
multiple-precision math libraries such as the `GNU MPFR library <https://www.mpfr.org/> `_
2022-06-15 19:57:46 -04:00
or the `CORE-MATH library <https://core-math.gitlabpages.inria.fr/> `_ .
* Our next requirement is that the outputs are consistent across all platforms.
Notice that the consistency requirement will be satisfied automatically if the
implementation is correctly rounded.
* Our last requirement for the implementations is to have good and predicable
performance:
- The average performance should be comparable to other `` libc ``
implementations.
- The worst case performance should be within 10X-20X of the average.
- Platform-specific implementations or instructions could be added whenever it
makes sense and provides significant performance boost.
* For other use cases that have strict requirements on the code size, memory
footprint, or latency, such as embedded systems, we will aim to be as accurate
as possible within the memory or latency budgets, and consistent across all
platforms.
Add a new math function to LLVM libc
====================================
* To add a new math function, follow the steps at: `libc/src/math/docs/add_math_function.md <https://github.com/llvm/llvm-project/tree/main/libc/src/math/docs/add_math_function.md> `_ .
Implementation Status
=====================
Basic Operations
----------------
============== ================ =============== ======================
<Func> <Func_f> (float) <Func> (double) <Func_l> (long double)
============== ================ =============== ======================
2022-10-18 03:12:33 +00:00
ceil :green: `XA` :green: `XA` :green: `XA`
copysign :green: `XA` :green: `XA` :green: `XA`
fabs :green: `XA` :green: `XA` :green: `XA`
fdim :green: `XA` :green: `XA` :green: `XA`
floor :green: `XA` :green: `XA` :green: `XA`
fmax :green: `XA` :green: `XA` :green: `XA`
fmin :green: `XA` :green: `XA` :green: `XA`
fmod :green: `XA` :green: `XA`
2022-06-15 19:57:46 -04:00
fpclassify
2022-10-18 03:12:33 +00:00
frexp :green: `XA` :green: `XA` :green: `XA`
ilogb :green: `XA` :green: `XA` :green: `XA`
2022-06-15 19:57:46 -04:00
isfinite
isgreater
isgreaterequal
isinf
isless
islessequal
islessgreater
isnan
isnormal
isubordered
2022-10-18 03:12:33 +00:00
ldexp :green: `XA` :green: `XA` :green: `XA`
llrint :green: `XA` :green: `XA` :green: `XA`
llround :green: `XA` :green: `XA` :green: `XA`
logb :green: `XA` :green: `XA` :green: `XA`
lrint :green: `XA` :green: `XA` :green: `XA`
lround :green: `XA` :green: `XA` :green: `XA`
modf :green: `XA` :green: `XA` :green: `XA`
2022-06-15 19:57:46 -04:00
nan
2022-10-18 03:12:33 +00:00
nearbyint :green: `XA` :green: `XA` :green: `XA`
nextafter :green: `XA` :green: `XA` :green: `XA`
2022-06-15 19:57:46 -04:00
nexttoward
2022-10-18 03:12:33 +00:00
remainder :green: `XA` :green: `XA` :green: `XA`
remquo :green: `XA` :green: `XA` :green: `XA`
rint :green: `XA` :green: `XA` :green: `XA`
round :green: `XA` :green: `XA` :green: `XA`
2022-06-15 19:57:46 -04:00
scalbn
signbit
2022-10-18 03:12:33 +00:00
trunc :green: `XA` :green: `XA` :green: `XA`
2022-06-15 19:57:46 -04:00
============== ================ =============== ======================
Higher Math Functions
---------------------
============== ================ =============== ======================
<Func> <Func_f> (float) <Func> (double) <Func_l> (long double)
============== ================ =============== ======================
2022-10-18 03:12:33 +00:00
acos :green: `XA`
2022-06-15 19:57:46 -04:00
acosh
2022-10-18 03:12:33 +00:00
asin :green: `XA`
2022-06-15 19:57:46 -04:00
asinh
2022-10-18 03:12:33 +00:00
atan :green: `XA`
2022-06-15 19:57:46 -04:00
atan2
2022-10-18 03:12:33 +00:00
atanh :green: `XA`
2022-06-15 19:57:46 -04:00
cbrt
2022-10-18 03:12:33 +00:00
cos :green: `XA` :green: `XA`
cosh :green: `XA`
2022-06-15 19:57:46 -04:00
erf
erfc
2022-10-18 03:12:33 +00:00
exp :green: `XA`
exp10 :green: `XA`
exp2 :green: `XA`
expm1 :green: `XA`
fma :green: `XA` :green: `XA`
hypot :green: `XA` :green: `XA`
2022-06-15 19:57:46 -04:00
lgamma
2022-10-18 03:12:33 +00:00
log :green: `XA`
log10 :green: `XA`
log1p :green: `XA`
log2 :green: `XA`
2022-06-15 19:57:46 -04:00
pow
2022-10-18 03:12:33 +00:00
sin :green: `XA` :green: `XA`
sincos :green: `XA` :green: `XA`
sinh :green: `XA`
sqrt :green: `XA` :green: `XA` :green: `XA`
tan :green: `XA`
tanh :green: `XA`
2022-06-15 19:57:46 -04:00
tgamma
============== ================ =============== ======================
Accuracy of Higher Math Functions
=================================
============== ================ =============== ======================
<Func> <Func_f> (float) <Func> (double) <Func_l> (long double)
============== ================ =============== ======================
2022-10-18 03:12:33 +00:00
acos :green: `XA`
asin :green: `XA`
atan :green: `XA`
atanh :green: `XA`
cos :green: `XA` large
cosh :green: `XA`
exp :green: `XA`
exp10 :green: `XA`
exp2 :green: `XA`
expm1 :green: `XA`
fma :green: `XA` :green: `XA`
hypot :green: `XA` :green: `XA`
log :green: `XA`
log10 :green: `XA`
log1p :green: `XA`
log2 :green: `XA`
sin :green: `XA` large
sincos :green: `XA` large
sinh :green: `XA`
sqrt :green: `XA` :green: `XA` :green: `XA`
tan :green: `XA`
tanh :green: `XA`
2022-06-15 19:57:46 -04:00
============== ================ =============== ======================
Legends:
2022-10-18 03:12:33 +00:00
* `X` = x86_64, `A` = aarch64, `a` = arm32
* Green text (eg. :green: `XA` ): correctly rounded for all 4 rounding modes.
2022-06-15 19:57:46 -04:00
* CR: correctly rounded for the default rounding mode (round-to-the-nearest,
tie-to-even).
* x ULPs: largest errors recorded.
..
TODO(lntue): Add a new page to discuss about the algorithms used in the
implementations and include the link here.
Performance
===========
* Simple performance testings are located at: `libc/test/src/math/differential_testing <https://github.com/llvm/llvm-project/tree/main/libc/test/src/math/differential_testing> `_ .
* We also use the *perf* tool from the `CORE-MATH <https://core-math.gitlabpages.inria.fr/> `_
project: `link <https://gitlab.inria.fr/core-math/core-math/-/tree/master> `_ .
2022-06-17 09:32:06 -04:00
The performance results from the CORE-MATH's perf tool are reported in the
2022-06-15 19:57:46 -04:00
table below, using the system library as reference (such as the `GNU C library <https://www.gnu.org/software/libc/> `_
2022-06-27 19:30:31 +02:00
on Linux). Fmod performance results obtained with "differential_testing".
2022-06-15 19:57:46 -04:00
+--------------+-------------------------------+-------------------------------+-------------------------------------+---------------------------------------------------------------------+
| <Func> | Reciprocal throughput (ns) | Latency (ns) | Testing ranges | Testing configuration |
| +-----------+-------------------+-----------+-------------------+ +------------+-------------------------+--------------+---------------+
| | LLVM libc | Reference (glibc) | LLVM libc | Reference (glibc) | | CPU | OS | Compiler | Special flags |
+==============+===========+===================+===========+===================+=====================================+============+=========================+==============+===============+
2022-09-08 22:30:37 -04:00
| acosf | 24 | 29 | 62 | 77 | :math: `[-1, 1]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
[libc][math] Implement asinf function correctly rounded for all rounding modes.
Implement asinf function correctly rounded for all rounding modes.
For `|x| <= 0.5`, we approximate `asin(x)` by
```
asin(x) = x * P(x^2)
```
where `P(X^2) = Q(X)` is a degree-20 minimax even polynomial approximating
`asin(x)/x` on `[0, 0.5]` generated by Sollya with:
```
> Q = fpminimax(asin(x)/x, [|0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20|],
[|1, D...|], [0, 0.5]);
```
When `|x| > 0.5`, we perform range reduction as follow:
Assume further that `0.5 < x <= 1`, and let:
```
y = asin(x)
```
We will use the double angle formula:
```
cos(2X) = 1 - 2 sin^2(X)
```
and the complement angle identity:
```
x = sin(y) = cos(pi/2 - y)
= 1 - 2 sin^2 (pi/4 - y/2)
```
So:
```
sin(pi/4 - y/2) = sqrt( (1 - x)/2 )
```
And hence:
```
pi/4 - y/2 = asin( sqrt( (1 - x)/2 ) )
```
Equivalently:
```
asin(x) = y = pi/2 - 2 * asin( sqrt( (1 - x)/2 ) )
```
Let `u = (1 - x)/2`, then
```
asin(x) = pi/2 - 2 * asin(u)
```
Moreover, since `0.5 < x <= 1`,
```
0 <= u < 1/4, and 0 <= sqrt(u) < 0.5.
```
And hence we can reuse the same polynomial approximation of `asin(x)` when
`|x| <= 0.5`:
```
asin(x) = pi/2 - 2 * u * P(u^2).
```
Performance benchmark using `perf` tool from the CORE-MATH project on Ryzen 1700:
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh asinf
CORE-MATH reciprocal throughput : 23.418
System LIBC reciprocal throughput : 27.310
LIBC reciprocal throughput : 22.741
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh asinf --latency
GNU libc version: 2.35
GNU libc release: stable
CORE-MATH latency : 58.884
System LIBC latency : 62.055
LIBC latency : 62.037
```
Reviewed By: orex, zimmermann6
Differential Revision: https://reviews.llvm.org/D133400
2022-09-07 02:20:45 -04:00
| asinf | 23 | 27 | 62 | 62 | :math: `[-1, 1]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-08-31 01:26:01 -04:00
| atanf | 27 | 29 | 79 | 68 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
| atanhf | 20 | 66 | 71 | 133 | :math: `[-1, 1]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-08-11 02:14:13 -04:00
| cosf | 13 | 32 | 53 | 59 | :math: `[0, 2\pi]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
2022-07-31 16:32:21 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-09-15 20:48:50 -04:00
| coshf | 14 | 20 | 50 | 48 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
2022-06-15 19:57:46 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-07-25 12:24:31 -04:00
| expf | 9 | 7 | 44 | 38 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
2022-06-15 19:57:46 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-09-17 01:59:54 -04:00
| exp10f | 10 | 8 | 40 | 38 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-09-15 20:48:50 -04:00
| exp2f | 9 | 6 | 35 | 31 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
2022-06-15 19:57:46 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-07-25 13:44:46 -04:00
| expm1f | 9 | 44 | 42 | 121 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
2022-06-15 19:57:46 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
[libc] Implement sinf function that is correctly rounded to all rounding modes.
Implement sinf function that is correctly rounded to all rounding modes.
- We use a simple range reduction for `pi/16 < |x|` :
Let `k = round(x / pi)` and `y = (x/pi) - k`.
So `k` is an integer and `-0.5 <= y <= 0.5`.
Then
```
sin(x) = sin(y*pi + k*pi)
= (-1)^(k & 1) * sin(y*pi)
~ (-1)^(k & 1) * y * P(y^2)
```
where `y*P(y^2)` is a degree-15 minimax polynomial generated by Sollya with:
```
> P = fpminimax(sin(x*pi)/x, [|0, 2, 4, 6, 8, 10, 12, 14|], [|D...|], [0, 0.5]);
```
- Performance benchmark using perf tool from CORE-MATH project
(https://gitlab.inria.fr/core-math/core-math/-/tree/master) on Ryzen 1700:
Before this patch (not correctly rounded):
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh sinf
CORE-MATH reciprocal throughput : 17.892
System LIBC reciprocal throughput : 25.559
LIBC reciprocal throughput : 29.381
```
After this patch (correctly rounded):
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh sinf
CORE-MATH reciprocal throughput : 17.896
System LIBC reciprocal throughput : 25.740
LIBC reciprocal throughput : 27.872
LIBC reciprocal throughput : 20.012 (with `-msse4.2` flag)
LIBC reciprocal throughput : 14.244 (with `-mfma` flag)
```
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D123154
2022-04-05 16:17:18 -04:00
| fmodf | 73 | 263 | - | - | [MIN_NORMAL, MAX_NORMAL] | i5 mobile | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | |
| +-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
| | 9 | 11 | - | - | [0, MAX_SUBNORMAL] | i5 mobile | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | |
2022-06-27 19:30:31 +02:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
[libc] Implement sinf function that is correctly rounded to all rounding modes.
Implement sinf function that is correctly rounded to all rounding modes.
- We use a simple range reduction for `pi/16 < |x|` :
Let `k = round(x / pi)` and `y = (x/pi) - k`.
So `k` is an integer and `-0.5 <= y <= 0.5`.
Then
```
sin(x) = sin(y*pi + k*pi)
= (-1)^(k & 1) * sin(y*pi)
~ (-1)^(k & 1) * y * P(y^2)
```
where `y*P(y^2)` is a degree-15 minimax polynomial generated by Sollya with:
```
> P = fpminimax(sin(x*pi)/x, [|0, 2, 4, 6, 8, 10, 12, 14|], [|D...|], [0, 0.5]);
```
- Performance benchmark using perf tool from CORE-MATH project
(https://gitlab.inria.fr/core-math/core-math/-/tree/master) on Ryzen 1700:
Before this patch (not correctly rounded):
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh sinf
CORE-MATH reciprocal throughput : 17.892
System LIBC reciprocal throughput : 25.559
LIBC reciprocal throughput : 29.381
```
After this patch (correctly rounded):
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh sinf
CORE-MATH reciprocal throughput : 17.896
System LIBC reciprocal throughput : 25.740
LIBC reciprocal throughput : 27.872
LIBC reciprocal throughput : 20.012 (with `-msse4.2` flag)
LIBC reciprocal throughput : 14.244 (with `-mfma` flag)
```
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D123154
2022-04-05 16:17:18 -04:00
| fmod | 595 | 3297 | - | - | [MIN_NORMAL, MAX_NORMAL] | i5 mobile | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | |
| +-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
| | 14 | 13 | - | - | [0, MAX_SUBNORMAL] | i5 mobile | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | |
2022-06-27 19:30:31 +02:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-06-15 19:57:46 -04:00
| hypotf | 25 | 15 | 64 | 49 | :math: `[-10, 10] \times [-10, 10]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
| logf | 12 | 10 | 56 | 46 | :math: `[e^{-1}, e]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
| log10f | 13 | 25 | 57 | 72 | :math: `[e^{-1}, e]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
| log1pf | 16 | 33 | 61 | 97 | :math: `[e^{-0.5} - 1, e^{0.5} - 1]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
| log2f | 13 | 10 | 57 | 46 | :math: `[e^{-1}, e]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-08-11 02:14:13 -04:00
| sinf | 12 | 25 | 51 | 57 | :math: `[-\pi, \pi]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
2022-06-15 19:57:46 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-08-11 02:14:13 -04:00
| sincosf | 19 | 30 | 57 | 68 | :math: `[-\pi, \pi]` | Ryzen 1700 | Ubuntu 20.04 LTS x86_64 | Clang 12.0.0 | FMA |
2022-08-01 09:57:29 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-09-15 20:48:50 -04:00
| sinhf | 13 | 63 | 48 | 137 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
[libc] Implement tanf function correctly rounded for all rounding modes.
Implement tanf function correctly rounded for all rounding modes.
We use the range reduction that is shared with `sinf`, `cosf`, and `sincosf`:
```
k = round(x * 32/pi) and y = x * (32/pi) - k.
```
Then we use the tangent of sum formula:
```
tan(x) = tan((k + y)* pi/32) = tan((k mod 32) * pi / 32 + y * pi/32)
= (tan((k mod 32) * pi/32) + tan(y * pi/32)) / (1 - tan((k mod 32) * pi/32) * tan(y * pi/32))
```
We need to make a further reduction when `k mod 32 >= 16` due to the pole at `pi/2` of `tan(x)` function:
```
if (k mod 32 >= 16): k = k - 31, y = y - 1.0
```
And to compute the final result, we store `tan(k * pi/32)` for `k = -15..15` in a table of 32 double values,
and evaluate `tan(y * pi/32)` with a degree-11 minimax odd polynomial generated by Sollya with:
```
> P = fpminimax(tan(y * pi/32)/y, [|0, 2, 4, 6, 8, 10|], [|D...|], [0, 1.5]);
```
Performance benchmark using `perf` tool from the CORE-MATH project on Ryzen 1700:
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh tanf
CORE-MATH reciprocal throughput : 18.586
System LIBC reciprocal throughput : 50.068
LIBC reciprocal throughput : 33.823
LIBC reciprocal throughput : 25.161 (with `-msse4.2` flag)
LIBC reciprocal throughput : 19.157 (with `-mfma` flag)
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh tanf --latency
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH latency : 55.630
System LIBC latency : 106.264
LIBC latency : 96.060
LIBC latency : 90.727 (with `-msse4.2` flag)
LIBC latency : 82.361 (with `-mfma` flag)
```
Reviewed By: orex
Differential Revision: https://reviews.llvm.org/D131715
2022-08-11 16:28:16 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-09-23 19:12:38 -04:00
| tanf | 16 | 50 | 61 | 107 | :math: `[-\pi, \pi]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
2022-07-31 16:32:21 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-09-15 20:48:50 -04:00
| tanhf | 13 | 55 | 57 | 123 | :math: `[-10, 10]` | Ryzen 1700 | Ubuntu 22.04 LTS x86_64 | Clang 14.0.0 | FMA |
2022-08-01 17:44:39 -04:00
+--------------+-----------+-------------------+-----------+-------------------+-------------------------------------+------------+-------------------------+--------------+---------------+
2022-06-15 19:57:46 -04:00
References
==========
* `CRLIBM <https://hal-ens-lyon.archives-ouvertes.fr/ensl-01529804/file/crlibm.pdf> `_ .
* `RLIBM <https://people.cs.rutgers.edu/~sn349/rlibm/> `_ .
* `Sollya <https://www.sollya.org/> `_ .
* `The CORE-MATH Project <https://core-math.gitlabpages.inria.fr/> `_ .
* `The GNU C Library (glibc) <https://www.gnu.org/software/libc/> `_ .
* `The GNU MPFR Library <https://www.mpfr.org/> `_ .