|
D. Knuth's polynomial representation |
|
|
|
- In 1969 D. Knuth has shown that every real polynomial p(x) of degree
n >= 4 can be evaluated using floor(n/2) + 2 multiplications and n+1
additions.
- For n=5 this are 2 multiplications and 6 additions,
clearly less than used by Horners scheme (which however has been proven to be complexity
optimal if the MacLaurin representation is used as input).
- In order to achieve Knuth's better complexity the polynomial must be
represented in an other form, such that this all makes sense only if subsequently its values
are required for a hugh number of arguments. This new representation reads as follows:
p(x) = (...((q(x+ρ)((x+ρ)2-z1)+R1)
((x+ρ)2-z2)+R2)...)
((x+ρ)2-zm)+Rm
- Here n is either 2m or 2m+1, q(.) is
either quadratic or linear and zi
resp. Ri are real coeffcients, ρ is used for
a shift of the origin.
- Using results from complex analysis one can show that this representation is
always possible, provided the polynomial has zeroes with nonnegative real part.
This property however is always obtainable using a shift of the origin,
using an upper bound for the absolute value of all zeroes, which is readily available.
Here we use Marden's bound for this:
|z| <= ρ=2*max{ |an-i/an|1/i : i=1,...,n }
where the ai are the coefficients of p in the monomial basis
and an denotes the coefficient of xn.
For this reason there appears the term x+ρ and not x itself in this
representation.
-ρ is what is called ''base point'' in the output of this program. The numbers
zi are the zeroes of the polynomial build from the odd numbered coefficients
of the shifted polynomial and the Ri are the remainders in Euclids polynomial
division. (The proof that those zi are indeed always real uses some
deep results from complex analysis)
- In a practical application the computed zeroes and remainders are perturbed by roundoff effects
and in addition due to the necessary shift of the origin the computed representation might be
the source of increased roundoff sensitivity of p's evaluation. Therefore the usefulness
of this must be checked subsequently (for example if one wishes a speed up in the evaluation
of a polynomial approximation to a complicated transcendental function).
- We compare the evaluation of the representation in the monomial basis and the new one
in the interval [-ρ,ρ]
|
|
|
Input |
|
- The degree n of p. Important: n >= 4.
- The coefficients an,
... ,a0 in the monomial basis. an is the coefficient of xn.
Important also: an*a0 notequal 0.
|
|
|
Output |
|
- The input coefficients.
- The complete Taylor development at the shifted origin.
- The odd numbered coefficients.
- The zeroes zi
and division remainders Ri. In the polynomial division by a quadratic term
of course a linear remainder should occur: there is a test output for the (theoretically zero)
coefficient of x
- A table of the differences of the evaluation of p for equidistant real
arguments in [-ρ,ρ] for the representation in the monomial basis by
Horners scheme and for the new representation.
|
|
|
Questions ?! |
|
- When and why you get sometimes (but not always) large deviations in the evaluation of
the polynomial?
|
|
|
|
|