Crate crlibm[][src]

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(x) rounded toward -∞.

acos(x) rounded to the nearset.

acos(x) rounded toward +∞.

acos(x) rounded toward zero.

acospi(x) returns acos(x)/π ∈ [0., 1.] rounded toward -∞.

acospi(x) returns acos(x)/π ∈ [0., 1.] rounded to the nearset.

acospi(x) returns acos(x)/π ∈ [0., 1.] rounded toward +∞.

acospi(x) returns acos(x)/π ∈ [0., 1.] rounded toward zero.

asin(x) rounded toward -∞.

asin(x) rounded to the nearset.

asin(x) rounded toward +∞.

asin(x) rounded toward zero.

asinpi(x) returns asin(x)/π ∈ [-0.5, 0.5] rounded toward -∞.

asinpi(x) returns asin(x)/π ∈ [-0.5, 0.5] rounded to the nearset.

asinpi(x) returns asin(x)/π ∈ [-0.5, 0.5] rounded toward +∞.

asinpi(x) returns asin(x)/π ∈ [-0.5, 0.5] rounded toward zero.

atan(x) rounded toward -∞.

atan(x) rounded to the nearset.

atan(x) rounded toward +∞.

atan(x) rounded toward zero.

atanpi(x) returns atan(x)/π ∈ [-0.5, 0.5] rounded toward -∞.

atanpi(x) returns atan(x)/π ∈ [-0.5, 0.5] rounded to the nearset.

atanpi(x) returns atan(x)/π ∈ [-0.5, 0.5] rounded toward +∞.

atanpi(x) returns atan(x)/π ∈ [-0.5, 0.5] rounded toward zero.

cos(x) rounded toward -∞.

cos(x) rounded to the nearset floating point.

cos(x) rounded toward +∞.

cos(x) rounded toward zero.

cosh(x) rounded toward -∞.

cosh(x) rounded to the nearset.

cosh(x) rounded toward +∞.

cosh(x) rounded toward zero.

cospi(x) returns cos(π·x) rounded toward -∞.

cospi(x) returns cos(π·x) rounded to the nearset.

cospi(x) returns cos(π·x) rounded toward +∞.

cospi(x) returns cos(π·x) rounded toward zero.

Returns exp(x) - 1 (rounded toward -∞) in a way that is accurate even for values of x near zero.

Returns exp(x) - 1 (rounded to the nearest) in a way that is accurate even for values of x near zero.

Returns exp(x) - 1 (rounded toward + ∞) in a way that is accurate even for values of x near zero.

Returns exp(x) - 1 (rounded toward zero) in a way that is accurate even for values of x near zero.

exp(x) rounded toward -∞.

exp(x) rounded to the nearset floating point.

exp(x) rounded toward +∞.

exp(x) rounded toward zero.

Returns ln(1 + x) (rounded toward -∞) in a way that is accurate even for values of x near zero.

Returns ln(1 + x) (rounded to the nearest) in a way that is accurate even for values of x near zero.

Returns ln(1 + x) (rounded toward +∞) in a way that is accurate even for values of x near zero.

Returns ln(1 + x) (rounded toward zero) in a way that is accurate even for values of x near zero.

Returns ln(x) rounded toward -∞.

Returns ln(x) rounded to the nearset floating point.

Returns ln(x) rounded toward +∞.

Returns ln(x) rounded toward zero.

log2(x) rounded toward -∞.

log2(x) rounded to the nearset.

log2(x) rounded toward +∞.

log2(x) rounded toward zero.

log10(x) rounded toward -∞.

log10(x) rounded to the nearset.

log10(x) rounded toward +∞.

log10(x) rounded toward zero.

sin(x) rounded toward -∞.

sin(x) rounded to the nearset.

sin(x) rounded toward +∞.

sin(x) rounded toward zero.

sinh(x) rounded toward -∞.

sinh(x) rounded to the nearset.

sinh(x) rounded toward +∞.

sinh(x) rounded toward zero.

sinpi(x) returns sin(π·x) rounded toward -∞.

sinpi(x) returns sin(π·x) rounded to the nearset.

sinpi(x) returns sin(π·x) rounded toward +∞.

sinpi(x) returns sin(π·x) rounded toward zero.

tan(x) rounded toward -∞.

tan(x) rounded to the nearset.

tan(x) rounded toward +∞.

tan(x) rounded toward zero.

tanpi(x) returns tan(π·x) rounded toward -∞.

tanpi(x) returns tan(π·x) rounded to the nearset.

tanpi(x) returns tan(π·x) rounded toward +∞.

tanpi(x) returns tan(π·x) rounded toward zero.