# xarray.ufuncs.sinh

### xarray.ufuncs.sinh *= <xarray.ufuncs._unary_ufunc object>*

xarray specific variant of `numpy.sinh()`. Handles xarray objects by dispatching to the appropriate function for the underlying array type.

Documentation from numpy:

Hyperbolic sine, element-wise.

Equivalent to `1/2 * (np.exp(x) - np.exp(-x))` or
`-1j * np.sin(1j*x)`.

* **Parameters:**
  * **x** ([array_like](https://numpy.org/doc/stable/glossary.html#term-array_like)) – Input array.
  * **out** ([`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray), [`None`](https://docs.python.org/3/builtins/constants.html#None), or [`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple) of [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) and [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – A location into which the result is stored. If provided, it must have
    a shape that the inputs broadcast to. If not provided or None,
    a freshly-allocated array is returned. A tuple (possible only as a
    keyword argument) must have length equal to the number of outputs.
  * **where** ([array_like](https://numpy.org/doc/stable/glossary.html#term-array_like), *optional*) – This condition is broadcast over the input. At locations where the
    condition is True, the out array will be set to the ufunc result.
    Elsewhere, the out array will retain its original value.
    Note that if an uninitialized out array is created via the default
    `out=None`, locations within it where the condition is False will
    remain uninitialized.
  * **\*\*kwargs** – For other keyword-only arguments, see the
    [ufunc docs](https://numpy.org/doc/stable/reference/ufuncs.html#ufuncs-kwargs).
* **Returns:**
  **y** ([`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) – The corresponding hyperbolic sine values.
  This is a scalar if x is a scalar.

### Notes

If out is provided, the function writes the result into it,
and returns a reference to out.  (See Examples)

### References

M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions.
New York, NY: Dover, 1972, pg. 83.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('db26aacb-6fb1-4076-9dbd-26d160e077a6','e023cda0-641a-4945-b0c2-106fc868b416','4c4259fd-249d-43c7-b9ad-a13d5ec6eca6','../lite/tree/../notebooks/index.html?path=ea106c1a_26a6_43a4_8686_94f6a8d9a9fd.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> import numpy as np
>>> np.sinh(0)
0.0
>>> np.sinh(np.pi*1j/2)
1j
>>> np.sinh(np.pi*1j) # (exact value is 0)
1.2246063538223773e-016j
>>> # Discrepancy due to vagaries of floating point arithmetic.
```

```pycon
>>> # Example of providing the optional output parameter
>>> out1 = np.array([0], dtype=np.float64)
>>> out2 = np.sinh([0.1], out1)
>>> out2 is out1
True
```

```pycon
>>> # Example of ValueError due to provision of shape mis-matched `out`
>>> np.sinh(np.zeros((3,3)),np.zeros((2,2)))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: operands could not be broadcast together with shapes (3,3) (2,2)
```

<div id="4c4259fd-249d-43c7-b9ad-a13d5ec6eca6" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('db26aacb-6fb1-4076-9dbd-26d160e077a6','4c4259fd-249d-43c7-b9ad-a13d5ec6eca6')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('db26aacb-6fb1-4076-9dbd-26d160e077a6','4c4259fd-249d-43c7-b9ad-a13d5ec6eca6')">Open In Tab</button></div><div id="e023cda0-641a-4945-b0c2-106fc868b416" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
