Here a XX term is introduced which will approach zero as the solution converges. The XX term rather than yi will be tested against a selected tolerance in this case. Note that this from of the equation avoids the division operation which is acceptable in a scalar equation but impossible with a matrix equation.