I have been trying to calculate the matrix inverse of some large matrix with entries ranging by orders of magnitude. I tried to use the matrix decomposition to simplify the computation, where a matrix \begin{equation} (AB) \end{equation} could be decomposed into two matrices, $A$, and $B$. The matrix $A$ is some diagonal matrix of large magnitude i.e. $diag(1,10^5, 10^{10}, 10^{15},10^{20},...)$, which reduced the large magnitudes in matrix $B$. Further, because $A$ is diagonal, its matrix inverse could be computed exactly.
However, this method failed. Because, though
$
A^{-1}
$
can be computed exactly and
$
B^{-1}
$
appeared to be simpler, the numerical error in
$
B^{-1}A^{-1}
$
may be larger than the numerical error in
$
(AB)^{-1}
$
In this case, since
\begin{equation}
A^{-1}A=I
\end{equation}
was exact, the numerical error in
\begin{equation}
\max(B^{-1} B)
\end{equation}
got propagated from $10^{50}$ to $10^{50000}$ in $\max(B^{-1} A^{-1} A B)$, while $\max((AB)^{-1}AB)$ had an error of $10^{50}$.
However, most of the matrix inverse algorithms I looked at involved some types of decomposition, such as the QR decomposition, Singular value decomposition. Thus, the numerical error might propagate especially when the matrix entry ranged in large orders. But why their matrix algorithms were said to be stabler than Gauss–Jordan elimination?
What are other algorithms that can be used to compute for a large matrix with large entries, that do not have such issues?