Simpson’s generalized inequality and applications