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:
Note
jnp.arctan
follows the branch cut convention ofnumpy.arctan
for complex inputs.See also
jax.numpy.tan()
: Computes a trigonometric tangent of each element of input.jax.numpy.arcsin()
andjax.numpy.asin()
: Computes the inverse of trigonometric sine of each element of input.jax.numpy.arccos()
andjax.numpy.atan()
: Computes the inverse of trigonometric cosine of each element of input.
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)