The Lagrange interpolation error involves a polynomial [i]L(x)[/i] with roots at the nodes used for interpolation. For the case of equidistant nodes, the error is large near the end points. This situation can be improved by choosing non-equidistant nodes, the case of Chebyshev nodes being a quasi-optimal choice.
Shift any of the nodes A, B, C, D to obtain a reduction in the peaks observed near the end points.