libm
libm copied to clipboard
A port of MUSL's libm to Rust.
It appears that unsigned integer subtraction was mapped to `Sub::sub(a, b)` in Rust (`a - b`), instead of `a.wrapping_sub(b)`. In C, unsigned integer subtraction wraps, but in rust, unless `wrapping_sub`...
Run this with commit f43bc0d25436b6d9395b8b0d03f825dc671dc1ee. ```rust % cargo test --features musl-reference-tests --release Compiling libm v0.2.0 (/home/lzutao/forked/rust/libm) error: linking with `cc` failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack"...
Hi guys. I created a test suite. when running this in dev it spotted overflow in cos, fma, sin, sincos, tan functions. let me know what you guys think. I...
Hi guys, `jn` and `jnf` are randomly failing on ARM. On master [Build](https://dev.azure.com/rust-lang/libm/_build/results?buildId=146) ``` cargo test --features checked musl-reference-tests --target arm-unknown-linux-gnueabi --release ... failures: ---- jn_matches_musl stdout ---- thread 'main'...
Source: https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libm/math/wf_exp2.c;hb=HEAD Rationale: the current implementation makes use of `f64` and it has bad performance on architectures that have no hardware support for double precision floats. What needs to be...
The functions taking a single `f32` could be fully validated (for all input bit-patterns) against `libm`. For functions taking multiple arguments and single `f64`s, the validation against `libm` could happen...
Float generation [happens here](https://github.com/rust-lang-nursery/libm/blob/de8ed2dbc0fe89e55369cc8eba706b6c3d8086be/build.rs#L175-L194), and https://github.com/rust-lang-nursery/libm/pull/165 is an example where we could, for example, generate values near pi for edge case testing of trig functions.
Source 1: https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libm/math/sf_sin.c;hb=HEAD Source 2: https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libm/mathfp/sf_sine.c;hb=HEAD (Unsure which one we want) Rationale: the current implementation makes use of `f64` and it has bad performance on architectures that have no hardware...
This bug is branched from rust-lang/rust#55107. The code for round (adapted from musl libm) is correct (I verified it for all f32 values) but slow, containing many branches. The following...
Source: https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libm/mathfp/sf_asine.c;hb=HEAD Rationale: the current implementation makes use of `f64` and it has bad performance on architectures that have no hardware support for double precision floats. What needs to be...