[Libre-soc-bugs] [Bug 632] Potentially share Vector Math libraries with Rust's project portable SIMD (`std::simd`)

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon May 10 08:47:11 BST 2021


--- Comment #10 from Jacob Lifshay <programmerjake at gmail.com> ---
>From https://github.com/rust-lang/stdsimd/issues/109#issuecomment-836310527
I added implementations of `sin_pi` and `cos_pi` for `f16` and `f32`, I tested
all possible inputs, the functions are accurate to 2ULP though aren't
guaranteed to give the correct sign for zeros.

Testing the `f32` functions required writing a custom reference implementation
of `sin_cos_pi` since `(x * f64::consts::PI).sin_cos()` isn't accurate enough
when the exact mathematical value of either `sin` or `cos` is close to zero
(e.g. `sin_pi(1.0) == 0.0` but `f64::consts::PI.sin() != 0.0` due to round-off


You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list