Rounding error of $\ln(1 + x)$

573 Views Asked by At

I am struggling to understand the theorem 4 in this article. From what I understood, the theorem indicates that since we lost precision in calculating $\ln(x+1)$ for small $x$, a more accurate way to calculate such an expression was suggested. I interpreted the given formula as:

Given that $x$ is a very small number, when adding $x$ to $1$ resulted in $1$, $\ln(1+x)$ is approximated to be equal to $x$, otherwise $\ln(1+x)$ is calculated using $\frac{x\ln(x+1)}{(1+x)-1}$. I don't understand how writing the expression as $\frac{x\ln(x+1)}{(1+x)-1}$ is helpful. What is the practical use of this theorem? Can anyone please help clarifying this theorem?

Thanks.

1

There are 1 best solutions below

6
On BEST ANSWER

You reported the theorem wrongly, the given formula was $$ \log_{improved}(1+x)=\begin{cases}x&\text{when } 1=1\oplus x\\\frac{x\log(1+x)}{(1+x)-1}&\text{else.}\end{cases} $$ that is, the enhanced formula is used for "medium" (and also "large") values of $x$ that do not vanish under addition of $1$.

As the the Taylor series is $$\ln(1+x)=x(1-x/2+x^2/3-x^3/4\pm\dots)$$ in the case $|x|<\mu$ or $1\oplus x=1$, the relative error between $x$ and $\ln(1+x)$ is smaller than $\mu$.

For the other case denote $\bar x=(1\oplus x)\ominus 1$, then the formula computes $$ \frac{x\log(1+\bar x)}{\bar x}=x(1-\bar x/2+\bar x^2/3-\bar x^3/4\pm\dots) $$ so that the relative error $$ \frac{x\log(1+\bar x)}{\bar x\log(1+x)}-1=\frac{1-\bar x/2+\bar x^2/3-\bar x^3/4\pm\dots}{1-x/2+x^2/3-x^3/4\pm\dots}-1 $$ is a multiple of $|x-\bar x|<\mu$.