UNPKG

@bmancini55/finance

Version:

Finance utilities for JavaScript

12 lines (11 loc) 448 B
/** * Performs the Newton-Raphson iteration to find an approximate root of a real-valued * function. * * @param fx function f(x) * @param gx derivative of f(x) * @param x0 initial guess * @param n optional number of iterations, default is 10 * @param e optional tolerable error, default is 1e-8 */ export declare function calcNewtonRaphson(fx: (v: number) => number, gx: (v: number) => number, x0: number, n?: number, e?: number): number;