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, promoting to inexact dtype.

Return type:

Array

Note

jnp.sinh is equivalent to computing -1j * jnp.sin(1j * x).

See also

Examples

>>> x = jnp.array([[-2, 3, 5],
...                [0, -1, 4]])
>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.sinh(x)
Array([[-3.627, 10.018, 74.203],
       [ 0.   , -1.175, 27.29 ]], dtype=float32)
>>> with jnp.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:

>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.sinh(3-2j)
Array(-4.169-9.154j, dtype=complex64, weak_type=True)
>>> with jnp.printoptions(precision=3, suppress=True):
...   -1j * jnp.sin(1j * (3-2j))
Array(-4.169-9.154j, dtype=complex64, weak_type=True)