best constant $\mu$ for $\log_2(1+x)\approx x+\mu$

118 Views Asked by At

I was recently reading about the fast inverse square root algorithm, and in one step it uses the approximation $$ \log_2(1+x)\approx x $$ for $x\in[0,1]$. this approximation can be made better by adding a constant term $\mu$ $$\log_2(1+x)\approx x+\mu$$ apparently the optimal constant is $\mu \approx0.043$. I am looking for a derivation of this constant. I tried minimizing a few measurements of error myself, however I never got the expected value.

Any help would be appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

Here we'll compute the best uniform approximation by a constant $\mu$ of $f(x) := \log_2(1+x) - x$ on $0 \leq x \leq 1$, that is $f(x) \approx \mu$. The shape of $f$ shows that, for any constant $c$, $f - c$ will have three extrema, two at the endpoints and one internal. With the approximation $f \approx \mu$, the error at both endpoints is $-\mu$ and at the (unknown) internal point $\xi$, $\log_2(1+\xi) - \xi - \mu$.

By the equioscillation theorem, the best approximation has extrema equal in magnitude but of alternating signs, in this case: \begin{equation*} \log_2(1 + \xi) - \xi - \mu = (-1)(-\mu), \end{equation*} thus $\mu = \frac{1}{2}\log_2(1 + \xi) - \frac{1}{2}\xi$. The internal extremum occurs where the derivative of $f(\xi) - \mu$ vanishes, and a bit of calculation shows this is at $\xi = 1/\log 2 - 1$. From this we get $\mu = 0.043035666$.