function logpmf( x, n, p ) {
	var out;
	if (
		isnan( x ) ||
		isnan( n ) ||
		isnan( p ) ||
		p < 0.0 ||
		p > 1.0 ||
		!isNonNegativeInteger( n ) ||
		n === PINF
	) {
		return NaN;
	}
	if ( isNonNegativeInteger( x ) ) {
		if ( x > n ) {
			return NINF;
		}
		if ( p === 0.0 ) {
			return ( x === 0 ) ? 0.0 : NINF;
		}
		if ( p === 1.0 ) {
			return ( x === n ) ? 0.0 : NINF;
		}
		out = binomcoefln( n, x );
		out += (x * ln( p )) + (( n - x ) * log1p( -p ));
		return out;
	}
	return NINF;
}
Evaluates the natural logarithm of the probability mass function (PMF) for a binomial distribution with number of trials `n` and success probability `p` at a value `x`.

@param {number} x - input value
@param {NonNegativeInteger} n - number of trials
@param {Probability} p - success probability
@returns {number} evaluated logPMF

@example
var y = logpmf( 3.0, 20, 0.2 );
// returns ~-1.583

@example
var y = logpmf( 21.0, 20, 0.2 );
// returns -Infinity

@example
var y = logpmf( 5.0, 10, 0.4 );
// returns ~-1.606

@example
var y = logpmf( 0.0, 10, 0.4 );
// returns ~-5.108

@example
var y = logpmf( NaN, 20, 0.5 );
// returns NaN

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

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

@example
var y = logpmf( 2.0, 1.5, 0.5 );
// returns NaN

@example
var y = logpmf( 2.0, -2.0, 0.5 );
// returns NaN

@example
var y = logpmf( 2.0, 20, -1.0 );
// returns NaN

@example
var y = logpmf( 2.0, 20, 1.5 );
// returns NaN