## Presentation

The engine is based on incremental computation algorithms. When a calculation is submitted to the engine, all the computed values are memorized. So, if you change some variable and query an evaluation, the engine is able to compute the result very fast because it recomputes only what has changed.

## Libraries

The project provides several libraries that each comes with dozens of operators. Please note the cross-compatibility of the libraries.

- @compute.ts/boolean
- @compute.ts/number
- @compute.ts/string
- @compute.ts/date
- @compute.ts/dictionary
- @compute.ts/array
- @compute.ts/function
- @compute.ts/structural

## Imports

### Typescript

`import {/* required operators */} from '@compute.ts/math';`

### Javascript

`const {/* required operators */} = require('@compute.ts/math');`

## Operators

### sum

`sum(x`

_{[number] | number[]}) ➜ y_{number}

The **sum** operator allows you to create a number expression which evals to the lowest given expressions

```
import {number} from "@compute.ts/number"
import {sum} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = sum([x0, x1, ..., xn]) | sum(arr);
const value = y.eval();
```

### times

`times(x`

_{[number] | number[]}) ➜ y_{number}

The **times** operator allows you to create a number expression which evals to the multiplication of the arrray values

```
import {number} from "@compute.ts/number"
import {times} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = times([x0, x1, ..., xn]) | times(arr);
const value = y.eval();
```

### min

`min(x`

_{[number] | number[]}) ➜ y_{number}

The **min** operator allows you to create a number expression which evals to the lowest given expressions

```
import {number} from "@compute.ts/number"
import {min} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = min([x0, x1, ..., xn]) | min(arr);
const value = y.eval();
```

### argMin

`argMin(x`

_{[number] | number[]}) ➜ y_{number}

The **argMin** operator allows you to create a number expression which evals to the index of the lowest given expressions

```
import {number} from "@compute.ts/number"
import {argMin} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = argMin([x0, x1, ..., xn]) | argMin(arr);
const value = y.eval();
```

### max

`max(x`

_{[number] | number[]}) ➜ y_{number}

The **max** operator allows you to create a number expression which evals to the highest given expressions

```
import {number} from "@compute.ts/number"
import {max} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = max([x0, x1, ..., xn]) | max(arr);
const value = y.eval();
```

### argMax

`argMax(x`

_{[number] | number[]}) ➜ y_{number}

The **argMax** operator allows you to create a number expression which evals to the index of the highest given expressions

```
import {number} from "@compute.ts/number"
import {argMax} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = argMax([x0, x1, ..., xn]) | argMax(arr);
const value = y.eval();
```

### mean

`mean(x`

_{[number] | number[]}) ➜ y_{number}

The **mean** operator allows you to create a number expression which evals to the mean value of the given expressions

```
import {number} from "@compute.ts/number"
import {mean} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = mean([x0, x1, ..., xn]) | mean(arr);
const value = y.eval();
```

### median

`median(x`

_{[number] | number[]}) ➜ y_{number}

The **median** operator allows you to create a number expression which evals to median value of the given expressions

```
import {number} from "@compute.ts/number"
import {median} from "@compute.ts/math"
import {array} from "@compute.ts/array"
const x0 = number();
const x1 = number();
// ...
const xn = number();
const arr = array.ofNumber([x0, x1, ..., xn])
const y = median([x0, x1, ..., xn]) | median(arr);
const value = y.eval();
```

### pow

`pow(x`

_{number}, y_{number}) ➜ z_{number}

The **pow** operator allows you to create a number expression which evals to x power y

```
import {number} from "@compute.ts/number"
import {pow} from "@compute.ts/math"
const x = number();
const y = number();
const z = pow(x, y);
const value = z.eval();
```

### pi

`pi ➜ x`

_{number}

The **pi** operator allows you to create a number expression which evals to pi (≈1,141593)

```
import {pi} from "@compute.ts/math"
const x = pi;
x.affect(2);
```

### e

`e ➜ x`

_{number}

The **e** operator allows you to create a number expression which evals to e (≈2,71828)

