mech-math 0.3.3

Math library for the Mech language
Documentation
math/cosh
===============================================================================

%% Hyperbolic cosine of argument

1. Usage
-------------------------------------------------------------------------------

```mech:disabled
Y := math/cosh(X)
```

2. Description
-------------------------------------------------------------------------------

Computes the hyperbolic cosine of each element of `X`. The input `X` is interpreted as a real or complex number. The result `Y` has the same shape as the input `X`.

3. Input
-------------------------------------------------------------------------------

| Argument | Kind                     | Description                           |
|----------|--------------------------|---------------------------------------|
| `X`      | `float`, `[float]`       | Input value(s), real or complex. If `X` is complex, cosh returns complex results. |

4. Output
-------------------------------------------------------------------------------

| Argument | Kind                     | Description                           |
|----------|--------------------------|---------------------------------------|
| `Y`      | matches input            | Hyperbolic cosine of the input values. For real `X`, the output is always real and greater than or equal to 1. For complex `X`, the output may have both real and imaginary parts. The shape of `Y` matches the shape of `X`. |

5. Examples  
-------------------------------------------------------------------------------

(a) Find the hyperbolic cosine of a number 

```mech:ex1
y := math/cosh(1.0)
```

(b) Find the hyperbolic cosine for a vector of numbers

```mech:ex2
x := [0, 1, 2]
y := math/cosh(x)
```

(c) Find the hyperbolic cosine for a matrix of numbers

```mech:ex3
x := [0, 1; 2, 3]
y := math/cosh(x)
```

6. Details
-------------------------------------------------------------------------------

The hyperbolic cosine function is defined as:

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

It is one of the basic hyperbolic functions, closely related to the exponential function.

Unlike the trigonometric cosine, which oscillates between -1 and 1, the hyperbolic cosine grows rapidly for large values of $$x$$ and is always greater than or equal to 1 for real inputs.

For complex numbers, the definition using exponentials extends naturally, making the function applicable to both real and complex domains.