function atan( x ) {
	var flg;
	var sgn;
	var y;
	var z;
	if ( isnan( x ) || x === 0.0 ) {
		return x;
	}
	if ( x === PINF ) {
		return PIO2;
	}
	if ( x === NINF ) {
		return -PIO2;
	}
	if ( x < 0.0 ) {
		sgn = true;
		x = -x;
	}
	// Range reduction:
	flg = 0;
	if ( x > T3P8 ) {
		y = PIO2;
		flg = 1;
		x = -( 1.0/x );
	} else if ( x <= 0.66 ) {
		y = 0.0;
	} else {
		y = PIO4;
		flg = 2;
		x = (x-1.0) / (x+1.0);
	}
	z = x * x;
	z = z*polyvalP( z ) / polyvalQ( z );
	z = ( x*z ) + x;
	if ( flg === 2 ) {
		z += 0.5 * MOREBITS;
	} else if ( flg === 1 ) {
		z += MOREBITS;
	}
	y += z;
	return ( sgn ) ? -y : y;
}
Computes the arctangent of a double-precision floating-point number.

## Method

-   Range reduction is from three intervals into the interval from 0 to 0.66. The approximant uses a rational function of degree 4/5 of the form

    ```tex
    x + x^3 \frac{P(x)}{Q(x)}
    ```

## Notes

-   Relative error:

    | arithmetic | domain  | # trials | peak    | rms     |
    |:-----------|:--------|:---------|:--------|:--------|
    | DEC        | -10, 10 | 50000    | 2.4e-17 | 8.3e-18 |
    | IEEE       | -10, 10 | 10^6     | 1.8e-16 | 5.0e-17 |

@param {number} x - input value
@returns {number} arctangent (in radians)

@example
var v = atan( 0.0 );
// returns ~0.0

@example
var PI = require( '@stdlib/constants/float64/pi' );

var v = atan( -PI/4.0 );
// returns ~-0.666

@example
var PI = require( '@stdlib/constants/float64/pi' );

var v = atan( PI/4.0 );
// returns ~0.666

@example
var v = atan( NaN );
// returns NaN