# Calculate

> Compute the value of a math expression. Handles arithmetic, algebra, trig, calculus. Use this instead of LLM arithmetic — calculate is exact and deterministic.

- Skill: `bdambrosio/calculate` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add bdambrosio/calculate`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bdambrosio/calculate/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: bdambrosio (https://skillmd.com/u/bdambrosio)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bdambrosio/calculate

---


# calculate

Numerically evaluate mathematical expressions via SymPy. Returns the result as a string.

## Supported operations

- **Operators**: `+`, `-`, `*`, `/`, `**`, `%`
- **Constants**: `pi`, `E`
- **Functions**: `sin`, `cos`, `tan`, `asin`, `acos`, `atan` (radians), `sqrt`, `log`, `ln`, `exp`, `abs`, `factorial`
- **Equations**: an expression containing `=` is solved (e.g. `x**2 - 4 = 0` → `-2, 2`). An explicit `solve(...)` call works too: `solve(x**2 - 4, x)`.

All trig functions expect radians.

## Exact vs floating-point results

An expression that evaluates to an exact integer or rational comes back exact —
`17!` returns `355687428096000`, not `3.556874281e+14`. `precision` applies only
to results that genuinely need floating-point evaluation (irrationals, trig,
logs). Asking for a small `precision` to get a "clean" integer is backwards and
will be rejected below 1.

## Examples

```json
{"thought": "compute the discriminant", "tool": "calculate", "expression": "b**2 - 4*a*c", "vars": "a=1, b=-5, c=6"}
```

```json
{"thought": "projectile range", "tool": "calculate", "expression": "2 * v * sin(theta * pi / 180) / g", "vars": "v=20, theta=30, g=9.8"}
```

```json
{"thought": "roots of a quadratic", "tool": "calculate", "expression": "x**2 - 4 = 0"}
```

