We have seen how to evaluate a polynomial of degree-bound n at a single point in O(n) time using Horner's rule. We have also discovered how to evaluate such a polynomial at all n complex roots of unity in O(nlgn) time using the FFT. We shall now show how to evaluate a polynomial of degree-bound n at n arbitrary points in O(nlg2n) time.
To do so, we shall assume that we can compute the polynomial remainder when one such polynomial is divided by another in O(nlgn) time, a result that we state without proof. For example, the remainder of 3x3+x2โ3x+1 when divided by x2+x+2 is
(3x3+x2โ3x+1)mod(x2+x+2)=โ7x+5.
Given the coefficient representation of a polynomial A(x)=โk=0nโ1โakโxk and n points x0โ,x1โ,โฆ,xnโ1โ, we wish to compute the n values A(x0โ),A(x1โ),โฆ,A(xnโ1โ). For 0โคiโคjโคnโ1, define the polynomials Pijโ(x)=โk=ijโ(xโxkโ) and Qijโ(x)=A(x)modPijโ(x). Note that Qijโ(x) has degree at most jโi.
a. Prove that A(x)mod(xโz)=A(z) for any point z.
b. Prove that Qkkโ(x)=A(xkโ) and that Q0,nโ1โ(x)=A(x).
c. Prove that for iโคkโคj, we have Qikโ(x)=Qijโ(x)modPikโ(x) and Qkjโ(x)=Qijโ(x)modPkjโ(x).
d. Give an O(nlg2n)-time algorithm to evaluate A(x0โ),A(x1โ),โฆ,A(xnโ1โ).