2

To avoid the $\log()$ function, I am looking for a good approximation of $\log(x)$ for very small $x$ (e.g. order $10^{-5}$).

I think Taylor series expansion is useless because around these small $x$, the first order derivative approachs $+\infty$.

I did try this approximation $\log_{10}(x) \approx 1 - \frac{1}{\sqrt{x}}$ but still don't have satisfactory results.

Could anyone suggest some better approximations?

AlexTP
  • 264
  • 1
    $\frac{\ln x}{\ln 10}$ – gammatester Oct 27 '18 at 08:32
  • 1
    Since $\log 1/x=-\log x$, an approximation for very small $x$ would be the same as an approximation for very large $x$. – Aaron Oct 27 '18 at 08:36
  • @gammatester very funny. – AlexTP Oct 27 '18 at 08:41
  • @Aaron thanks for quick comment. However, as I said, I am trying to avoid the $\log()$ function. Can you please tell me the good approximation of $\log(x)$ for very large $x$? – AlexTP Oct 27 '18 at 08:42
  • This is not funny. It is an exact relation between $\log_{10}$ and $\ln$. Because $0$ is a logarithmic branch point of $\log_{10}$ other approximations make no sense (also not for large $x$). – gammatester Oct 27 '18 at 08:43
  • @gammatester I am sorry if my question was not clear, but I do not seek for at zero approximation, but the approximation which is good enough at small $x$. – AlexTP Oct 27 '18 at 08:45
  • Define good enough – gammatester Oct 27 '18 at 08:46
  • @AlexTP I don't know that there is a good approximation for very large $x$, but I am highly skeptical. My point was that it might seem like there was one for small $x$ because you're looking in a very tiny place, but if there were that approximation, there would also be a very very unlikely approximation too. – Aaron Oct 27 '18 at 08:46
  • @gammatester as I said in the question, better than $\log(x) \approx 1 - \frac{1}{\sqrt{x}}$. – AlexTP Oct 27 '18 at 08:47
  • 1
    Please see here: https://math.stackexchange.com/a/977657/471884. – ə̷̶̸͇̘̜́̍͗̂̄︣͟ Oct 27 '18 at 08:47
  • @TheSimpliFire thanks, I did not find this in the first search attempt. It seems my question is dupicated of that question. However, any new answer is welcomed. I will delete my question in a week if I do not receive any new answer. – AlexTP Oct 27 '18 at 08:50
  • @TheSimpliFire That is an approximation for $\log x$ if you already know $\lfloor \log x/\log 10 \rfloor$. I don't know if that would be considered cheating or not (as you can count the number of digits if you are given your number as a decimal, but you have a problem of equivalent difficulty to find the number of digits if you aren't presented the number in that form). I don't know the application, so I can't really say if that is a realistic assumption in the use case. – Aaron Oct 27 '18 at 08:53
  • Perhaps you should say why you would use an approximation. There are very few functions which are simpler than $\ln$. This should avoid a https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – gammatester Oct 27 '18 at 08:57
  • @gammatester I am trying to transform an equation to polynominal form. However, I do have another problem that I should keep the $\log$ function and approximate another function. I will ask it in a seperate post and link to this question. Thanks – AlexTP Oct 27 '18 at 09:26

3 Answers3

3

$$\ln x\sim\frac{1-x^{-x}}x\qquad{(x\to 0)}$$

or

$$\ln x\sim \frac{x^x-1}x$$


Since $x^x\approx 1$ for small $x$,

$$\ln x=\frac1x\ln x^x=\frac1x\ln(1+(x^x-1))\sim\frac{x^x-1}x$$

Szeto
  • 11,159
2

Since you seem to allow square roots, then the sequence of functions $\, f_n(x) := 2^n(\sqrt[2^n]{x}-1)\,$ give better and better results. In fact, $\, f_n(x) \to \ln(x)\,$ as $\, n \to \infty\,$ for all $\,x>0.\,$ Once you have $\,\ln(x)\,$ you can use $\, \log_{10}(x) = \frac{\ln(x)}{\ln(10)}.$

Somos
  • 35,251
  • 3
  • 30
  • 76
  • just stating that $$\ln(x)\approx x(x^\frac{1}{x}-1)$$ works for big $x$, at least on Wolfram-Alpha – Joako Mar 08 '24 at 06:38
1

Working in this another question I found that one could use this approximation: $$\ln(x) \approx \frac{\left(x^{\frac{1}{\ln(2)}}-1\right)}{x^{\frac{1}{\ln(2)}}}\ln(x+1)$$

From this you could use the Taylor's expansion of $\ln(x+1)$ at $x=0$. But from the plot looks it works only for $x>0.4$ and I don't think it going to match the exact values as the order increases (with the exact functions it fails), but at least works better than the Taylor's expansion of $\ln(x)$ at $x=1$ near $x=0$.

(see the plot here).

Taylor expansion approximation

Joako
  • 1,380