Project DelphiTensors Workshop
Knowledge

Solving Ax = b by computing A⁻¹

x = A⁻¹b is the neat way to write the solution of Ax = b, but it is rarely the right way to compute it. The book calls A⁻¹ primarily a theoretical tool: it can only be stored with limited precision on a computer, so algorithms that also use the value of b usually get a more accurate x.

In NumPy that means np.linalg.solve(A, b) rather than np.linalg.inv(A) @ b.