Question: Please program in Java a. Write a program that takes any n + 1 distinct points and returns the coefficients a k , k =
Please program in Java
a. Write a program that takes any n + 1 distinct points and returns the coefficients ak , k = 0,1,..., n for the Newton form of the interpolating polynomial for a function f(x).
b. Write a program that takes the Newton coefficients of the polynomial and a point x and evaluates Pn(x).
c. Apply the the two programs to compute the interpolant to f(x) = 1/(1 + 25x2) and do the following:
(i) Using the 21 uniformly spaced nodes xk= -1 + k(.1) ,k= 0,1, ... ,20 have your program compute the error at x=.985.
( ii) Using 21 Chebyshev nodes given by xk= cos((2k+ 1) / 2(20 + 1)) ,k= 0,1, ... ,20. Have your program compute the error at x=.985. The output of your program should be the error in each case.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
