Re: [geometry] Define algorithm for inverse() method on DOMMatrix

On 9/4/14, 9:42 AM, Tab Atkins Jr. wrote:
> Inverting a matrix is a well-defined operation

When operating on real numbers.

Sadly, computers typically operate on IEEE floats/doubles, not on real 
numbers.  And with those, the result can depend strikingly on the exact 
algorithm used to compute the inverse, especially for near-singular 
matrices.

> which similarly had a unique and well-defined solution (but the simple algorithm wasn't
> obvious).

There is no such thing as "unique and well-defined solution" when 
dealing with floating point, unless you fix the algorithm.

And I mean _really_ fix.  For example, floating point addition is not 
associative, and floating point multiplication does not distribute over 
floating point addition, so you have to be very careful when defining 
floating point algorithms if you really want them to produce the same 
output in multiple implementations.

-Boris

Received on Thursday, 4 September 2014 14:09:29 UTC