I have numerical difficulties with the function $$x\ln(x/x_0)-x+x_0$$ with $x\ge0$ and $x_0>0$ since it bears the evil evaluation of $\ln(x)$ for $x\rightarrow0$ which is the domain of interest for my numerical application. I am thus looking for a approximate function that :
- is numerically stable for $x$ in the range of (at least) $[0,x_{max}]$, with $x_{max}$ a physical property that is real and strictly positive, say between 5 and 20, usually 10.
- has controllable error (for instance by systematically improving the approximation by increasing some order, like in a series expansion)
- must be derivable.
- must not be indetermined for $x=0$.
- must contain only one minima, like the original function.
If that can be of any help, $x_0>0$ is usually of the order of 0.033.
I tested Series expansions and Padé approximants but none fill my requirements.
I think the $-x+x_0$ part is of no-importance in all of this.
I would really love some help. Thanks!
If $x > 0$ and $b^{-n} \le x < b^{-n+1} $, where $b$ can be any of $e, 2, 10,$ or otherwise depending on your inclination, since $x = b^{-n}c$ where $1 \le c < b$, we have $\ln(x) =-n\ln(b)+\ln(c) $.