| | |
Summary: EVALUATING A POLYNOMIAL
Consider having a polynomial
p(x) = a0 + a1x + a2x2 + · · · + anxn
which you need to evaluate for many values of x. How
do you evaluate it? This may seem a strange question,
but the answer is not as obvious as you might think.
The standard way, written in a loose algorithmic for-
mat:
poly = a0
for j = 1 : n
poly = poly + ajxj
end
To compare the costs of different numerical meth-
ods, we do an operations count, and then we compare
these for the competing methods. Above, the counts
are as follows:
additions : n
multiplications : 1 + 2 + 3 + · · · + n =
n(n + 1)
2
|