Closed alexbprofit closed 3 years ago
def decomp(a, b, c, p, q, eps): intervals = [] i = p t = 10.0 * eps while i < q: if f(a, b, c, i) * f(a, b, c, i + t) < 0: t = t / 10 i = i + t else: i = i + t if t < eps: intervals.append([i - 3 * t, i + 3 * t]) t = 10 * eps return intervals
def decomp(a, b, c, p, q, eps): intervals = [] i = p t = 10.0 * eps while i < q: if f(a, b, c, i) * f(a, b, c, i + t) < 0: t = t / 10 i = i + t else: i = i + t if t < eps: intervals.append([i - 3 * t, i + 3 * t]) t = 10 * eps return intervals