Nothingness lies coiled in the heart of being — like a worm
chorner — evaluate a polynomial represented by an array of double using the compensated Horner scheme of Graillat, Langlois, and Louvet , or double complex using the scheme of Graillat and Ménissier-Morain .
||const double * p,|
||const double complex * p,|
|double complex x
crhorner function evalatutes the (real) polynomial
p, represented as by an
doubles at the value
x. The coefficient
of the constant term is at index 0, of the linear term at index 1 and so on (so this is
opposite to the common and strange Matlab representation). Note that the polynomial is of order
cchorner function evaluates a complex polynomial.
The compensated Horner scheme takes account of, and corrects for, the cancellation errors which occur in the uncompensated Horner scheme. The result is an accuracy which is the same as if one had used a Horner scheme with 128-bit (quadruple precision) floating point arithmetic and rounded the result down to 64-bit (double precision), but at much lower computational cost.
The algorithm depends crucially on the structure of IEEE 754 floating point arithmentic and
an error will be raised if the macro
its presence is not defined at compilation.
The estimate of
p(x), as a double
crhorner) or double complex
cchorner). In the case that
zero, zero will be returned.