Second version of adaptive simpson method