How to correctly compute entropy near zero

66 Views Asked by At

I want to compute the function $f(x) = -x \log x$. AFAIK, if we postulate the extension $f(0) = 0$, then $f(x)$ is a monotonically increasing function on the interval $x \in [0, e^{-1}]$. What is the correct approach to numerically calculate $f(\epsilon)$ where $\epsilon$ is a small number? It seems that series expansion of $f(x)$ around $x=0$ does not behave well...

1

There are 1 best solutions below

1
On

Hint:

  • We have the indeterminate form $0 \cdot \infty$
  • Let $t = \dfrac{1}{x}$ and now change the limit to use $t \rightarrow \infty$.

What do you get and what can you use?