function pmf( x, r, p ) {
	if (
		isnan( x ) ||
		isnan( r ) ||
		isnan( p ) ||
		r <= 0.0 ||
		p <= 0.0 ||
		p > 1.0
	) {
		return NaN;
	}
	if ( !isNonNegativeInteger( x ) || p === 0.0 ) {
		return 0.0;
	}
	return ( p / ( r + x ) ) * ibetaDerivative( p, r, x + 1.0 );
}
Evaluates the probability mass function (PMF) for a negative binomial distribution with number of successes until experiment is stopped `r` and success probability `p`.

@param {number} x - input value
@param {PositiveNumber} r - number of successes until experiment is stopped
@param {Probability} p - success probability
@returns {Probability} evaluated PMF

@example
var y = pmf( 5.0, 20.0, 0.8 );
// returns ~0.157

@example
var y = pmf( 21.0, 20.0, 0.5 );
// returns ~0.06

@example
var y = pmf( 5.0, 10.0, 0.4 );
// returns ~0.016

@example
var y = pmf( 0.0, 10.0, 0.9 );
// returns ~0.349

@example
var y = pmf( 21.0, 15.5, 0.5 );
// returns ~0.037

@example
var y = pmf( 5.0, 7.4, 0.4 );
// returns ~0.051

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

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

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

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

@example
var y = pmf( NaN, 20.0, 0.5 );
// returns NaN

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

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