Re:What if writing tests was a joyful experience?
by MichaelBurge on Sunday January 15, 2023 @07:15AM
(#34388830)
If it's likely to change, then you especially want the regression test so you can decide how to handle the divergence during your port. Maybe one library preserves the signal on NaNs and the other doesn't. Or maybe the CPU's default rounding mode is different when called in this context, and you're off by 1 ulp.
In either case, if the behavior is to change, it should change as an informed decision and not because nobody noticed.
Cosine is a terrible example to use for that idea. It's pretty likely to change, for certain x, in similar circumstances to your examples of "when test results should never change".