package crlibm

  1. Overview
  2. Docs

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

Version: 0.5.1

module type S = sig ... end

Common functions to the four rounding modules below.

Round to the nearest

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

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

val log : float -> float
val log1p : float -> float

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

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

cospi x returns cos(π·x).

val sinpi : float -> float

sinpi x returns sin(π·x).

val tanpi : float -> float

tanpi x returns tan(π·x).

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

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

val acospi : float -> float

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

val atanpi : float -> float

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

val cosh : float -> float
val sinh : float -> float
val log2 : float -> float
val log10 : float -> float
val 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 -∞

module RoundDown : S
module Low = RoundDown

Round toward +∞

module RoundUp : S
module High = RoundUp

Round toward zero

module RoundToZero : S
module Zero = RoundToZero
OCaml

Innovation. Community. Security.