mech-math 0.3.3

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

%% Square Root

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

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

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

Computes the non-negative square root elementwise:

$$ y = \sqrt{x} 

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

| Argument | Kind                         | Description |
|----------|------------------------------|-------------|
| `X`      | `float`, `[float]`, `matrix` | Real-valued input(s). Scalars (`f64`, `f32`) and their vector/matrix forms. Must be non-negative. |

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

| Argument | Kind             | Description |
|----------|------------------|-------------|
| `Y`      | matches input    | Square root of `X`, elementwise. Shape and precision match the input. |

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

(a) Scalar value

```mech:ex1
y := math/sqrt(9.0)            
```

(b) Vector input

```mech:ex2
x := [0.0, 1.0, 4.0, 9.0]
y := math/sqrt(x)               
```

(c) Matrix input

```mech:ex3
x := [1.0, 4.0; 9.0, 16.0]
y := math/sqrt(x)               
```

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

- **Definition:** $$ y = \sqrt{x} $$
- **Domain:** Requires $$ x \geq 0 $$ for real results.  
- **Special values:**
  - $$ \sqrt{0} = 0 $$
  - $$ \sqrt{1} = 1 $$
  - $$ \sqrt{+\infty} = +\infty $$
- **NaN:** If `x < 0` or `NaN`, the result is `NaN`.

7. Notes for Implementers
-------------------------------------------------------------------------------

Backed by Rust/libm `sqrt` (f64) and `sqrtf` (f32). Dispatch covers scalar,
vector, and matrix forms. Operates elementwise with consistent shape and type.

8. See also
-------------------------------------------------------------------------------

`math/pow`, `math/log`