The CORE-MATH project
[FAQ]
[git]
[mailing list]
[references]
CORE-MATH Mission: provide on-the-shelf open-source
mathematical functions with correct rounding
that can be integrated into current mathematical
libraries (GNU libc, Intel Math Library, AMD Libm, Newlib, OpenLibm, Musl,
Apple Libm, llvm-libc, CUDA libm, ROCm)
Available CORE-MATH functions (under MIT license for the stand-alone functions):
function | binary32 | binary64 | binary80 | binary128 |
acos |
code,perf |
code |
glibc |
glibc (1) |
acosh |
code,perf |
|
|
|
acospi |
code |
|
|
|
asin |
code,perf |
code |
|
|
asinh |
code,perf |
|
|
|
asinpi |
code |
|
|
|
atan |
code,perf |
code |
|
|
atan2 |
code,perf |
|
|
|
atan2pi |
code |
|
|
|
atanh |
code,perf |
code |
|
|
atanpi |
code |
|
|
|
cbrt |
code,perf |
code (proof) |
glibc |
glibc |
cos |
code,perf |
|
|
|
cosh |
code,perf |
code |
|
|
cospi |
code |
code |
|
|
erf |
code,perf |
code |
|
|
erfc |
code,perf |
|
|
|
exp |
code,perf |
code |
|
|
exp10 |
code,perf |
|
|
|
exp10m1 |
code |
|
|
|
exp2 |
code,perf |
code |
|
|
exp2m1 |
code |
|
|
|
expm1 |
code,perf |
|
|
|
hypot |
code,perf |
code |
|
|
log |
code,perf |
code (with Gappa proof) |
|
|
log10 |
code,perf |
code |
|
|
log10p1 |
code |
|
|
|
log1p |
code,perf |
code |
|
|
log2 |
code,perf |
code |
|
|
log2p1 |
code |
|
|
|
pow |
code,perf |
reserved |
|
|
rsqrt |
code |
code |
|
|
sin |
code,perf |
|
|
|
sinh |
code,perf |
code |
|
|
sinpi |
code |
code |
|
|
tan |
code,perf |
|
|
|
tanh |
code,perf |
code |
|
|
tanpi |
code |
code |
|
|
Caption:
- glibc: patch for GNU libc (details here on how to use it)
- llvm: pointer to a correctly-rounded implementation in llvm-libc
- proof: a paper proof of the correctness of the algorithm
- reserved: this implementation is reserved for a CORE-MATH contributor
- (1) tested on hard-to-round cases |x| < 2-34
- (2) only for rounding to nearest
Notes:
- correct rounding is claimed for all IEEE-754 rounding modes.
For univariate binary32 functions it is checked by exhaustive search.
For bivariate functions or
larger formats it is checked only with respect to known
hard-to-round cases. If you find an input which is not correctly
rounded, please send it to paul dot zimmermann @ inria dot fr.
- these implementations only care about correct rounding for regular
numbers, they do not necessarily correctly deal with NaN, infinities or
zero, set the underflow and overflow exceptions, nor the inexact flag.
- these implementations were tested on x86_64-linux, with and without the
use of fma (fused multiply add).
Other correctly-rounded implementations:
- CRlibm
this is a mirror of the original CRlibm project (which is no more
available). CRlibm is no longer maintained,
but contains very useful resources:
provides binary64 exp, log, cos, sin, tan, cospi, sinpi, tanpi,
atan, atanpi, cosh, sinh, log2, log10, asin, acos, asinpi, acospi,
expm1, log1p, exp2, pow (only for rounding to nearest for pow).
- RLIBM
provides binary32 log, log2, log10, exp, exp2, exp10, sinh, cosh,
sinpi, cospi, sin, cos, tan, atan, asin, acos for all rounding modes.
- LLVM-libc provides some
correctly rounded functions (see links below):
claimed accuracy of LLVM functions
- JuliaIntervals
provides elementary functions with directed rounding wrapping CRlibm.
function | binary32 | binary64 | binary80 | binary128 |
acos |
rlibm llvm |
crlibm |
|
|
acosh |
llvm |
|
|
acospi |
|
crlibm |
|
|
asin |
rlibm llvm |
crlibm |
|
|
asinh |
llvm |
|
|
asinpi |
|
crlibm |
|
|
atan |
rlibm llvm |
crlibm |
|
|
atan2 |
|
|
|
atanh |
llvm |
crlibm |
|
|
atanpi |
|
crlibm |
|
|
cbrt |
|
|
|
|
cos |
rlibm llvm,llvm |
crlibm |
|
|
cosh |
rlibm llvm llvm |
crlibm |
|
|
cospi |
rlibm |
crlibm |
|
|
erf |
|
|
|
|
erfc |
|
|
|
|
exp |
rlibm llvm,llvm |
crlibm |
|
|
exp10 |
rlibm llvm |
|
|
|
exp2 |
rlibm llvm llvm llvm |
crlibm |
|
|
expm1 |
llvm,llvm |
crlibm |
|
|
hypot |
llvm,llvm |
llvm |
|
|
log |
rlibm llvm |
crlibm, llvm |
|
|
log10 |
rlibm llvm |
crlibm, llvm |
|
|
log1p |
llvm |
crlibm, llvm |
|
|
log2 |
rlibm llvm |
crlibm, llvm |
|
|
pow |
|
crlibm (2) |
|
|
sin |
rlibm llvm,llvm |
crlibm |
|
|
sincos |
llvm |
|
|
|
sinh |
rlibm llvm llvm |
crlibm |
|
|
sinpi |
rlibm |
crlibm |
|
|
tan |
rlibm llvm,llvm |
crlibm |
|
|
tanh |
llvm llvm |
|
|
|
tanpi |
|
crlibm |
|
|