Could the time complexity of this definite integral algorithm be improved?
import numpy as np
def integral(f, left, right, epsilon):
w = int((right-left)/epsilon)
domain = np.linspace(left, right, w)
heights = [f(((a+b)*0.5)) for a, b in zip(domain[:-1], domain[1:])]
return sum(heights)*epsilon
# Test an example
print('Result:', integral(lambda x: np.sin(x), 1, 10, 0.01))