Let\'s say I have three 32-bit floating point values, a, b, and c, such that (a + b) + c != a + (b + c). Is there a summa
With some additional information about the terms you have to sum, you can avoid the overhead of Shewchuk's algorithm.
In IEEE 754 arithmetic, x-y is exact whenever y/2 <= x <= 2*y (Sterbenz theorem, formally proved here)
So if you can arrange all your terms in an order such that each partial sum is of the form above, then you get the exact result for free.
I am afraid that in practice there is little chance of being in conditions where this is assured to happen. Alternating positive and negatives numbers with increasing magnitudes may be one case where it happens.
Note: the original question was about an algorithm that would give the same result regardless of the summation order. Mark's answer initiated a drift in the direction of "an exact algorithm", but reading again your question, I am afraid that I am pushing things too far when I am suggesting to reorder terms. You probably can't in what you are trying to do, and my answer is probably off-topic. Well, sorry :)