sympy
Execute Python/SymPy code to perform symbolic mathematics operations including algebra, calculus, and equation solving within a secure sandbox environment.
Instructions
SymPy sandbox tool: execute Python/SymPy math code.
Safety boundaries:
Only sympy/math imports and calls are allowed.
System calls, file I/O, network access, and dynamic execution are blocked.
Input rules:
Single argument: code (str).
You must print() the final answer; otherwise out may be empty.
Use multiple print() lines for multiple outputs.
Recommended workflow:
Define symbols and assumptions.
Derive/solve step by step.
Simplify intermediate expressions (simplify/factor/expand).
Print final results.
Retry guidance:
E_AST_BLOCK: remove unsafe statements and keep pure math code only.
E_TIMEOUT: reduce problem size, split steps, simplify before solving.
E_MEMORY: reduce dimensions or avoid constructing huge objects at once.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |