TITLE: Functions similar to Log but with results between 0 and 1
QUESTION [23 upvotes]: I need a function similar to Log but it should produce numbers between 0 and 1
Something like:

f(0)=0
f(1)=0.1
f(2)=0.15
f(3)=0.17
f(100)=0.8
f(1000)=0.95
f(1000000000)=0.99999999

I need this in my program that I am programming and I can use only standard functions like log, exp, etc... Any help would be appreciated.

REPLY [8 votes]: 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.