Closed maoe closed 3 years ago
We already use assert_approx_eq!
in some places. The reason for assert_eq remaining was that all the tests were first ran in our Haskell version, the numbers copied in verbatim and then ran against the Rust implementation. If it matched exactly, it was kept-as is.
Then as small changes were being made such as use of mul_add
, some results started to change when compared to the Haskell implementation: usually for the better accuracy. These were changed to assert_approx_eq
as needed.
We can change them all though it becomes a bit weaker as to what it is testing which currently is "exactly same accuracy as Haskell implementation on my machine". I'm ok with changing them now that we're fairly confident in the faithfulness of the implementation though.
It turned out that small numerical differences could be important for us. I'm closing this.
We use assert_eq! on floats in the tests. We should instead use the approx crate.