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)
The tanh function may be optimized in some languages, making it faster than a custom defined x/(1+abs(x)), such is the case in Julia.