1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Scalar root-finding algorithms.
//!
//! Root finding is deliberately separate from Basin's optimization
//! [`Solver`](crate::Solver)/[`Executor`](crate::Executor) loop. Optimization
//! states rank points by a scalar cost, whereas a bracketed root finder must
//! retain the signed function value and a sign-changing interval. The direct
//! APIs in this module preserve those semantics without treating `|f(x)|` as
//! an optimization objective.
//!
//! All solvers require a finite, sign-changing interval (or an exact endpoint
//! root). Use [`crate::RootBracketer`] to discover one first. [`BrentRoot`],
//! [`SecantRoot`], and [`Toms748Root`] need only function values. [`NewtonRoot`]
//! uses a first derivative, and [`HalleyRoot`] also uses a second derivative;
//! both accept separate or combined callbacks. Derivative steps retain the
//! bracket and fall back to bisection when necessary. Small steps alone do
//! not establish convergence.
//!
//! Results keep the signed value, final bracket, termination reason, and
//! evaluation counts. An iteration limit is a clean result, while invalid
//! inputs and application errors return typed errors. Each stage starts fresh
//! and counts its own work, including reevaluating bracket endpoints.
/// Brent's bracketed scalar root finder.
/// Errors shared by the secant, Newton, Halley, and TOMS 748 solvers.
/// Safeguarded Halley iteration.
/// Safeguarded Newton iteration.
/// Safeguarded secant iteration.
/// TOMS Algorithm 748 (`k = 2`).
pub use ;
pub use RootError;
pub use HalleyRoot;
pub use NewtonRoot;
pub use SecantRoot;
pub use Toms748Root;