Functions similar to Log but with results between 0 and 1

Sasha's suggestion of $f(x) = 1-\exp(-x)$ is good, but doesn't fit your example values too well, even if you scale $x$ appropriately. However, some other similar function, such as $f(x) = 1-1/(1+x)$, might work even better.


I like the hyperbolic tan (and it likes me) $$f(x) = \tanh(x) = \frac{e^x-e^{-x}}{e^x+e^{-x}} = \frac{e^{2x}-1}{e^{2x}+1} = 1 - \frac{2}{e^{2x}+1}$$

$f$ is strictly increasing and satisfies $f'(0) = 1$, $f(0) = 0$, $f(\infty) = 1$.

If you want to map $(-\infty, \infty)$ into $[0, 1)$ (instead of $[0, \infty)$), use $$f(x) = \frac{\tanh(x)+1}{2} = 1 - \frac{1}{e^{2x}+1}.$$

I have seen this called the "logistic" curve, or "s-shaped" curve.


If you want it to involve log, try $f(x) = 1 - \log(a)/\log(a+bx)$ for suitable positive numbers $a$ and $b$.

Tags:

Functions