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}\]
x (ArrayLike) – input array or scalar.
An array containing the hyperbolic cosine of each element of x
, promoting to inexact dtype.
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