Expand description
Binding to CRlibm, a library of proved correctly-rounded mathematical functions.
Each function, for example “sin”, comes in four flavors depending on how the result is rounded:
sin_rn
: round the result to nearest;sin_ru
: round the result (up) to +∞;sin_rd
: round the result (down) to -∞;sin_rz
: round the result toward 0.
§Example
use crlibm::*;
let x = sinpi_rd(2.);
let y = sinpi_rn(2.);
let z = sinpi_ru(2.);
Functions§
- acos_rd
acos(x)
rounded toward -∞.- acos_rn
acos(x)
rounded to the nearset.- acos_ru
acos(x)
rounded toward +∞.- acos_rz
acos(x)
rounded toward zero.- acospi_
rd acospi(x)
returnsacos(x)
/π ∈ [0., 1.] rounded toward -∞.- acospi_
rn acospi(x)
returnsacos(x)
/π ∈ [0., 1.] rounded to the nearset.- acospi_
ru acospi(x)
returnsacos(x)
/π ∈ [0., 1.] rounded toward +∞.- acospi_
rz acospi(x)
returnsacos(x)
/π ∈ [0., 1.] rounded toward zero.- asin_rd
asin(x)
rounded toward -∞.- asin_rn
asin(x)
rounded to the nearset.- asin_ru
asin(x)
rounded toward +∞.- asin_rz
asin(x)
rounded toward zero.- asinpi_
rd asinpi(x)
returnsasin(x)
/π ∈ [-0.5, 0.5] rounded toward -∞.- asinpi_
rn asinpi(x)
returnsasin(x)
/π ∈ [-0.5, 0.5] rounded to the nearset.- asinpi_
ru asinpi(x)
returnsasin(x)
/π ∈ [-0.5, 0.5] rounded toward +∞.- asinpi_
rz asinpi(x)
returnsasin(x)
/π ∈ [-0.5, 0.5] rounded toward zero.- atan_rd
atan(x)
rounded toward -∞.- atan_rn
atan(x)
rounded to the nearset.- atan_ru
atan(x)
rounded toward +∞.- atan_rz
atan(x)
rounded toward zero.- atanpi_
rd atanpi(x)
returnsatan(x)
/π ∈ [-0.5, 0.5] rounded toward -∞.- atanpi_
rn atanpi(x)
returnsatan(x)
/π ∈ [-0.5, 0.5] rounded to the nearset.- atanpi_
ru atanpi(x)
returnsatan(x)
/π ∈ [-0.5, 0.5] rounded toward +∞.- atanpi_
rz atanpi(x)
returnsatan(x)
/π ∈ [-0.5, 0.5] rounded toward zero.- cos_rd
cos(x)
rounded toward -∞.- cos_rn
cos(x)
rounded to the nearset floating point.- cos_ru
cos(x)
rounded toward +∞.- cos_rz
cos(x)
rounded toward zero.- cosh_rd
cosh(x)
rounded toward -∞.- cosh_rn
cosh(x)
rounded to the nearset.- cosh_ru
cosh(x)
rounded toward +∞.- cosh_rz
cosh(x)
rounded toward zero.- cospi_
rd cospi(x)
returnscos(π·x)
rounded toward -∞.- cospi_
rn cospi(x)
returnscos(π·x)
rounded to the nearset.- cospi_
ru cospi(x)
returnscos(π·x)
rounded toward +∞.- cospi_
rz cospi(x)
returnscos(π·x)
rounded toward zero.- exp_
m1_ rd - Returns
exp(x) - 1
(rounded toward -∞) in a way that is accurate even for values ofx
near zero. - exp_
m1_ rn - Returns
exp(x) - 1
(rounded to the nearest) in a way that is accurate even for values ofx
near zero. - exp_
m1_ ru - Returns
exp(x) - 1
(rounded toward + ∞) in a way that is accurate even for values ofx
near zero. - exp_
m1_ rz - Returns
exp(x) - 1
(rounded toward zero) in a way that is accurate even for values ofx
near zero. - exp_rd
exp(x)
rounded toward -∞.- exp_rn
exp(x)
rounded to the nearset floating point.- exp_ru
exp(x)
rounded toward +∞.- exp_rz
exp(x)
rounded toward zero.- ln_
1p_ rd - Returns
ln(1 + x)
(rounded toward -∞) in a way that is accurate even for values ofx
near zero. - ln_
1p_ rn - Returns
ln(1 + x)
(rounded to the nearest) in a way that is accurate even for values ofx
near zero. - ln_
1p_ ru - Returns
ln(1 + x)
(rounded toward +∞) in a way that is accurate even for values ofx
near zero. - ln_
1p_ rz - Returns
ln(1 + x)
(rounded toward zero) in a way that is accurate even for values ofx
near zero. - ln_rd
- Returns
ln(x)
rounded toward -∞. - ln_rn
- Returns
ln(x)
rounded to the nearset floating point. - ln_ru
- Returns
ln(x)
rounded toward +∞. - ln_rz
- Returns
ln(x)
rounded toward zero. - log2_rd
log2(x)
rounded toward -∞.- log2_rn
log2(x)
rounded to the nearset.- log2_ru
log2(x)
rounded toward +∞.- log2_rz
log2(x)
rounded toward zero.- log10_
rd log10(x)
rounded toward -∞.- log10_
rn log10(x)
rounded to the nearset.- log10_
ru log10(x)
rounded toward +∞.- log10_
rz log10(x)
rounded toward zero.- sin_rd
sin(x)
rounded toward -∞.- sin_rn
sin(x)
rounded to the nearset.- sin_ru
sin(x)
rounded toward +∞.- sin_rz
sin(x)
rounded toward zero.- sinh_rd
sinh(x)
rounded toward -∞.- sinh_rn
sinh(x)
rounded to the nearset.- sinh_ru
sinh(x)
rounded toward +∞.- sinh_rz
sinh(x)
rounded toward zero.- sinpi_
rd sinpi(x)
returnssin(π·x)
rounded toward -∞.- sinpi_
rn sinpi(x)
returnssin(π·x)
rounded to the nearset.- sinpi_
ru sinpi(x)
returnssin(π·x)
rounded toward +∞.- sinpi_
rz sinpi(x)
returnssin(π·x)
rounded toward zero.- tan_rd
tan(x)
rounded toward -∞.- tan_rn
tan(x)
rounded to the nearset.- tan_ru
tan(x)
rounded toward +∞.- tan_rz
tan(x)
rounded toward zero.- tanpi_
rd tanpi(x)
returnstan(π·x)
rounded toward -∞.- tanpi_
rn tanpi(x)
returnstan(π·x)
rounded to the nearset.- tanpi_
ru tanpi(x)
returnstan(π·x)
rounded toward +∞.- tanpi_
rz tanpi(x)
returnstan(π·x)
rounded toward zero.