Standard normal cumulative probability distribution.
double stdNormalCdf(num x) { return 1.0 - 0.5 * erfc(x * invSqrt2); //return 0.5 + 0.5 * erf(x * invSqrt2); }