function factory( k, lambda ) {
	if (
		isnan( k ) ||
		isnan( lambda ) ||
		k <= 0.0 ||
		lambda <= 0.0
	) {
		return constantFunction( NaN );
	}
	return mgf;

	/**
	* Evaluates the moment-generating function (MGF) for a Weibull distribution.
	*
	* @private
	* @param {number} t - input value
	* @returns {number} evaluated MGF
	*
	* @example
	* var y = mgf( 0.5 );
	* // returns <number>
	*/
	function mgf( t ) {
		var summand;
		var sum;
		var c;
		var n;

		if ( isnan( t ) ) {
			return NaN;
		}
		sum = 1.0;
		c = 1.0;
		n = 0;
		do {
			n += 1;
			c *= ( t * lambda ) / n;
			if ( c === 0.0 ) {
				summand = 0.0;
			} else {
				summand = c * gamma( 1.0 + (n / k) );
			}
			sum += summand;
		} while ( summand / sum > EPS );
		return sum;
	}
}
Returns a function for evaluating the moment-generating function (MGF) of a Weibull distribution with shape `k` and scale `lambda`.

@param {PositiveNumber} k - shape parameter
@param {PositiveNumber} lambda - scale parameter
@returns {Function} MGF

@example
var mgf = factory( 8.0, 10.0 );

var y = mgf( 0.8 );
// returns ~3150.149

y = mgf( 0.08 );
// returns ~2.137