lapack/gonum: Dgetri gives very inaccurate results for larger matrices
Created by: vladimir-ch
If I add some extra matrix sizes around n=64
to the Dgetri test and log the distance between inv(A)*A
and the identity matrix, I get this:
dgetri.go:81: n = 5 |Inv(A)*A-I| 3.3306690738754696e-16
dgetri.go:81: n = 5 |Inv(A)*A-I| 3.3306690738754696e-16
dgetri.go:81: n = 45 |Inv(A)*A-I| 9.992007221626409e-16
dgetri.go:81: n = 45 |Inv(A)*A-I| 8.881784197001252e-16
dgetri.go:81: n = 60 |Inv(A)*A-I| 9.992007221626409e-16
dgetri.go:81: n = 61 |Inv(A)*A-I| 1.5543122344752192e-15
dgetri.go:81: n = 62 |Inv(A)*A-I| 1.3322676295501878e-15
dgetri.go:81: n = 63 |Inv(A)*A-I| 1.3322676295501878e-15
dgetri.go:81: n = 64 |Inv(A)*A-I| 1.1102230246251565e-15
dgetri.go:81: n = 65 |Inv(A)*A-I| 0.01007015094979342
dgetri.go:81: n = 65 |Inv(A)*A-I| 0.009730647107725922
dgetri.go:81: n = 66 |Inv(A)*A-I| 0.009990179500856199
dgetri.go:81: n = 67 |Inv(A)*A-I| 0.01579770156180481
dgetri.go:81: n = 68 |Inv(A)*A-I| 0.00970603409163509
dgetri.go:81: n = 69 |Inv(A)*A-I| 0.011366393236460564
dgetri.go:81: n = 70 |Inv(A)*A-I| 0.014007348162055427
dgetri.go:81: n = 150 |Inv(A)*A-I| 0.02203173241669382
dgetri.go:81: n = 150 |Inv(A)*A-I| 0.018438456323505197
This clearly indicates an issue in the blocked path in Dgetri which is taken for matrices larger than 64 (I already see at least two issues in the code but fixing them does not fix this).