Etherton wrote:You are probably right and I am wrong. :(
Almost humble?! Doesn't sound at all like the child who first posted this belligerent post:
Etherton wrote:Wow, thanks you for letting it me know about that algebraic identity (I feel so much empowered now). Is this a principle you came up with? Would that be the Ericson?s inequivalence of the transitivity principle of algebra for better factorization? [other vitriol deleted]
which you edited into the above post (yes, I caught your initial post before you retracted it).
There's no "probably" right here. Let me elaborate on why the expressions A*A-B*B and (A+B)*(A-B) have different numerical errors, and what this has to do with the GJK algorithm (and all other algorithms implemented in floating-point arithmetic).
Under IEEE-754 floating-point arithmetic we are guaranteed the expression "A op B" (where op is +, -, *, or /) will result in the value (A op B) * (1 + epsilon) where |epsilon| <= u, where u is the machine epsilon. This error is due to rounding of the result to the nearest machine-representable number. For the first expression, A*A-B*B, what is actually computed numerically is therefore:
(A*A*(1+e1) - B*B*(1+e2))*(1+e3)
where each error ei is of the order |ei|<=u, where u is the machine epsilon.
Expanded, this gives:
A*A - B*B + A*A*(e1 + e3) - B*B*(e2 + e3) + O(u^2)
where O(u^2) contains all the rest terms involving two or more error terms (which are so small that they can be safely ignored).
The second expression, (A+B)*(A-B), will be evaluated as:
((A+B)*(1+e1)*(A-B)*(1+e2))*(1+e3)
This expands to:
A*A - B*B + A*A*(e1 + e2 + e3) - B*B*(e1 + e2 + e3) + O(u^2)
For comparison purposes, we can drop the insignificant O(u^2) error terms. Then, as one can see, when computed in floating-point, the expression A*A-B*B has an error of A*A*(e1 + e3) - B*B*(e2 + e3) whereas the expression (A+B)*(A-B) has an error of A*A*(e1 + e2 + e3) - B*B*(e1 + e2 + e3). These errors are
clearly different.
Going beyond this simple example, we have that just about
any two different but mathematically equivalent expression will have
different numerical errors when subject to an error analysis as above.
This applies to the expressions computed in the distance calculations of GJK too (or any other algorithm for that matter). Thus, if you express the "Johnson's subdistance algorithm" bit of GJK in two different ways,
they will have different numerical errors even if those two ways are mathematically equivalent.
A good resource for learning more about error analysis of floating-point expressions is Wilkinson's "Rounding Errors in Algebraic Processes" (in reprint from Dover for just a few dollars).
Next time you have an urge to post some malevolent drivel, first consider if you actually have a clue what you're talking about, then, when you decide to post it regardless, be a man and post under your real name.