jax.numpy.sinh
Contents
jax.numpy.sinh#
- jax.numpy.sinh(x,/)[source]#
Calculate element-wise hyperbolic sine of input.
JAX implementation of
numpy.sinh.The hyperbolic sine is defined by:
\[sinh(x) = \frac{e^x - e^{-x}}{2}\]- Parameters:
x (ArrayLike) – input array or scalar.
- Returns:
An array containing the hyperbolic sine of each element of
x, promotingto inexact dtype.- Return type:
Note
jnp.sinhis equivalent to computing-1j*jnp.sin(1j*x).See also
jax.numpy.cosh(): Computes the element-wise hyperbolic cosine of theinput.jax.numpy.tanh(): Computes the element-wise hyperbolic tangent of theinput.jax.numpy.arcsinh(): Computes the element-wise inverse of hyperbolicsine of the input.
Examples
>>>x=jnp.array([[-2,3,5],...[0,-1,4]])>>>withjnp.printoptions(precision=3,suppress=True):...jnp.sinh(x)Array([[-3.627, 10.018, 74.203], [ 0. , -1.175, 27.29 ]], dtype=float32)>>>withjnp.printoptions(precision=3,suppress=True):...-1j*jnp.sin(1j*x)Array([[-3.627+0.j, 10.018-0.j, 74.203-0.j], [ 0. -0.j, -1.175+0.j, 27.29 -0.j]], dtype=complex64, weak_type=True)
For complex-valued input:
>>>withjnp.printoptions(precision=3,suppress=True):...jnp.sinh(3-2j)Array(-4.169-9.154j, dtype=complex64, weak_type=True)>>>withjnp.printoptions(precision=3,suppress=True):...-1j*jnp.sin(1j*(3-2j))Array(-4.169-9.154j, dtype=complex64, weak_type=True)
Contents
