Numerical Analysis
Numerical Analysis
ASSIGNMENT
import NumPy as np
p=1
for j in range(n):
if i != j:
p = p * (interpolation_point - x[j]) / (x[i] - x[j])
yp = yp + p * y[i]
# Displaying output
print('Interpolated value at %.3f is %.3f.' % (interploation_point, yp))
1. Use a test case of 3 different pairs of values to prove the efficiency of your program
solution
x[0]=2
y[0]=4
x[1]=6
y[1]=7
x[2]=3
y[2]=5