Hacker News new | past | comments | ask | show | jobs | submit login

Not the least that you should get the same result from your code every time, even if you compile it with a different compiler. Doesn't matter if that result is somehow better or worse or “difference is so small that it doesn't matter”; it needs to be exactly the same, every time.





I think there’s often a disconnect in these discussions between people that work on libraries and people that work on the application code.

If you have written a library, the user will provide some inputs. While the rounding behavior of floating point operations is well defined, for arbitrary user input, you can’t usually guarantee that it’ll go either way. Therefore, you need to do the numerical analysis given users inputs from some range, if you want to be at all rigorous. This will give results with error bounds, not exact bit patterns.

If you want exact matches for your tests, maybe identify the bits that are essentially meaningless and write them to some arbitrary value.

Edit: that said I don’t think anybody particularly owns rigor on this front, given that most libraries don’t actually do the analysis, lol.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: