You calculate the factorization (QR, LU, or similar), but you never calculate the inverse of the factorization:<p><pre><code>    A x = b
    A =&gt; QR  # QR decomposition
    Q R x = b
    R x = Q&#x27; b  # Q is inverted by transposing
    x = backsubstitute(R, Q&#x27; b)
</code></pre>
Q was the transpose of it&#x27;s inverse, and so you don&#x27;t get any rounding error when you transpose it.  R didn&#x27;t need to be inverted because it was in a form where back substitution lets you apply the inverse of R to be without needing the inverse of R.