jax.numpy.arctan#

jax.numpy.arctan(x, /)[source]#

Compute element-wise inverse of trigonometric tangent of input.

JAX implement of numpy.arctan.

Parameters:

x (ArrayLike) – input array or scalar.

Returns:

An array containing the inverse trigonometric tangent of each element x in radians in the range [-pi/2, pi/2], promoting to inexact dtype.

Return type:

Array

Note

jnp.arctan follows the branch cut convention of numpy.arctan for complex inputs.

See also

Examples

>>> x = jnp.array([-jnp.inf, -20, -1, 0, 1, 20, jnp.inf])
>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.arctan(x)
Array([-1.571, -1.521, -0.785,  0.   ,  0.785,  1.521,  1.571], dtype=float32)

For complex-valued inputs:

>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.arctan(2+7j)
Array(1.532+0.133j, dtype=complex64, weak_type=True)