# The stability of log(1+x)

I am trying to understand why the formula

$$\frac{\log(1+x)}{(1+x)-1} \times x,$$

which simply reduces down to $\log(1+x)$, is considered as more stable to compute than $\log(1+x)$. In my head it doesn't make sense to me as my brain automatically simplifies it to $\log(1+x)$, which I am guessing a computer doesn't do, but then why does adding in "extra" calculations make it more stable for the computer? My intuition would have been the opposite, the more calculations performed, the more error is introduced. Why is this not the case here?

You can just enter both formulas into a spreadsheet and compare with the Taylor polynomial ln (1 + x) = $x - x^2/2 + x^3/3 - x^4/4...$.
• @Aesir The error is from (1+x), which actually gives you (1+x'). log(1+x') itself is an accurate calculation. log(1+x') gives you $x'-x'^2/2+...$, so a factor of $x/x'$ makes it closer to $x-x^2/2+...$. Jan 9 '17 at 6:35