These are the three errors I was given. I so far wrote the code which was computing the polynomial interpolation but now I am asked to find those three norms: norm error mean norm error maximal absolute error
This is code I found that computers interpolation without the built in.
Clear["Global`*"] f[x_] = x e^-x - 1 f[1]; f[2]; f[3]; f[4]; XY = {{1, -1 + 1/e}, {2, -1 + 2/e^2}, {3, -1 + 3/e^3}, {4, -1 + 4/e^4}}; p4[x_] = Fit[XY, {1, x, x^2, x^3, x^4}, x] dots = ListPlot[XY, PlotStyle -> {PointSize[0.02]}]; gr5 = Plot[{f[x], p4[x]}, {x, -0.6, 2.1}, PlotStyle -> {Red, Green}]; Show[gr5, dots, PlotRange -> {{0, 1.2}, {0.0, 1.15}}] 


