I've got a division of the sort
$$\frac{a}{a+b}$$
which is for some reason rewritten as $$\frac{1}{1+\frac{b}{a}}$$ for numerical stability. But why would this be more stable and how do they rewrite the first formula into the second one?
I've got a division of the sort
$$\frac{a}{a+b}$$
which is for some reason rewritten as $$\frac{1}{1+\frac{b}{a}}$$ for numerical stability. But why would this be more stable and how do they rewrite the first formula into the second one?
$$\frac a{a+b}=\frac a{a+b}\cdot \dfrac {\frac 1a}{\frac 1a}=\frac 1{1+\frac ba}$$ I don't see any reason the two forms should differ in numerical stability. The usual problem is subtraction of two nearly equal quantities, so here if $a \approx -b$ you have a problem. The division of the numerator and denominator by $a$ does not change that because then $\frac ba \approx -1$.