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)
I don't think you can do better than the built-in exp() but if you want another approach, you can use series expansion. WolframAlpha can compute it for you.