eval-k
▸ function evalK
(p
: number[], x
: number): number
Defined in evaluate/double/eval-k.ts:30
Returns the result of evaluating the given polynomial at x
such that at least
the sign bit is correct up to 3-times compensated evaluation (K = 4), i.e.
as if evaluating in double-double-double-double precision.
uses a staggered algorithm, first trying in double precision, then in double-double and finally in double-double-double-double
see also Horner's Method
Parameters:
Name | Type | Description |
---|---|---|
p | number[] | 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 |
x | number | the value at which to evaluate the polynomial |
Returns: number