We present a variant of the AINV factorized sparse approximate inverse algo
rithm which is applicable to any symmetric positive definite matrix. The ne
w preconditioner is breakdown-free and, when used in conjunction with the c
onjugate gradient method, results in a reliable solver for highly ill-condi
tioned linear systems. We also investigate an alternative approach to a sta
ble approximate inverse algorithm, based on the idea of diagonally compensa
ted reduction of matrix entries. The results of numerical tests on challeng
ing linear systems arising from finite element modeling of elasticity and d
iffusion problems are presented.