function compile( P, Q, options ) {
	var opts;
	var str;
	var n;

	opts = {
		'dtype': 'double',
		'name': 'evalrational',
		'suffix': ''
	};
	if ( arguments.length > 2 ) {
		opts.dtype = options.dtype || opts.dtype;
		opts.name = options.name || opts.name;
	}
	if ( opts.dtype === 'float' ) {
		opts.suffix = 'f';
	}
	n = P.length;

	// If no coefficients, the function always returns NaN...
	if ( n === 0 ) {
		str = replace( NAN_TEMPLATE, '{{dtype}}', opts.dtype );
		str = replace( str, '{{dtype_suffix}}', opts.suffix );
		return replace( str, '{{fname}}', opts.name );
	}
	// If P and Q have different lengths, the function always returns NaN...
	if ( n !== Q.length ) {
		str = replace( NAN_TEMPLATE, '{{dtype}}', opts.dtype );
		str = replace( str, '{{dtype_suffix}}', opts.suffix );
		return replace( str, '{{fname}}', opts.name );
	}
	// If P and Q only have one coefficient, the function always returns the ratio of those coefficients...
	if ( n === 1 ) {
		str = replace( COEFFICIENT_RATIO_TEMPLATE, '{{ratio}}', value2string( P[0] / Q[0] ) );
		str = replace( str, '{{dtype}}', opts.dtype );
		str = replace( str, '{{dtype_suffix}}', opts.suffix );
		return replace( str, '{{fname}}', opts.name );
	}
	// Avoid exceeding the maximum stack size on V8 by using a simple loop :(. Note that the choice of `500` was empirically determined...
	if ( n > 500 ) {
		str = replace( LOOP_TEMPLATE, '{{P}}', array2list( P ) );
		str = replace( str, '{{Q}}', array2list( Q ) );
		str = replace( str, '{{ratio}}', value2string( P[0] / Q[0] ) );
		str = replace( str, '{{num_coefficients}}', n.toString() );
		str = replace( str, '{{dtype}}', opts.dtype );
		str = replace( str, '{{dtype_suffix}}', opts.suffix );
		str = replace( str, '{{fname}}', opts.name );
		return replace( str, '{{FNAME}}', uppercase( opts.name ) );
	}
	// If more than one coefficient, apply Horner's method...
	str = replace( EVALRATIONAL_TEMPLATE, '{{P_ASCENDING}}', hornerAscending( P ) );
	str = replace( str, '{{Q_ASCENDING}}', hornerAscending( Q ) );
	str = replace( str, '{{P_DESCENDING}}', hornerDescending( P ) );
	str = replace( str, '{{Q_DESCENDING}}', hornerDescending( Q ) );
	str = replace( str, '{{ratio}}', value2string( P[0] / Q[0] ) );
	str = replace( str, '{{dtype}}', opts.dtype );
	str = replace( str, '{{dtype_suffix}}', opts.suffix );
	return replace( str, '{{fname}}', opts.name );
}
Compiles a C function string for evaluating a rational function.

@param {NumericArray} P - numerator polynomial coefficients sorted in ascending degree
@param {NumericArray} Q - denominator polynomial coefficients sorted in ascending degree
@param {Options} [options] - function options
@param {string} [options.dtype='double'] - input value floating-point data type
@param {string} [options.name='evalrational'] - function name
@returns {string} module string exporting a function for evaluating a rational function

@example
var P = [ -6.0, -5.0 ];
var Q = [ 3.0, 0.5 ];

var str = compile( P, Q );
// returns <string>