Returns the value at X of a Gaussian distribution with standard deviation S.
double gauss(double x, double s) { // 2.5066282746310005 is sqrt(2*pi) return math.exp(-0.5 * x*x / (s*s)) / (s * 2.5066282746310005); }