2 releases

0.1.1 Jan 2, 2022
0.1.0 Jan 2, 2022

#1620 in Math

23 downloads per month

GPL-2.0-or-later

1MB
15K SLoC

C 15K SLoC // 0.4% comments Rust 319 SLoC // 0.0% comments RPM Specfile 30 SLoC

Contains (obscure autoconf code, 12KB) crlibm/configure.ac

Crlibm

This crate is a binding to CRlibm, an efficient and proved correctly-rounded mathematical library. For the user convenience, this module embeds the relevant C code from the CRlibm Git repository.

Note that the C code of CRlibm is mature but superseded by MetaLibm (repository) and will therefore not receive updates.

Example

use crlibm::*;
let x = sinpi_rd(2.);
let y = sinpi_rn(2.);
let z = sinpi_ru(2.);

lib.rs:

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.);

Dependencies

~1–1.5MB
~37K SLoC