The sigmoid function is defined as
I found that using the C built-in function exp() to calculate the value of f(x) is slow. Is th
exp()
f(x)
You can also use this:
y=x / (2 * (x<0.0?-x:x) + 2) + 0.5; y'=y(1-y);
acts like a sigmoid now because y(1-y)=y' is more let say round than 1/(2 (1 + abs(x))^2) acts more like to fast sigmoid;