```
import {e} from "@compute.ts/math"
const x = e;
x.affect(2);
```

### sqrt

`sqrt(x`

_{number}) ➜ y_{number}

The **sqrt** operator allows you to create a number expression which evals to the square root of the given expression

```
import {number} from "@compute.ts/number"
import {sqrt} from "@compute.ts/math"
const x = number();
const y = sqrt(x);
const value = y.eval();
```

### x2

`x2(x`

_{number}) ➜ y_{number}

The **x2** operator allows you to create a number expression which evals to the square of x

```
import {number} from "@compute.ts/number"
import {x2} from "@compute.ts/math"
const x = number();
const y = x2(x);
const value = y.eval();
```

### x3

`x3(x`

_{number}) ➜ y_{number}

The **x3** operator allows you to create a number expression which evals to the cube of x

```
import {number} from "@compute.ts/number"
import {x3} from "@compute.ts/math"
const x = number();
const y = x3(x);
const value = y.eval();
```

### log2

`log2(x`

_{number}) ➜ y_{number}

The **log2** operator allows you to create a number expression which evals to the logarithm neperien of the given expression

```
import {number} from "@compute.ts/number"
import {log2} from "@compute.ts/math"
const x = number();
const y = log2(x);
const value = y.eval();
```

### log10

`log10(x`

_{number}) ➜ y_{number}

The **log10** operator allows you to create a number expression which evals to the logarithm decimal of the given expression

```
import {number} from "@compute.ts/number"
import {log10} from "@compute.ts/math"
const x = number();
const y = log10(x);
const value = y.eval();
```

### exp

`exp(x`

_{number}) ➜ y_{number}

The **exp** operator allows you to create a number expression which evals to the exponential of the given expression

```
import {number} from "@compute.ts/number"
import {exp} from "@compute.ts/math"
const x = number();
const y = exp(x);
const value = y.eval();
```

### cos

`cos(x`

_{number}) ➜ y_{number}

The **cos** operator allows you to create a number expression which evals to the cosinus of the given expression

```
import {number} from "@compute.ts/number"
import {cos} from "@compute.ts/math"
const x = number();
const y = cos(x);
const value = y.eval();
```

### sin

`sin(x`

_{number}) ➜ y_{number}

The **sin** operator allows you to create a number expression which evals to the sinus of x

```
import {number} from "@compute.ts/number"
import {sin} from "@compute.ts/math"
const x = number();
const y = sin(x);
const value = y.eval();
```

### tan

`tan(x`

_{number}) ➜ y_{number}

The **tan** operator allows you to create a number expression which evals to the tangente of x

```
import {number} from "@compute.ts/number"
import {tan} from "@compute.ts/math"
const x = number();
const y = tan(x);
const value = y.eval();
```

### cosH

`cosH(x`

_{number}) ➜ y_{number}

The **cosH** operator allows you to create a number expression which evals to the hyperbolic cosinus of the given expression

```
import {number} from "@compute.ts/number"
import {cosH} from "@compute.ts/math"
const x = number();
const y = cosH(x);
const value = y.eval();
```

### sinH

`sinH(x`

_{number}) ➜ y_{number}

The **sinH** operator allows you to create a number expression which evals to the hyperbolic sinus of x

```
import {number} from "@compute.ts/number"
import {sinH} from "@compute.ts/math"
const x = number();
const y = sinH(x);
const value = y.eval();
```

### tanH

`tanH(x`

_{number}) ➜ y_{number}

The **tanH** operator allows you to create a number expression which evals to the hyperbolic tangente of x

```
import {number} from "@compute.ts/number"
import {tanH} from "@compute.ts/math"
const x = number();
const y = tanH(x);
const value = y.eval();
```

### arcCos

`arcCos(x`

_{number}) ➜ y_{number}

The **arcCos** operator allows you to create a number expression which evals to the arc cosinus of the given expression

```
import {number} from "@compute.ts/number"
import {arcCos} from "@compute.ts/math"
const x = number();
const y = arcCos(x);
const value = y.eval();
```

### arcSin

`arcSin(x`

_{number}) ➜ y_{number}

