Expand description
Root finding, polynomial roots and minimization.
The numerical substrate every intersection, projection and extrema algorithm in the kernel sits on. Nothing here is geometric. It is kept separate so those algorithms are about geometry rather than about convergence.
§What to reach for
- A root inside a known bracket:
brent. Guaranteed to converge, and nearly as fast as Newton in practice. - A root with a known derivative and a good starting point:
newton, which falls back to bisection whenever a step would leave the bracket. Unsafeguarded Newton diverges on the configurations that matter: a tangential intersection is exactly where the derivative vanishes. - Roots of a polynomial:
roots. Closed form up to the cubic, the quadratic written to avoid the cancellation the schoolbook formula suffers. Above that, or with no allocation,real_roots: each root bracketed between its derivative’s roots. - A system of equations:
newton_system. Surface projection is two equations in two unknowns. Intersection marching is much the same. - A minimum without derivatives:
minimize.
Structs§
- Criteria
- Stopping criteria for an iterative solver.
- Solution
- A solver result: the estimate, the residual there, and how it finished.
- System
Solution - The outcome of solving a system of equations.
Enums§
- Convergence
- How a solver finished.
Functions§
- brent
- Find a root of
fin[a, b]by Brent’s method. - cubic_
roots - Real roots of
a x^3 + b x^2 + c x + d. - linear_
fixed A x = bfor anN × Nsystem, by LU with partial pivoting: the stepnewton_system_fixedsolves.Noneat a zero pivot.- minimize
- Minimize a scalar function on
[a, b]without derivatives. - newton
- Find a root of
fnearstart, using its derivative, safeguarded by a bracket. - newton_
system - Solve
f(x) = 0for a vectorx, by damped Newton. - newton_
system_ 2 - A two-unknown
newton_system, allocation-free. - newton_
system_ fixed - A fixed-size
newton_systemforNunknowns, allocation-free. - newton_
system_ fixed_ lazy newton_system_fixedwith the residual and the Jacobian measured apart, the Jacobian only where a step is taken.- quadratic_
roots - Real roots of
a x^2 + b x + c. - real_
roots - The real roots of a polynomial, in increasing order, written to the front
of
out; returns how many there are. - roots
- The real roots of a polynomial, in increasing order.