Evaluate Expression
evaluateEvaluate mathematical expressions in one call, supporting variables, functions, and array operations for statistics and linear algebra.
Instructions
Evaluate a mathematical expression in one call. Supports + - * / ^ % ! and parentheses; array literals like [1,2,3] for statistics and [[1,2],[3,4]] for linear algebra. Functions: sqrt, cbrt, abs, pow, exp, log, ln, log10, log2, nthRoot, gcd, lcm, factorial, sign, hypot, mod, sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, floor, ceil, round, min, max, isPrime, combinations, permutations, mean, median, std, sum, prod, variance, mode, det, inv, transpose, norm, dot, cross. Constants: pi, e, tau. Pass named values via 'variables' (e.g. { x: 2 }) to reference them in the expression. Example: '2 * (12 + sqrt(255))^2'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| precision | No | Significant digits for the result (default: 10) | |
| variables | No | Named values to substitute into the expression, e.g. { x: 2, y: 255 }. Keys must be valid variable names. | |
| expression | Yes | A mathematical expression, e.g. '2 * (12 + sqrt(255))^2'. Use * for multiplication and ^ for exponentiation. |