function logcdf( x, mu, sigma ) {
	var z;
	if (
		isnan( x ) ||
		isnan( mu ) ||
		isnan( sigma ) ||
		sigma < 0.0
	) {
		return NaN;
	}
	if ( sigma === 0.0 ) {
		return (x < mu) ? NINF : 0.0;
	}
	z = ( x - mu ) / sigma;
	if ( z < -1.0 ) {
		return ln( erfcx( -z * INV_SQRT_TWO ) / 2.0 ) - ( abs2(z) / 2.0 );
	}
	// Case: z >= -1.0:
	return log1p( -erfc( z * INV_SQRT_TWO ) / 2.0 );
}
Evaluates the natural logarithm of 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 {number} logarithm of cumulative distribution function

@example
var y = logcdf( 2.0, 0.0, 1.0 );
// returns ~-0.023

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

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

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

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

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

@example
var y = logcdf( 2.0, 8.0, 0.0 );
// returns -Infinity

@example
var y = logcdf( 8.0, 8.0, 0.0 );
// returns 0.0