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

Interval arithmetic [1] has been around since the 1950's, I believe, but for some reason it never caught on.

In a nutshell, interval arithmetic is about storing each imprecise number as a lower bound and upper bound. On each calculation, the lower bound is rounded down and the upper bound is rounded up. The existing libraries are well developed, and the performance hit is often surprisingly close to 2.

[1] http://en.m.wikipedia.org/wiki/Interval_arithmetic




That's because intervals tend to just keep growing. Without some function to make the interval smaller or otherwise keep it bounded, cumulative interval arithmetic tends to be useless.

Using the rounding mode to calculate once with rounding down, once with standard rounding, and once to rounding up will give a much better indication of whether or not an algorithm is sensitive to roundoff error.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: