On 21 May 2017 at 20:58, Dmitry Timoshkov dmitry@baikal.ru wrote:
Henri Verbeet hverbeet@gmail.com wrote:
I'd dare to claim that both variants should be equivalent in accuracy,
I'd be interested to see that analysis.
I guess that an interested person would need to perform some elementary math things like opening braces and regrouping variables in an equation.
I was afraid that might be about the level of analysis done. Unfortunately floating-point arithmetic doesn't work that way. I don't care enough to do proper analysis and calculate error bounds, but consider for example the trivial case of t = 1.0f, in which case
out->x = a->x + (b->x - a->x) * t;
would be equivalent to
out->x = a->x + (b->x - a->x);
then, note that "a ⊕ (b ⊖ a)" isn't necessarily equal to a.
Of course plenty has been written on the subject of floating point computation, but some classical introductions are section 4.2 of TAoCP (volume 2) by Knuth, and the 1991 paper by David Goldberg.