Perform interpolation on a function to evaluate it faster.