Crate crlibm

Source
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) returns acos(x)/π ∈ [0., 1.] rounded toward -∞.
acospi_rn
acospi(x) returns acos(x)/π ∈ [0., 1.] rounded to the nearset.
acospi_ru
acospi(x) returns acos(x)/π ∈ [0., 1.] rounded toward +∞.
acospi_rz
acospi(x) returns acos(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) returns asin(x)/π ∈ [-0.5, 0.5] rounded toward -∞.
asinpi_rn
asinpi(x) returns asin(x)/π ∈ [-0.5, 0.5] rounded to the nearset.
asinpi_ru
asinpi(x) returns asin(x)/π ∈ [-0.5, 0.5] rounded toward +∞.
asinpi_rz
asinpi(x) returns asin(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) returns atan(x)/π ∈ [-0.5, 0.5] rounded toward -∞.
atanpi_rn
atanpi(x) returns atan(x)/π ∈ [-0.5, 0.5] rounded to the nearset.
atanpi_ru
atanpi(x) returns atan(x)/π ∈ [-0.5, 0.5] rounded toward +∞.
atanpi_rz
atanpi(x) returns atan(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) returns cos(π·x) rounded toward -∞.
cospi_rn
cospi(x) returns cos(π·x) rounded to the nearset.
cospi_ru
cospi(x) returns cos(π·x) rounded toward +∞.
cospi_rz
cospi(x) returns cos(π·x) rounded toward zero.
exp_m1_rd
Returns exp(x) - 1 (rounded toward -∞) in a way that is accurate even for values of x near zero.
exp_m1_rn
Returns exp(x) - 1 (rounded to the nearest) in a way that is accurate even for values of x near zero.
exp_m1_ru
Returns exp(x) - 1 (rounded toward + ∞) in a way that is accurate even for values of x near zero.
exp_m1_rz
Returns exp(x) - 1 (rounded toward zero) in a way that is accurate even for values of x 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 of x near zero.
ln_1p_rn
Returns ln(1 + x) (rounded to the nearest) in a way that is accurate even for values of x near zero.
ln_1p_ru
Returns ln(1 + x) (rounded toward +∞) in a way that is accurate even for values of x near zero.
ln_1p_rz
Returns ln(1 + x) (rounded toward zero) in a way that is accurate even for values of x 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) returns sin(π·x) rounded toward -∞.
sinpi_rn
sinpi(x) returns sin(π·x) rounded to the nearset.
sinpi_ru
sinpi(x) returns sin(π·x) rounded toward +∞.
sinpi_rz
sinpi(x) returns sin(π·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) returns tan(π·x) rounded toward -∞.
tanpi_rn
tanpi(x) returns tan(π·x) rounded to the nearset.
tanpi_ru
tanpi(x) returns tan(π·x) rounded toward +∞.
tanpi_rz
tanpi(x) returns tan(π·x) rounded toward zero.