function nearzero( n, x ) {
	var factorialPart;
	var prefix;
	var scale;
	var term;
	var sum;
	var AX;
	var k;

	// In order to avoid spurious overflow, save the `n!` term for later, and rescale at the end:
	scale = factorial( n );

	// "factorialPart" contains everything except the zeta function evaluations in each term:
	factorialPart = 1;

	// "prefix" is what we'll be adding the accumulated sum to, it will be `n! / z^(n+1)`, but since we're scaling by `n!` it is just `1 / z^(n+1)` for now:
	prefix = pow( x, n+1 );
	if ( prefix === 0.0 ) {
		return PINF;
	}
	prefix = 1.0 / prefix;

	// First term in the series is necessarily `< zeta(2) < 2`, so ignore the sum if it will have no effect on the result:
	if ( prefix > 2.0/EPS ) {
		if ( n & 1 ) {
			return ( AX/prefix < scale ) ? PINF : prefix * scale;
		}
		return ( AX/prefix < scale ) ? NINF : -prefix * scale;
	}
	sum = prefix;
	for ( k = 0; ; ) {
		// Get the k'th term:
		term = factorialPart * zeta( k+n+1 );
		sum += term;

		// Termination condition:
		if ( abs( term ) < abs(sum * EPS ) ) {
			break;
		}
		// Move on `k` and `factorialPart`:
		k += 1;
		factorialPart *= (-x * (n+k)) / k;

		// Last chance exit:
		if ( k > MAX_SERIES_ITERATIONS ) {
			debug( 'Series did not converge, best value is %d.', sum );
			return NaN;
		}
	}
	// We need to multiply by the scale, at each stage checking for overflow:
	if ( MAX/scale < sum ) {
		return PINF;
	}
	sum *= scale;
	return ( n & 1 ) ? sum : -sum;
}
Evaluates the polygamma function near zero.

## Notes

-   If we take this [expansion][1] for `polygamma` and substitute in this [expression][2] for `polygamma(n, 1)`, we get an alternating series for polygamma when `x` is small in terms of zeta functions of integer arguments (which are easy to evaluate, at least when the integer is even).

[1]: http://functions.wolfram.com/06.15.06.0003.02
[2]: http://functions.wolfram.com/06.15.03.0009.01

@private
@param {PositiveInteger} n - derivative to evaluate
@param {number} x - input value
@returns {number} (n+1)'th derivative