### 2 releases

Uses old Rust 2015

0.1.1 | Jan 13, 2019 |
---|---|

0.1.0 | May 10, 2015 |

#**315** in Algorithms

**19,080** downloads per month

Used in **67** crates
(10 directly)

**MIT/Apache**

21KB

422 lines

`fast-math`

`fast-math`

Fast, approximate versions of mathematical functions. Includes:

- Logarithms:

,`log2` - Exponentials:

,`exp`

,`exp2` - Trigonometric functions:

,`atan`

.`atan2`

###
`lib.rs`

:

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

#### Dependencies

~74KB