package crlibm

  1. Overview
  2. Docs

Module CrlibmSource

Binding to CRlibm, a library of proved correctly-rounded mathematical functions.

Version: 0.5.1

Sourcemodule type S = sig ... end

Common functions to the four rounding modules below.

Round to the nearest

include S
Sourceval exp : float -> float
Sourceval expm1 : float -> float

expm1 x returns exp x -. 1. in a way that is accurate even for values of x near zero.

Sourceval log : float -> float
Sourceval log1p : float -> float

log1p x returns log(x +. 1.) in a way that is accurate even for values of x near zero.

Sourceval cos : float -> float
Sourceval sin : float -> float
Sourceval tan : float -> float
Sourceval cospi : float -> float

cospi x returns cos(π·x).

Sourceval sinpi : float -> float

sinpi x returns sin(π·x).

Sourceval tanpi : float -> float

tanpi x returns tan(π·x).

Sourceval asin : float -> float
Sourceval acos : float -> float
Sourceval atan : float -> float
Sourceval asinpi : float -> float

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

Sourceval acospi : float -> float

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

Sourceval atanpi : float -> float

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

Sourceval cosh : float -> float
Sourceval sinh : float -> float
Sourceval log2 : float -> float
Sourceval log10 : float -> float
Sourceval pow : float -> float -> float

pow x y computes x to the power y. Beware that this is not proved to be correctly rounded for all inputs.

Round toward -∞

Sourcemodule Low = RoundDown

Round toward +∞

Sourcemodule RoundUp : S
Sourcemodule High = RoundUp

Round toward zero

Sourcemodule Zero = RoundToZero
OCaml

Innovation. Community. Security.