horner

▸ function Horner (p: number[], x: number): number

Defined in evaluate/double/horner.ts:14

Returns the result of evaluating a univariate polynomial using Horner's method in double precision floating point arithmetic.

Parameters:

NameTypeDescription
pnumber[]a polynomial with coefficients given densely as an array of double floating point numbers from highest to lowest power, e.g. [5,-3,0] represents the polynomial 5x^2 - 3x
xnumberthe value at which to evaluate the polynomial

Returns: number