SIAM
J.
COMPUT.
Vol.
4,
No.
4,
December
1975
EVALUATING
POLYNOMIALS
AT
FIXED
SETS
OF
POINTS*
A.
V.
AHOf,
K.
STEIGLITZ$
AND
J.
D.
ULLMANt
Abstract.
We
investigate
the
evaluation
of
an
(n-1)st
degree
polynomial
at
a
sequence
of
n
points.
It
is
shown
that
such
an
evaluation
reduces
directly
to
a
simple
convolution
if
and
only
if
the
sequence
of
points
is
of
the
form
b,
ba,
ba2,
.,
ba
for
complex
numbers
a
and
b
(the
so-called
"chirp
transform").
By
more
complex
reductions
we
develop
an
O(n
log
n)
evaluation
algorithm
for
sequences
of
points
of
the
form
b
+
c
+
d,
ba2
+
ca
+
d,
ba4
+
ca2
+
d,
for
complex
numbers
a,
b,
c
and
d.
Finally
we
show
that
the
evaluation
of
an
(n-1)st-degree
polynomial
and
all
its
derivatives
at
a
single
point
requires
at
most
O(n
log
n)
steps.
Key
words,
polynomial
evaluation,
derivative,
fast
Fourier
transform,
chirp
transform,
straight-
line
code,
computational
complexity,
Taylor
series
1.
Introduction.
We
consider
the
following
problem.
Given
an
infinite
sequence
of
points
ao,
a
l,
a2,"-,
how
long,
as
a
function
of
n,
does
it
take
to
evaluate
an
arbitrary
dense
univariate
polynomial
of
degree
n-
1
at
the
first
n
of
these
points?
Our
model
of
computation
is
the
straight-line
code
model.
For
each
n,
we
assume
that
the
computation
is
performed
by
a
sequence
of
assignment
state-
ments
of
the
form
A
-
B
0
C,
where
A,
B
and
(7
are
variable
names,
constants,
or
the
names
of
coefficients
of
the
polynomial
(input
variables),
and
0
is
one
of
the
operators
+,
-,
or
/.
In
addition,
n
variables
are
designated
as
output
variables,
and
after
execution
of
the
sequence
of
assignment
statements,
these
variables
are
to
hold
the
values
of
the
polynomial
at
the
n
points.
Such
a
sequence
of
assignment
statements
will
be
called
an
algorithm,
and
the
complexity
of
an
algorithm
is
the
number
of
assignment
statements
therein.
A
straight-line
algorithm
that
evaluates
any
(n-
1)st-degree
polynomial
at
n
points
is
said
to
be
an
evaluation
algorithm.
The
inputs
to
the
algorithm
are
the
coefficients
of
the
polynomial.
A
sequence
of
points
ao,
al,
a2,
is
said
to
be
of
complexity
at
most
T(n),
if
for
all
positive
n
there
is
a
straight-line
algorithm
with
at
most
T(n)
statements
that
evaluates
any
(n
1)st-degree
polynomial
at
the
first
n
points
of
the
sequence.
It
is
known
that
an
arbitrary
sequence
of
points
is
of
complexity
at
most
O(n
log
n)([1]
modified
by
the
treatment
in
[2],
[3],
[4]).
Certain
sequences
of
points,
however,
are
of
complexity
at
most
O(n
log
n).
The
best
known
such
sequence
of
points
is
the
"chirp
transform"
[5],
[6],
a
generalization
of
the
"fast
*
Received
by
the
editors
May
13,
1974,
and
in
revised
form
November
15,
1974.
The
work
of
the
second
author
was
supported
in
part
by
the
U.S.
Army
Research
Office,
Durham,
under
Contract
DAHCO4-09-C-0012,
and
by
The
National
Science
Foundation
under
Grant
GJ-965.
The
work
of
the
third
author
was
supported
in
part
by
The
National
Science
Foundation
under
Grant
GJ-35570.
?
Bell
Laboratories,
Murray
Hill,
New
Jersey
07974.
$
School
of
Engineering
and
Applied
Science,
Princeton
University,
Princeton,
New
Jersey
08540.
533
534
A.
V.
AHO,
K.
STEIGLITZ
AND
J.
D.
ULLMAN
Fourier
transform"
(FFT)
[7].
In
the
chirp
transform,
the
sequence
of
points
z
,
z
1,
z2,
is
used,
where
z
is
any
complex
number.
A
polynomial
Y,"__-
b,x’
can
be
evaluated
at
the
points
z
,
z
1,
.,
z
n-1
in
O(n
log
n)
time
as
follows.
To
compute
n--1
(1)
cj
Y
b,z
ij
for0_-<j_-<n-1,
i=0
we
rewrite
(1)
as"
n-1
(2)
c
b,
z
-(j-’)2/2
z
’/
z
/
for
0_-<
j
_-<
n
1.
i=0
Equation
(2)
is
a
convolution
which
can
be
evaluated
in
O(n
log
n)
steps
with
the
FFT.
Our
goal
is
to
increase
the
set
of
sequences
which
are
known
to
have
O(n
log
n)
evaluation
algorithms.
While
an
interesting
problem
in
its
own
right,
digital
signal
processing
provides
the
practical
motivation
for
considering
the
evaluation
of
high-degree
dense
polynomials
at
more
general
sequences
of
points
than
that
of
the
chirp
transform.
See
[8]
and
[9],
for
example.
The
approach
we
use
is
to
consider
classes
of
sequences.
The
T(n)
class
of
sequences
is
the
set
of
all
sequences
which
have
an
O(T(n))
evaluation
algorithm.
Thus
for
each
complex
number
z,
the
sequence
z
,
zl,
is
in
the
n
log
n
class,
and
every
sequence
is
in
the
n
log
n
class.
We
shall
ultimately
consider
closure
properties
of
classes,
but
first
we
shall
consider
to
what
extent
the
chirp
transfor-
mation
generalizes
directly.
It
should
be
noted
that
our
definition
of
"class"
smears
the
boundary
between
sequences
of
distinct
degrees
of
difficulty.
For
example,
it
is
by
no
means
clear
that
there
is
speedup
by
constant
factors
in
the
straight-line
code
model,
as
there
is
for
Turing
machines
[
10].
It
is
likely
that
there
are
sequences
that
can
be
evaluated
in
time
(l+e)T(n)
but
not
in
time
T(n)
for
any
reasonable
T(n)
and
e
>0.
Nevertheless,
the
definition
is
a
useful
one
to
make,
and
we
shall
use
it
to
advantage
subsequently.
2.
Uniqueness
of
the
chirp
transform.
We
have
seen
that
the
chirp
transform
,=o
bd3(i)7(]
i),
where
the
b,’s
are
the
.reduces
to
a
convolution
of
the
form
a(j)
,-1
coefficients
of
the
polynomial
to
be
evaluated,
and
a,/3
and
y
are
independent
of
the
bi’s.
It
is
interesting
to
consider
what
other
transformations,
if
any,
can
be
reduced
to
a
convolution
of
this
form.
The
following
theorem
shows
that
except
for
a
constant
factor,
the
chirp
transform
is
the
most
we
can
obtain
by
this
technique.
THEOREM
1.
For
n
>=
3,
suppose
that
the
evaluation
of
an
arbitrary
(n
1)-st-
=o
bx
at
the
points
ao,
al,"
",
a,-1
can
be
expressed
as
a
degree
polynomial
,-1
convolution
of
the
form
n--1
n--1
(3t
,
b,a
a(j)
b,/3(ilT(
i)
for
0
<-_,i
<=
n
1
=0
=0
for
some
functions
a,
and
3/independent
of
the
b’s.
Then
a
zl(z_)
for
some
complex
numbers
zl
and
z2.
EVALUATING
POLYNOMIALS
535
Proof.
Since
the
b,’s
are
arbitrary,
the
left
and
right
sides
of
(3)
must
agree
term
by
term.
Thus
(4)
a=
a(j)8(i)y(j-
i)
for
all
and
between
0
and
n-
1.
Suppose
temporarily
that
aj
0
for
any
j.
Taking
logarithms
of
(4),
we
obtain
(5)
log
aj
log
a
(j)
+
log/3
(i)
+
log
/(j
i)
for
0
<-
i,
j
_<-
n
1.
Taking
finite
differences
of
(5)
with
respect
to
+
1
and
j
gives
/3(i+
1)
3,(j-i-
1)
(6)
log
a,
log
t/3"i
----
+
log
i)
for
0
=<
<
n
1
and
0
=<
j
=<
n
1,
and
(7)
log
a--L-
=log
a(j)+log
3’(j-i)
aj_,
a(j-1)
3,(j-i-
1)
for
0
=<
=<
n
1
and
0
<
j
=<
n
1.
Summing
(6)
and
(7),
we
obtain
(8)
log
ai
+
log
ai
log
a(j)+log/3(i
+
1_______)
a-i
a(j-1)
/3(i)
for
0
<=
<
n
1
and
0
<
j
_<-
n
1.
Taking
(8)
at
1
and
subtracting
from
it
(8)
at
0,
we
obtain
(9)
log
ai
log/3(0)/3(2)
for
0
<
j
<
n
1
aj_l
/3(1)
(Note
that
n
-
3
is
necessary
for
this
step
to
make
sense.)
It
follows
from
(9)
that
a
/3(0)/3(2)
ai_l
/3(1)
2
fr
0<J
<n-1
and
therefore
(0)/3
(2)]
a
ao
/3(1):
for
0=<j=<n-l.
Let
zl
ao
and
z_
=/3(0)/3(2)//3(1)
to
prove
the
theorem.
The
detail
which
remains
is
what
happens
when.
ai
0
for
some
j,
say
jo.
Referring
back
to
(3),
we
see
that
the
left
side
evaluated
at
ajo
is
just
bo.
Thus,
in
place
of
equation
(4)
with
j
jo,
we
have
(10)
a(jo)fl(i)3,(jo-
i)
0
for
1
=<
--<
n
1,
(11)
c(jo)/3(0)’y(jo)
1.
From
(11)
we
see
a
(jo)
0.
Thus
by
(10)
we
have/3
(i)
3’(jo
i)
0
for
1
_-<
-<
n
1.
The
theorem
is
easily
seen
to
hold
if
a
0
for
all
j.
Thus
assume
the
contrary.
If
/3(i)=0
for
any
i,
then
the
right
side
of
(3)
is
independent
of
b,.
This
is
impossible,
since
we
assumed
not
all
a’s
are
zero.
We
may
conclude
that
3’(jo-
i)
0
for
1
-<
=<
n
1.
It
is
sufficient
to
consider
two
cases.
536
A.
V.
AHO,
K.
STEIGLITZ
AND
J.
D.
ULLMAN
Case
1.
ao=0
and
ajo+l0.
Then,
since
y(jo-1)=0,
it
follows
that
/((jo+
1)-2)=0.
Thus,
for
j
=jo+
1,
the
right
side
of
(3)
is
independent
of
b2.
Since
n
_->
3
is
assumed,
we
have
a
contradiction.
Case
2.
ao
0
and
ao-1
0.
Then
the
right
side
of
(3)
is
independent
of
bo
for
j
jo-1,
again
yielding
a
contradiction,
i-I
Note
that
Theorem
1
is
trivially
true
for
n
1,
but
there
is
a
counterexample
with
ao
0
for
the
case
n
2.
3.
Closure
properties
of
sequence
classes.
We
see
from
Theorem
1
that
the
chirp
transform
is
essentially
all
that
we
can
obtain
by
a
simple
convolution.
More
extensive
algebraic
manipulations,
however,
do
yield
larger
classes
of
sequences
for
the
n
log
n
class.
Before
looking
at
these
more
complex
operations,
we
derive
several
"closure
properties"
that
hold
for
the
various
sequence
classes.
LEMMA
1.
If
sequence
ao,
al,
a2,’’’
is
in
class
T(n)>-n,
and
c
is
any
complex
number,
then
sequence
cao,
ca1,
ca2,.."
is
also
in
class
T(n).
Proof.
Let
A.
be
an
algorithm
that
takes
as
input
the
coefficients
Y,i=o
b,aj
for
0
<n-
1
as
outputs.
Then
we
bo,
bl,
bn-1
and
produces
dj
,-1
__<
j
n--1
may
construct
algorithm
B.
to
compute
e
Y,=o
b,(ca)
for
0
<_-
j
-<
n
1.
B.
works
as
follows:
1.
In
n
2
steps,
compute
f
c’
for
2
_-<
-<
n
1.
Let
fo
1
and
fl
c.
2.
In
n
1
steps,
compute
g
b
for
0
-_<
_-<
n
1.
3.
Apply
algorithm
Ao
to
coefficients
go,
gl,"
",
g,-1.
4.
The
outputs
of
A.
are
the
desired
outputs
for
It
should
be
clear
that
B.
works,
and
that
the
length
of
the
straight-line
algorithm
B.
is
2n
3
plus
the
length
of
A..
Thus,
since
T(n)
>-
n,
we
know
that
the
length
of
B.
does
not
exceed
3
T(n).
LEMMA
2.
If
ao,
al,
a2,
is
in
the
T(n)
>-
n
log
n
class,
and
k
is
any
positive
integer,
then
ao,
a,
az,
is
also
in
the
T(n)
class.
Proo]
The
proof
is
again
straightforward.
Given
the
coefficients
bo,
bl,"
",
b,-1,
we
construct
a
new
sequence
of
coefficients
of
length
kn
by
inserting
k-
1
O’s
after
each
of
the
b’s.
Then
we
break
this
sequence
into
k
subsequences
of
length
n.
We
let
the
subsequences
represent
k
polynomials
po,
pl,’"
",
p-l.
We
now
have
n--1
k-1
(12)
=0
r=O
for
0__<j__<n-
1.
We
use
the
assumed
O(T(n))
algorithm
k
times
to
evaluate
the
pr’s
at
ao,
al,
",
a,_l.
The
terms
aT’
for
0
_-<
j
_-<
n
1
and
0
_-<
r
_-<
k
1
can
be
evaluated
in
O(kn
+
n
log
n)
steps,
and
the
right
side
of
(12)
can
be
evaluated
in
O(kn)
steps
r,,
and
pr(a)’s.
Thus
the
entire
algorithm
requires
O(kT(n))
given
the
a
+
O(kn
+
n
log
n)
steps.
Since
k
is
a
constant
and
T(n)
>-
n
log
n,
this
function
is
of
the
order
of
T(n).
[-1
LEMMA
3.
If
ao,
a,
is
in
the
T(n)>-_
n
log
n
class
and
c
is
any
complex
number,
then
ao
+
c,
al
+
c,
is
also
in
the
T(n)
class.
EVALUATING
POLYNOMIALS
5
3
7
Y’.,=o
b,(aj
+
c)
for
0
-<
j
-<
n
1.
This
can
be
done
Pro@
We
wish
to
compute
,-1
in
the
following
manner:
(13)
Z
b,(a+c)’=
Z
b,
ac
’-r=
Z
b,
ac
’-r
i=0
i=0
r=O
r
r---O
i=r
If
we
define
f(x)
bxx!
for
0
-<
x
_-<
n-
1
and
-X/(-x)!
for
-(n-
1)-<x_-<O,
g(x)
0
for
1
_-<
x
-<
n
1,
then
we
can
allow
the
inner
summation
of
(13)
to
range
from
0
to
n
1
and
write
(13)
as:
rn--1
n--1
)i
n--1
aj
(14)
Y.
b,(a+c
Y.
[(i)g(r-i).
=0
r=O
=0
It
is
easy
to
see
how
to
compute
the
necessary
values
of
f(x)
and
g(x)
in
O(n)
steps.
Then
the
inner
summation
of
(14)
can
be
evaluated
for
0
-<
r-<
n-1
in
O(n
log
n)
steps,
since
it
is
a
convolution.
In
O(n)
more
steps,
we
can
compute
for
0
<-
r
-<
n
1.
Thus
we
can
compute
dr
(1/r!)
i"=-
f(i)g(r
i)
for
0
_-<
r
=<
n
1
in
O(n
log
n)
steps.
Thus
the
problem
of
evaluating
,"=-
b,x’
at
points
ao
+
c,
al
+
c,
has
been
reduced
in
O(n
log
n)
steps
to
the
problem
of
evaluating
i"---2
dix
at
points
ao,
al,"
".
The
latter
evaluation
can
be
done
in
T(n)
steps.
Since
T(n)>-n
log
n,
the
desired
evaluation
takes
O(T(n))
steps.
We
may
now
combine
the
three
lemmas
to
obtain
additional
closure
proper-
ties
of
sequence
classes.
THEOREM
2.
If
ao,
a
1,’’’
is
in
class
T(n)>--n
log
n,
b
and
c
are
complex
numbers,
and
k
is
any
positive
integer,
then
bao+
C,
ba+
c,
is
in
class
T(n).
Proof.
By
Lemma
2,
sequence
ao
,
a,.
is
in
class
T(n).
By
Lemma
1,
so
is
sequence
ba,
ba,...,
and
by
Lemma
3
we
have
the
theorem.
THEOREM
3.
/f
sequence
ao,
al,
is
in
class
T(n)>-_
n
log
n,
and
b,
c
and
d
are
complex
numbers,
then
bag
4-
cao
+
d,
ba
+
ca1
+
d,
is
in
class
T(n).
Proof.
By
completing
the
square,
we
can
find
complex
numbers
e
and
[
such
that
for
all
x,
b(x
+
e)
+/=
bx
+
cx
+
d.
By
Lemma
3,
ao
+
e,
al
+
e,.
is
in
clfiss
T(n).
Using
Theorem
2
with
k
2,
we
see
that
b(ao+e)Z+f,
b(al+e)Z+f,
is
in
class
T(n).
This
sequence
is
the
desired
one.
We
have
the
following
corollary
to
the
theorems
above
and
the
chirp
transform
theorem.
THEOREM
4.
The
following
sequences
are
in
class
n
log
n
for
complex
num-
bers
a,
b,
c
and
d,
and
positive
integer
k:
(15)
b
+
c,
ba
’
+
c,
ba
2k
+
c,.