math.rs
math.rs copied to clipboard
Results from math.rs and glibc are different
math.rs library looks promising and can used as a template for Rust float functions implementation. In this case performance and correctness are 2 extremely important properties. I checked some functions and found that most of them work well, but cos
shows incorrect results. Here is an example:
cos(2.0) gives following results:
libm: -0.4161468365471424
math.rs: -0.4161468365471425
google: -0.41614683654
ruby: -0.4161468365471424
math.rs result is slightly different from what libm returns.