text: function to interpolate the given data points using Lagrange 's formula xi corresponds to the new data point whose value is to be obtained n represents the number of known data points
code: function interpolate ( f , xi , n ) {