def bisection(func, min_guess, max_guess, err_tolerance):
    """
    Find the root of a function using bisection method. (Bracketing method)
    arguments:
    func: f(x)
    min_guess: minimum x as guess
    max_guess: maximum x as guess
    err_tolerance: value where f(root) must be less than err_tolerance
    """

    x_new = 0.5 * (min_guess + max_guess)
    y_mid = func(x_new)
    print("x_new: ", x_new)
    if abs(y_mid) < err_tolerance:
        return x_new
    else:
        min_guess = x_new if y_mid <= 0 else min_guess
        max_guess = x_new if y_mid > 0 else max_guess
        return bisection(func, min_guess, max_guess, err_tolerance)