evaluate_math_expression
Evaluate complex mathematical expressions safely, including arithmetic, exponents, roots, trig functions, logarithms, and constants.
Instructions
Evaluate complex mathematical expressions safely.
Supports addition, subtraction, multiplication, division, exponents (^ or **), roots (sqrt, cbrt), trigonometric functions (sin, cos, tan), logarithms (log, log10, ln), and constants (pi, e).
Args: expression: The mathematical expression string (e.g., '2 * (3 + 4)', 'sqrt(144) + sin(pi / 2)', '5^3') precision: Number of decimal digits of precision for symbolic evaluation (default 10)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| precision | No | ||
| expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |