RootSolvers.jl

RootSolvers.jl is a Julia package for finding roots of nonlinear equations using robust, efficient, and GPU-capable numerical methods. It provides a simple, unified interface for a variety of classic root-finding algorithms, with flexible convergence criteria and solution reporting. The package supports dual numbers for automatic differentiation, making it suitable for integration into differentiable models and optimization problems.

Quick Example

See the Getting Started page for more details and examples.

Install stable release:

using Pkg
Pkg.add("RootSolvers")

Find a root of a quadratic equation:

using RootSolvers

# Find the root of x^2 - 100^2 using the secant method
sol = find_zero(x -> x^2 - 100^2, SecantMethod(0.0, 1000.0))
CompactSolutionResults{Float64}:
├── Status: converged
└── Root: 99.99999999994358

Or use Brent's method for robust bracketing

sol = find_zero(x -> x^2 - 100^2, BrentsMethod(-200.0, 0.0))
CompactSolutionResults{Float64}:
├── Status: converged
└── Root: -100.0

Documentation