Best use case
root-finding is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Problem-solving strategies for root finding in numerical methods
Teams using root-finding should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/root-finding/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How root-finding Compares
| Feature / Agent | root-finding | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Problem-solving strategies for root finding in numerical methods
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Root Finding
## When to Use
Use this skill when working on root-finding problems in numerical methods.
## Decision Tree
1. **Characterize the Problem**
- Single root or multiple roots?
- Bracketed (know interval containing root)?
- Derivatives available?
2. **Method Selection**
| Situation | Method | Implementation |
|-----------|--------|----------------|
| Bracketed, no derivatives | Bisection, Brent | `scipy.optimize.brentq` |
| Derivatives available | Newton-Raphson | `scipy.optimize.newton` |
| No derivatives | Secant method | `scipy.optimize.newton` (no fprime) |
| System of equations | `scipy.optimize.fsolve` | Requires Jacobian ideally |
3. **Implement Root Finding**
- `scipy.optimize.brentq(f, a, b)` - guaranteed convergence if bracketed
- `scipy.optimize.newton(f, x0, fprime=df)` - quadratic convergence near root
- For systems: `scipy.optimize.fsolve(F, x0)`
4. **Handle Multiple Roots**
- Deflation: divide out found roots
- Multiple starting points
- `sympy_compute.py solve "f(x)" --var x` for symbolic solutions
5. **Verify Solutions**
- Check |f(root)| < tolerance
- Verify root is in expected domain
- `z3_solve.py prove "f(root) == 0"`
## Tool Commands
### Scipy_Brentq
```bash
uv run python -c "from scipy.optimize import brentq; root = brentq(lambda x: x**2 - 2, 0, 2); print('Root:', root)"
```
### Scipy_Newton
```bash
uv run python -c "from scipy.optimize import newton; root = newton(lambda x: x**2 - 2, 1.0, fprime=lambda x: 2*x); print('Root:', root)"
```
### Sympy_Solve
```bash
uv run python -m runtime.harness scripts/sympy_compute.py solve "x**3 - x - 1" --var x
```
## Key Techniques
*From indexed textbooks:*
- [Numerical analysis (Burden R.L., Fair... (Z-Library)] How accurate was his approximation? C H A P T E R 2 Solutions of Equations in One Variable 2. Survey of Methods and Software In this chapter we have considered the problem of solving the equation f (x) = 0, where f is a given continuous function.
- [An Introduction to Numerical Analysis... (Z-Library)] Computational Solution of Nonlinear Operator Equations. Methods for Solving Systems of Nonlinear Equations. Society for Industrial and Applied Mathematics, Philadelphia.
- [An Introduction to Numerical Analysis... (Z-Library)] General polynomial rootfinding methods There are a large number of rootfind ing algorithms designed especially for polynomials. Many of these are taken up in detail in the books Dejon and Henrici (1969), Henrici (1974, chap. There are far too many types of such methods to attempt to describe them all here.
- [An Introduction to Numerical Analysis... (Z-Library)] J n Consider the product a 0 a 1 ••• am, where a 0 , a1, ••• , am are m + 1 num bers stored in a computer that uses n digit base fJ arithmetic. What is a rigorous bound for w? What is a statistical estimate for the size of w?
- [An Introduction to Numerical Analysis... (Z-Library)] Discussion of the Literature There is a large literature on methods for calculating the roots of a single equation. See the books by Householder (1970), Ostrowski (1973), and Traub (1964) for a more extensive development than has been given here. Newton's method is one of the most widely used methods, and its development is due to many people.
## Cognitive Tools Reference
See `.claude/skills/math-mode/SKILL.md` for full tool documentation.Related Skills
workflow-router
Goal-based workflow orchestration - routes tasks to specialist agents based on user goals
wiring
Wiring Verification
websocket-patterns
Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.
visual-verdict
Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS/REVISE/FAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.
verification-loop
Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.
vector-db-patterns
Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.
variant-analysis
Find similar vulnerabilities across a codebase after discovering one instance. Uses pattern matching, AST search, Semgrep/CodeQL queries, and manual tracing to propagate findings. Adapted from Trail of Bits. Use after finding a bug to check if the same pattern exists elsewhere.
validate-agent
Validation agent that validates plan tech choices against current best practices
tracing-patterns
OpenTelemetry setup, span context propagation, sampling strategies, Jaeger queries
tour
Friendly onboarding tour of Claude Code capabilities for users asking what it can do.
tldr-stats
Show full session token usage, costs, TLDR savings, and hook activity
tldr-router
Map code questions to the optimal tldr command by detecting intent and routing to the right analysis layer.