/** * Functions for computing polynomial roots. */ import { NumberOps } from "./number-ops"; interface IPolynomial { readonly ops: NumberOps; readonly coeffs: readonly T[]; readonly constantTerm: T; evaluate(t: number): T; } export declare function findRootsQuick(poly: IPolynomial): readonly number[]; /** * Does this polynomial start negative, grow continuously, and eventually become non-negative? * * - is the constant term `coeffs[0]` negative? * - are all non-constant terms `coeffs[1..]` non-negative? * * That is, does it look like: * * -p0 + p1 t + p2 t^2 + p3 t^3 + ... * * If so, we can bisect it to approximate a root. * * Bisection can solve for other kinds of roots, of course, but we don't implement them here. */ export declare function isRootBisectable(poly: IPolynomial): boolean; export interface BisectOptions { iterations?: number; } export declare function findRootBisect(poly: IPolynomial, opts?: BisectOptions): number; export declare function _findRootBisect(poly: IPolynomial, min: number, max: number, iterations: number): number; export {};