/** * Scalar (1-D) function minimization via Brent's method. * * Distinct from root-finding (`findRoot`, `newton`, `secant`, `halley`, which * solve f(x) = 0): this locates a local minimizer of f over a bounded * interval. Combines golden-section search (guaranteed, slow) with parabolic * interpolation (fast near a smooth minimum) โ€” the classic algorithm of * Brent (1973) / Numerical Recipes ยง10.2, and the same method behind * `scipy.optimize.minimize_scalar(method='bounded')`. * * @packageDocumentation */ type f64 = number; type i32 = number; /** * Options for {@link minimizeScalar}. */ export interface MinimizeScalarOptions { /** * Interval `[a, b]` to search over (bounded Brent). If omitted, defaults to * `[-10, 10]` โ€” a generic finite bracket; supply an explicit bracket for * functions whose minimum may lie outside that range. */ bracket?: [f64, f64]; /** Convergence tolerance on the interval width (default 1e-8). */ tol?: f64; /** Maximum iterations (default 100). */ maxIter?: i32; } /** * Result of {@link minimizeScalar}. */ export interface MinimizeScalarResult { /** The minimizer. */ x: f64; /** f(x) at the minimizer. */ fval: f64; } /** * Minimize a scalar function `f: R -> R` over a bounded interval using * Brent's method (golden-section search + parabolic interpolation). * * If `opts.bracket` is not supplied, the default search interval is * `[-10, 10]`. * * @param f - Function to minimize * @param opts - Options (bracket, tol, maxIter) * @returns `{ x, fval }` โ€” the minimizer and its function value * * @example * minimizeScalar(x => (x - 2) ** 2) // => { x: ~2, fval: ~0 } * minimizeScalar(Math.sin, { bracket: [0, 2 * Math.PI] }) // => { x: ~3pi/2, fval: ~-1 } */ export declare function minimizeScalar(f: (x: f64) => f64, opts?: MinimizeScalarOptions): MinimizeScalarResult; export {}; //# sourceMappingURL=minimize-scalar.d.ts.map