A generalization of the modified Simpson's rule and error bounds