# Dealing with truncation errors when performing Gauss-Jordan elimination

When using Gauss-Jordan elimination to convert a matrix to an upper triangular matrix, truncation errors can drastically change the answer.

For example, when performing row operations with excel, with the following matrix:

Is reduced to:

The value in the red cell is a truncation error and should be zero. The next step in the algorithm would be to divide the 2nd last row by a constant to make the red cell equal to 1. If no truncation errors had occurred then this cell would have a value of zero. This drastically changes the final matrix. How could I correct for this?

• This is known as loss of significance. – David Richerby Apr 10 '17 at 12:52
• Whole books are written on numerical instability in linear algebra, as written your question is too broad and a reference request at best. – orlp Apr 11 '17 at 0:10
• @orlp I'm just looking for some solution to this particular problem. Not trying to learn about the whole field. Like looking for a solution to a particular differential equation without learning how to solve differential equations in general. Since this is such a well know algorithm, I expect that someone has dealt with this particular problem before. – Nathan Apr 13 '17 at 16:09