mech-math 0.3.4

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

%% Inverse hyperbolic tangent of argument

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

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

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

Computes the inverse hyperbolic tangent (area hyperbolic tangent) of each 
element of `X`. The result is real only for inputs in the interval (-1, 1).

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

| Argument | Kind               | Description                                         |
|----------|--------------------|-----------------------------------------------------|
| `X`      | `float`, `[float]` | Input value(s). Must lie in (-1, 1) for real result. |

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

| Argument | Kind          | Description                                               |
|----------|---------------|-----------------------------------------------------------|
| `Y`      | matches input | Result of computing the inverse hyperbolic tangent of `X`. |

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

(a) Compute atanh of a number

```mech:ex1
y := math/atanh(0.5)
```

(b) Compute atanh for a vector

```mech:ex2
x := [0.1, 0.5, -0.9]
y := math/atanh(x)
```

(c) Compute atanh for a matrix

```mech:ex3
x := [0.1, 0.2; 0.3, 0.4]
y := math/atanh(x)
```

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

The inverse hyperbolic tangent is mathematically defined as:

$$ atanh(x) = \frac{1}{2} \ln \left( \frac{1+x}{1-x} \right)

It is the inverse of the hyperbolic tangent function `tanh(x)`.  
- The domain for real values is: $x \in (-1, 1)$.  
- The range for real values is: $(-\infty, \infty)$.

For inputs outside this interval, the result may be complex, which is not 
supported in the current implementation.