compute error of interpolation