* functions.r: implemented Simpson's rule