function factory( p ) {
	if ( !isProbability( p ) ) {
		return constantFunction( NaN );
	}
	return mgf;

	/**
	* Evaluates the moment-generating function (MGF) for a geometric distribution.
	*
	* @private
	* @param {number} t - input value
	* @returns {number} evaluated MGF
	*
	* @example
	* var y = mgf( 0.5 );
	* // returns <number>
	*/
	function mgf( t ) {
		var et;
		var q;
		if ( isnan( t ) ) {
			return NaN;
		}
		q = 1.0 - p;
		if ( t >= -ln( q ) ) {
			return NaN;
		}
		et = exp( t );
		return ( p * et ) / ( 1.0 - (q * et ));
	}
}
Returns a function for evaluating the moment-generating function (MGF) of a geometric distribution with success probability `p`.

@param {Probability} p - success probability
@returns {Function} MGF

@example
var mgf = factory( 0.8 );
var y = mgf( -0.2 );
// returns ~0.783