function factory( c ) {
	var f;
	var n;
	var m;
	var i;

	// Explicitly copy in order to ensure single-precision:
	c = new Float32Array( c );

	// Avoid exceeding the maximum stack size on V8 :(. Note that the choice of `500` was empirically determined...
	if ( c.length > 500 ) {
		return polyval;
	}
	// Code generation. Start with the function definition...
	f = 'return function evalpolyf(x){';

	// Create the function body...
	n = c.length;

	// If no coefficients, the function always returns 0...
	if ( n === 0 ) {
		f += 'return 0.0;';
	}
	// If only one coefficient, the function always returns that coefficient...
	else if ( n === 1 ) {
		f += 'return ' + c[ 0 ] + ';';
	}
	// If more than one coefficient, apply Horner's method...
	else {
		// If `x == 0`, return the first coefficient...
		f += 'if(x===0.0){return ' + c[ 0 ] + ';}';

		// Otherwise, evaluate the polynomial...
		f += 'return f64_to_f32(' + c[ 0 ];
		m = n - 1;
		for ( i = 1; i < n; i++ ) {
			f += '+f64_to_f32(x*';
			if ( i < m ) {
				f += 'f64_to_f32(';
			}
			f += c[ i ];
		}
		// Close all the parentheses...
		for ( i = 0; i < 2*m; i++ ) {
			f += ')';
		}
		f += ';';
	}
	// Close the function:
	f += '}';

	// Add a source directive for debugging:
	f += '//# sourceURL=evalpolyf.factory.js';

	// Create the function in the global scope:
	return ( new Fcn( 'f64_to_f32', f ) )( float64ToFloat32 );

	/*
	*    function evalpolyf( x ) {
	*        if ( x === 0.0 ) {
	*            return c[ 0 ];
	*        }
	*        return f64_to_f32(c[0]+f64_to_f32(x*f64_to_f32(c[1]+f64_to_f32(x*f64_to_f32(c[2]+f64_to_f32(x*f64_to_f32(c[3]+...+f64_to_f32(x*f64_to_f32(c[n-2]+f64_to_f32(x*c[n-1]))))))))));
	*    }
	*/

	/**
	* Evaluates a polynomial.
	*
	* @private
	* @param {number} x - value at which to evaluate a polynomial
	* @returns {number} evaluated polynomial
	*/
	function polyval( x ) {
		return evalpolyf( c, x );
	}
}
Generates a function for evaluating a polynomial using single-precision floating-point arithmetic.

## Notes

-   The compiled function uses [Horner's rule][horners-method] for efficient computation.

[horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method

@param {NumericArray} c - polynomial coefficients sorted in ascending degree
@returns {Function} function for evaluating a polynomial

@example
var Float32Array = require( '@stdlib/array/float32' );

var polyval = factory( new Float32Array( [ 3.0, 2.0, 1.0 ] ) );

var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2
// returns 123.0

v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2
// returns 38.0