function cdf( x, mu, sigma ) {
	var denom;
	var xc;
	if (
		isnan( x ) ||
		isnan( mu ) ||
		isnan( sigma ) ||
		sigma < 0.0
	) {
		return NaN;
	}
	if ( sigma === 0.0 ) {
		return (x < mu) ? 0.0 : 1.0;
	}
	denom = sigma * sqrt( 2.0 );
	xc = x - mu;
	return 0.5 * erfc( -xc/denom );
}
Evaluates the cumulative distribution function (CDF) for a Normal distribution with mean `mu` and standard deviation `sigma` at a value `x`.

@param {number} x - input value
@param {number} mu - mean
@param {NonNegativeNumber} sigma - standard deviation
@returns {Probability} evaluated cumulative distribution function

@example
var y = cdf( 2.0, 0.0, 1.0 );
// returns ~0.977

@example
var y = cdf( -1.0, -1.0, 2.0 );
// returns 0.5

@example
var y = cdf( -1.0, 4.0, 2.0 );
// returns ~0.006

@example
var y = cdf( NaN, 0.0, 1.0 );
// returns NaN

@example
var y = cdf( 0.0, NaN, 1.0 );
// returns NaN

@example
var y = cdf( 0.0, 0.0, NaN );
// returns NaN

@example
// Negative standard deviation:
var y = cdf( 2.0, 0.0, -1.0 );
// returns NaN