2 releases

Uses old Rust 2015

0.1.1 Jan 13, 2019
0.1.0 May 10, 2015

#614 in Algorithms

Download history 7424/week @ 2024-12-21 11573/week @ 2024-12-28 24371/week @ 2025-01-04 21638/week @ 2025-01-11 20405/week @ 2025-01-18 20028/week @ 2025-01-25 24277/week @ 2025-02-01 24624/week @ 2025-02-08 15542/week @ 2025-02-15 16250/week @ 2025-02-22 20781/week @ 2025-03-01 23677/week @ 2025-03-08 20845/week @ 2025-03-15 25592/week @ 2025-03-22 19677/week @ 2025-03-29 17153/week @ 2025-04-05

86,851 downloads per month
Used in 118 crates (14 directly)

MIT/Apache

21KB
422 lines

Fast, approximate versions of mathematical functions.

This crate includes implementations of "expensive" mathematical functions that are much faster, at the expense of some accuracy. All functions have good guarantees on accuracy to some degree (both relative and absolute).

Installation

Add this to your Cargo.toml

[dependencies]
fast-math = "0.1"

Examples

let x = 10.4781;
let approx = fast_math::log2(x);
let real = x.log2();
// they should be close
assert!((approx - real).abs() < 0.01);

fast-math

Build Status codecov

Fast, approximate versions of mathematical functions. Includes:

  • Logarithms: log2,
  • Exponentials: exp, exp2,
  • Trigonometric functions: atan, atan2.

Documentation, crates.io.

Dependencies

~75KB