def METHOD_NAME(
    f: "Expression",
    x0: "Expression",
    x: "Expression",
    opts: dict,
    evaluation: "Evaluation",
) -> (Number, bool):
    """
    This implements the Brent's solver
    """
    comp_fun = compile_fn(f, x, opts, evaluation)
    boundary = opts.get("_x0", None)
    if boundary and len(boundary) == 2:
        a, b = sorted(u.to_python() for u in boundary)
    else:
        x0 = eval_N(x0, evaluation)
        b = abs(x0.to_python())
        b = 1 if b == 0 else b
        a = -b
    if not isinstance(comp_fun(a), float):
        evaluation.message("FindRoot", "nnum", x, x0)
        return SymbolFailed, False
    tol, maxit = get_tolerance_and_maxit(opts, b - a, evaluation)
    try:
        result = root_scalar(
            comp_fun,
            bracket=(a, b),
            method="brenth",
            xtol=tol,
            options={"maxiter": maxit},
        )
    except ValueError:
        evaluation.message("FindRoot", "brnts", a, b)
        return SymbolFailed, False
    except TypeError:
        evaluation.message("FindRoot", "nnum", x, x0)
        return SymbolFailed, False
    return process_result_1d_solver(result, opts, evaluation)