The power grid model uses a modified backward error calculation to prevent rounding errors in single rows from causing iterative refinement to fail. The calculation uses a denominator cap determined by a parameter $\epsilon$.
To ensure numerical stability, $\epsilon$ should be chosen to be small, but large enough to suppress numerical instabilities.
- $\epsilon = 0$: No cut-off is applied. This is prone to rounding errors.
- $\epsilon = 1$: Only the absolute values of the residuals are relevant (relative values are ignored). This may hide issues in rows with small coefficients by suppressing them in the backward error, potentially favoring rows with larger absolute but smaller relative residuals.
Mathematical Formula:
$$ \begin{aligned} D_{\text{max}} &= \max_i\left{
\left(\left|\mathbf{M}\right|\cdot\left|\boldsymbol{x}\right| + \left|\boldsymbol{b}\right|\right)_i
\right} \
\text{backward_error} &= \max_i \left{
\frac{|\boldsymbol{r}|i}{ \max\left{
\left(\left|\mathbf{M}\right|\cdot\left|\boldsymbol{x}\right| + \left|\boldsymbol{b}\right|\right)i,
\epsilon{\text{backward_error}} D{\text{max}}
\right}
\right}
\end{aligned} $$