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

I always try to relate these floating point issues back to real situations. Is there really a case where you would use a quadratic equation such as this and what kind of precision would you really be interested in? In the first example, the root is wrong by 25% in percentage terms but is wrong by less than 2.5e-9 in absolute terms.

What is important is to tailor your maths to the real problem you are solving (and remember garbage in = garbage out). Very rarely do you actually need 53 bits of precision (as you get in a double), or even need to store intermediate results with 53 bits of precision.




This exact issue turns out to be critical in the Hessenberg QR algorithm, which is at the heart of MATLAB's eig.


Yeah I understand why a product like Matlab which needs accuracy across a wide range of end use cases would need to consider things like this.




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

Search: