|
|
|
|
|
by kraghen
3129 days ago
|
|
It gets even worse: (1 + 2 ^ 53) - 2 ^ 53 evaluates to 0 while 1 + (2 ^ 53 - 2 ^ 53) evaluates to 1 (the correct result), which means that even the operation of adding three floating point numbers has unbounded relative error in the general case. This is a great source of frustration in computational geometry, where this turns from a quantitative issue to a qualitative one, since if we get the sign of an expression wrong our data structures might no longer reflect the actual topology of the problem. |
|
Its not quite "in the general case".
In "any case with subtraction", there is unbounded relative error. And remember that addition with negative numbers can become subtraction.
Error-management is very important. But if you can GUARANTEE that your operations have the same sign, and that you're only using addition, multiplication, and division... then error is easier to track.
Its that subtraction (aka: cancellation error) that gets ya.