Move sigmoid function to math.js