The **arcSin** operator allows you to create a number expression which evals to the arc sinus of the given expression

```
import {number} from "@compute.ts/number"
import {arcSin} from "@compute.ts/math"
const x = number();
const y = arcSin(x);
const value = y.eval();
```

### arcTan

`arcTan(x`

_{number}) ➜ y_{number}

The **arcTan** operator allows you to create a number expression which evals to the arc tangente of the given expression

```
import {number} from "@compute.ts/number"
import {arcTan} from "@compute.ts/math"
const x = number();
const y = arcTan(x);
const value = y.eval();
```

### arcCosH

`arcCosH(x`

_{number}) ➜ y_{number}

The **arcCosH** operator allows you to create a number expression which evals to the hyperbolic arc cosinus of the given expression

```
import {number} from "@compute.ts/number"
import {arcCosH} from "@compute.ts/math"
const x = number();
const y = arcCosH(x);
const value = y.eval();
```

### arcSinH

`arcSinH(x`

_{number}) ➜ y_{number}

The **arcSinH** operator allows you to create a number expression which evals to the hyperbolic arc sinus of the given expression

```
import {number} from "@compute.ts/number"
import {arcSinH} from "@compute.ts/math"
const x = number();
const y = arcSinH(x);
const value = y.eval();
```

### arcTanH

`arcTanH(x`

_{number}) ➜ y_{number}

The **arcTanH** operator allows you to create a number expression which evals to the hyperbolic arc tangente of the given expression

```
import {number} from "@compute.ts/number"
import {arcTanH} from "@compute.ts/math"
const x = number();
const y = arcTanH(x);
const value = y.eval();
```

### trunc

`trunc(x`

_{number}) ➜ y_{number}

The **trunc** operator allows you to create a number expression which evals to the truncature of x

```
import {number} from "@compute.ts/number"
import {trunc} from "@compute.ts/math"
const x = number();
const y = trunc(x);
const value = y.eval();
```

### sign

`sign(x`

_{number}) ➜ y_{number}

The **sign** operator allows you to create a number expression which evals to 1 if x is positive, -1 if x is negative

```
import {number} from "@compute.ts/number"
import {sign} from "@compute.ts/math"
const x = number();
const y = sign(x);
const value = y.eval();
```

### inverse

`inverse(x`

_{number}) ➜ y_{number}

The **inverse** operator allows you to create a number expression which evals to the inverse of the given expression

```
import {number} from "@compute.ts/number"
import {inverse} from "@compute.ts/math"
const x = number();
const y = inverse(x);
const value = y.eval();
```

### floor

`floor(x`

_{number}) ➜ y_{number}

The **floor** operator allows you to create a number expression which evals to the floor of the given expression

```
import {number} from "@compute.ts/number"
import {floor} from "@compute.ts/math"
const x = number();
const y = floor(x);
const value = y.eval();
```

### ceil

`ceil(x`

_{number}) ➜ y_{number}

The **ceil** operator allows you to create a number expression which evals to the ceil of the given expression

```
import {number} from "@compute.ts/number"
import {ceil} from "@compute.ts/math"
const x = number();
const y = ceil(x);
const value = y.eval();
```

### gcd

`gcd(x`

_{number}, y_{number}) ➜ z_{number}

The **gcd** operator allows you to create a number expression which evals to the greatest common divisor of the given expressions

```
import {number} from "@compute.ts/number"
import {gcd} from "@compute.ts/math"
const x = number();
const y = number();
const z = gcd(x, y);
const value = z.eval();
```

## About the author

I am a software developer with 4 years of project specializing in the development of web solutions. Digital Nomad, I work while traveling. After 3 years into the french industry, I've started to work as a freelance software architect or fullstack developer.

Based on state-of-the-art web technologies, I offer you to architect & develop the best version of your project. My experience in the web app development assure you to build a nice looking, performant and stable product.

Minimalist, I like to travel, to meet people, learn new things and handmade stuff. Scuba & sky diving licenced. I like also hamburgers, Kinder chocolate and crepes. Karate black belt.