These still fail random tests, e.g.:
called `Result::unwrap()` on an `Err` value: jn
Caused by:
0:
input: (1068, -16013.98381387313)
as hex: (, -0x1.f46fded9ced39p+13)
as bits: (0x0000042c, 0xc0cf46fded9ced39)
expected: 6.7603314308122506e-6 0x1.c5ad9c102d413p-18 0x3edc5ad9c102d413
actual: 6.7603314308006335e-6 0x1.c5ad9c1029e80p-18 0x3edc5ad9c1029e80
1: ulp 13715 > 4000
Caused by:
0:
input: (195, 42147.94)
as hex: (, 0x1.4947e2p+15)
as bits: (0x000000c3, 0x4724a3f1)
expected: -2.13669e-7 -0x1.cad9c6p-23 0xb4656ce3
actual: -2.1376937e-7 -0x1.cb10f4p-23 0xb465887a
1: ulp 7063 > 4000
Caused by:
0:
input: (194, 740.1916)
as hex: (, 0x1.721886p+9)
as bits: (0x000000c2, 0x44390c43)
expected: 1.212096e-6 0x1.455e9ap-20 0x35a2af4d
actual: 1.2172386e-6 0x1.46c000p-20 0x35a36000
1: ulp 45235 > 10000
Increase allowed precision to avoid spurious failures.
libm
A port of MUSL's libm to Rust.
Goals
The short term goal of this library is to enable math support (e.g. sin, atan2) for the
wasm32-unknown-unknown target (cf. rust-lang/compiler-builtins). The longer
term goal is to enable math support in the core crate.
Already usable
This crate is on crates.io and can be used today in stable #![no_std] programs.
The API documentation can be found here.
Benchmark
The benchmarks are located in crates/libm-bench and require a nightly Rust toolchain.
To run all benchmarks:
cargo +nightly bench --all
Contributing
Please check CONTRIBUTING.md
Minimum Rust version policy
This crate supports rustc 1.63 and newer.
License
Usage is licensed under the MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT).
Contribution
Contributions are licensed under both the MIT license and the Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0). Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as mentioned, without any additional terms or conditions.
See LICENSE.txt for full details.