[math-fun] enhanced trapezoidal rule