A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.cosh.html below:

jax.numpy.cosh — JAX documentation

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

Calculate element-wise hyperbolic cosine of input.

JAX implementation of numpy.cosh.

The hyperbolic cosine is defined by:

\[cosh(x) = \frac{e^x + e^{-x}}{2}\]

Parameters:

x (ArrayLike) – input array or scalar.

Returns:

An array containing the hyperbolic cosine of each element of x, promoting to inexact dtype.

Return type:

Array

Note

jnp.cosh is equivalent to computing jnp.cos(1j * x).

Examples

>>> x = jnp.array([[3, -1, 0],
...                [4, 7, -5]])
>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.cosh(x)
Array([[ 10.068,   1.543,   1.   ],
       [ 27.308, 548.317,  74.21 ]], dtype=float32)
>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.cos(1j * x)
Array([[ 10.068+0.j,   1.543+0.j,   1.   +0.j],
       [ 27.308+0.j, 548.317+0.j,  74.21 +0.j]],      dtype=complex64, weak_type=True)

For complex-valued input:

>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.cosh(5+1j)
Array(40.096+62.44j, dtype=complex64, weak_type=True)
>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.cos(1j * (5+1j))
Array(40.096+62.44j, dtype=complex64, weak_type=True)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3