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.
I guess that it's always possible to try justifying one way of doing math as a most preferred one. But in the case when one has to choose between "(a + b) * c" and "a * c + b * c" it's better to use common sense IMO. Since there are numerous ways how to compute linear blending, and every of them will always have subtle differences, is it really possible to plausibly explain a personal preference or justify some choice? Is there really "the true one" instead of considering every way having equal starting value?