4 ms·
More important than just increasing accuracy is knowing how much accuracy you have. With interval artihmetic, you keep an upper and lower bound of every calcula
by rjmunro 11y ago
More important than just increasing accuracy is knowing how much accuracy you have. With interval artihmetic, you keep an upper and lower bound of every calculation, and use the the appropriate floating point rounding modes when you manipulate the numbers.
You can then try different methods of calculating your result and measure which is the least destructive - compiler optimisations can optimise for width rather than runtime.
Some methods might produce a better upper bound, and others a better lower bound. In those cases you can take the intersection as your best result. See https://pypi.python.org/pypi/pyinterval https://pypi.python.org/pypi/pyinterval for an implementation in python.
- eru 11y agoDon't common ways to implement interval arithmetic massively overestimate the inaccuracy?
- rjmunro 11y agoCompared to what? You can improve accuracy by optimising the way you do your calculations. A really trivial example: 10000 + .00001 - 10000 is less accurate than 10000 - 10000 + .00001. Without interval arithmetic, you can't easily measure this and decide which way round is best.