@arki/math/roots
For @arki/[email protected] · source docs/modules/roots.md
Back to the README.
@arki/math/roots
Every result carries an error estimate, and a method that misses its tolerance
throws a ConvergenceError subclass holding its best estimate (.best) instead
of returning a wrong number. A function that returns NaN or Infinity throws
NumericRangeError naming the point. derivative and limit are numerical
estimates, not proofs.
The same page covers @arki/math/roots. For integrate see integrate; for derivative and limit see differentiate.
import { findRoot } from '@arki/math/roots';
findRoot(x => x ** 3 - 2 * x - 5, [2, 3]).root; // 2.094551481542327 Brent, bracket must change sign