Learning Trapezoidal rule