math.rs icon indicating copy to clipboard operation
math.rs copied to clipboard

Results from math.rs and glibc are different

Open anatol opened this issue 7 years ago • 4 comments

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.

anatol avatar Feb 16 '17 04:02 anatol