Simpson's Rule calculation for the integral, An, where h is the sampling interval, is given by the recurrence relation: An=An-2+h(yn-2+4yn-1+yn)/3 for n>2 with A0=0. For an even number of points, Simpson's 4/3 rule is used for the final three slices i.e. An=An-3+3h/8(yn-3+3yn-2+3yn-1 +yn)