function mgf( t, r, p ) {
	if (
		isnan( t ) ||
		isnan( r ) ||
		isnan( p ) ||
		r <= 0.0 ||
		p < 0.0 ||
		p > 1.0 ||
		t >= -ln( p )
	) {
		return NaN;
	}
	return pow( ( (1.0 - p) * exp( t ) ) / ( 1.0 - (p * exp( t )) ), r );
}
Evaluates the moment-generating function (MGF) for a negative binomial distribution.

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

@example
var y = mgf( 0.05, 20.0, 0.8 );
// returns ~267.839

@example
var y = mgf( 0.1, 20.0, 0.1 );
// returns ~9.347

@example
var y = mgf( 0.5, 10.0, 0.4 );
// returns ~42822.023

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

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

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

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

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

@example
var y = mgf( 0.2, 20, -1.0 );
// returns NaN

@example
var y = mgf( 0.2, 20, 1.5 );
// returns NaN