# Tabulated values: f(x) = x^3-2*x^2+3*x-1
x <- c(0.1,0.4,0.6,0.8,0.9)
f <- x^3-2*x^2+3*x-1
# Interpolation point
x0 <- 0.75
# Upper-triangular matrix of N-A values
P <- nevaitpol(x,f,x0)
# From level 4 onward the interpolated value
# does not change because f(x) is a 3rd-degree polynomial
print(P)
Run the code above in your browser using DataLab