Embedded Rust math library featuring fast, safe floating point approximations for common arithmetic operations, 2D and 3D vector types, and statistical analysis.
f32
extension:
asin
acos
atan
atan2
cos
hypot
invsqrt
ln
log
log2
log10
powf
sin
sqrt
tan
std
polyfills:abs
ceil
floor
round
trunc
I8x2
I16x2
I32x2
U8x2
U16x2
U32x2
F32x2
I8x3
I16x3
I32x3
U8x3
U16x3
U32x3
F32x3
mean
variance
stddev
libm
crateThe [libm crate] contains a port of MUSL's libm to Rust, providing high-precision implementations of common arithmetic functions.
micromath
trades precision for performance, instead using the best-available
approximations of the same functions, implemented using safe conversions
between f32
and u32
.
The approximations are generally calculated using a combination of bit
twiddling and magic constants, as opposed to the FPU-heavy approaches used by
libm
. These approaches are culled from recent academic research papers as
well as older approaches which have been commonly used in games and other
performance critical use cases where approximations are adequate.
vek
crateThe [vek crate] provides a rich library for 2D and 3D vector types.
Unfortunately, due to a number of issues
including a transitive std
dependency through the [approx crate],
vek
does not support no_std
. According to the crate's author, the potential
fixes are nontrivial (and involve addressing problems such as transcendantal
functions causing overflow panics).
micromath
has been written from the ground up to support no_std
use cases.
In fact, it doesn't even have a std
feature!
We abide by the Contributor Covenant and ask that you do as well.
For more information, please see [CODEOFCONDUCT.md].
Copyright © 2019 NeoBirth Developers
Dual licensed under your choice of either of: