def _discretize_linear(fun, a, b, tol=0.005, n=5):