# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405
r"""
1D root-finding methods: bisection, solve_secant, Illinois.
"""

import typing
__all__ = [
    "bisect",
    "bisect_tracked",
    "bracket_grid",
    "solve_illinois",
    "solve_illinois_tracked",
    "solve_secant",
    "solve_secant_tracked",
]

def bisect(f: typing.Callable[[float], float], lo: float, hi: float, tol: float = 0.0000000001, max_iter: int = 100) -> tuple[float, str, int]:
    r"""
    Bisection root-finding.
    
    :param f: Function to find the root of (takes float, returns float).
    :param lo: Lower bound of the search interval.
    :param hi: Upper bound of the search interval.
    :param tol: Convergence tolerance (default 1e-10).
    :param max_iter: Maximum iterations (default 100).
    :returns: ``(root, status_string, iteration_count)``.
    """

def bisect_tracked(f: typing.Any, lo: float, hi: float, tol: float = 0.0000000001, max_iter: int = 100) -> tuple[float, str, int, list[float]]:
    r"""
    Tracked bisection root-finding.
    
    :param f: Function to find the root of.
    :param lo: Lower bound of the search interval.
    :param hi: Upper bound of the search interval.
    :param tol: Convergence tolerance.
    :param max_iter: Maximum number of iterations.
    :returns: ``(root, status_string, iteration_count, history)``.
    """

def bracket_grid(f: typing.Callable[[float], float], heading: float, max_deflection: float) -> tuple[float, str, int]:
    r"""
    7-sample angular grid search with linear interpolation.
    
    Samples *f* at ``heading + max_deflection * ratio`` for
    7 ratios evenly spaced across ``[-1, -0.6, -0.2, 0, 0.2, 0.6, 1.0]``.
    When a sign change is found between adjacent samples the root is
    linearly interpolated.  Falls back to the sample with smallest
    absolute error.
    
    :param f: Error function *f(angle) -> error*.
    :param heading: Centre angle in radians.
    :param max_deflection: Maximum angular spread in radians.
    :returns: ``(root, status_string, sample_count)``.
    """

def solve_illinois(f: typing.Callable[[float], float], lo: float, hi: float, tol: float = 0.0000000001, max_iter: int = 100) -> tuple[float, str, int]:
    r"""
    Illinois (safeguarded false-position) root-finding.
    
    :param f: Function to find the root of (takes float, returns float).
    :param lo: Lower bound of the search interval.
    :param hi: Upper bound of the search interval.
    :param tol: Convergence tolerance (default 1e-10).
    :param max_iter: Maximum iterations (default 100).
    :returns: ``(root, status_string, iteration_count)``.
    """

def solve_illinois_tracked(f: typing.Any, lo: float, hi: float, tol: float = 0.0000000001, max_iter: int = 100) -> tuple[float, str, int, list[float]]:
    r"""
    Tracked Illinois method root-finding.
    
    :param f: Function to find the root of.
    :param lo: Lower bound of the search interval.
    :param hi: Upper bound of the search interval.
    :param tol: Convergence tolerance.
    :param max_iter: Maximum number of iterations.
    :returns: ``(root, status_string, iteration_count, history)``.
    """

def solve_secant(f: typing.Callable[[float], float], x0: float, x1: float, tol: float = 0.0000000001, max_iter: int = 100) -> tuple[float, str, int]:
    r"""
    Secant root-finding.
    
    :param f: Function to find the root of (takes float, returns float).
    :param x0: First initial guess.
    :param x1: Second initial guess.
    :param tol: Convergence tolerance (default 1e-10).
    :param max_iter: Maximum iterations (default 100).
    :returns: ``(root, status_string, iteration_count)``.
    """

def solve_secant_tracked(f: typing.Any, x0: float, x1: float, tol: float = 0.0000000001, max_iter: int = 100) -> tuple[float, str, int, list[float]]:
    r"""
    Tracked solve_secant method root-finding.
    
    :param f: Function to find the root of.
    :param x0: First initial guess.
    :param x1: Second initial guess.
    :param tol: Convergence tolerance.
    :param max_iter: Maximum number of iterations.
    :returns: ``(root, status_string, iteration_count, history)``.
    """

