Tute 3
Tute 3
interpolation
1
2 Interpolation
1. Derive the divided difference formula again (not to be done in the tute
class).
Input {x1 , x2 , . . . , xn , f1 , f2 , . . . , fn }
for j = 1, 2, . . . , n + 1
dj ← fj
for k = 1, 2, . . . , n
for j = n + 1, n, . . . , k + 1
dj ← (dj − dj−1 )/(xj − xj−k )
Output {d1 , d2 , . . . , dn+1 }
Prove the correctness and determine the time and space requirements.
4. Show that under the conditions of the previous problem, and with
Pk the polynomial that interpolates f at x1 , x2 , . . . , xk+1 , for k =
1, 2, . . . n, the difference
2
5. Consider Horner’s method for evaluating a polynomial
Input {n, a0 , a1 , . . . , an }
Input x
p ← an
for k = n − 1, n − 2, . . . , 0
p ← x ∗ p + ak
Output {x, p}
where,
ak h2ni k=n
âk =
ak h2k + 1i k = n − 1, . . . , 0
Conclude that if nrµ ≤ 0.1, then the relative error bound can be
obtained as
2nµ0
| âk − ak | k=n
≤
| ak | (2k + 1)µ0 k = n − 1, . . . , 0
3
where,
f¯ = max{| f (xi ) |: i = 1, 2, . . . , n + 1}
and
m = min{| xi − xj |: i, j = 1, 2, . . . , n + 1, i 6= j}
[Note: This one will be hard! Perhaps you should split it up into
several sub-problems?]
7. Conclude from the previous problems that the rounding errors in the
two algorithms are equivalent to a change in the finction f . This
change will be small provided that
10. Suppose f is a function that has been tabulated at x = 0, 0.1, 0.2, 0.3, 0.4, . . .
and suppose | f (k) (x) |≤ k, k = 0, 1, 2, . . .. What is the best value of n
to use for interpolating f at x̄ = 0.25? That is, what value of n will
result in the sum of truncation error and rounding error to be as small
as possible?