Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CyRoot Documentation

CYTHON ROOT FINDING · VERSION 2.0

Where Functions Meet Zero

Start with a Python function. Explore every iteration. Move the numerical hot path into native code when you need it.

A Small Function, A Native Engine

from cyroot import newton

answer = newton(lambda x: x*x - 2., None, 1.5)
assert answer.success
assert abs(answer.root - 2.**.5) < 1e-10

Pass an analytic derivative, or None for a native finite difference. Vector callbacks may return tuples, lists or NumPy arrays. With native callbacks the whole numerical loop runs without the GIL; Python callbacks take it for each call. NumPy and SciPy are required.

Version 2.0 is not backward compatible with 1.x; the migration guides map the old API to the new one. Stopping And Results explains how to tell a residual root from a narrow scalar bracket or a stationary point with a nonzero residual.

Explore The Manual

Getting Started

Scalar Solvers

Vector Solvers

Matrix-Free And Optimization

Derivatives

Callbacks And Native API

Stopping And Results

Migration From 1.x

The repository README includes the algorithm gallery and project links.