jax.numpy.sin#
- jax.numpy.sin(x, /)[source]#
Compute a trigonometric sine of each element of input.
JAX implementation of
numpy.sin
.- Parameters:
x (ArrayLike) – array or scalar. Angle in radians.
- Returns:
An array containing the sine of each element in
x
, promotes to inexact dtype.- Return type:
See also
jax.numpy.cos()
: Computes a trigonometric cosine of each element of input.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.
Examples
>>> pi = jnp.pi >>> x = jnp.array([pi/4, pi/2, 3*pi/4, pi]) >>> with jnp.printoptions(precision=3, suppress=True): ... print(jnp.sin(x)) [ 0.707 1. 0.707 -0. ]