maths.numerical_analysis.bisection ================================== .. py:module:: maths.numerical_analysis.bisection Functions --------- .. autoapisummary:: maths.numerical_analysis.bisection.bisection maths.numerical_analysis.bisection.f Module Contents --------------- .. py:function:: bisection(function: collections.abc.Callable[[float], float], a: float, b: float) -> float finds where function becomes 0 in [a,b] using bolzano >>> bisection(lambda x: x ** 3 - 1, -5, 5) 1.0000000149011612 >>> bisection(lambda x: x ** 3 - 1, 2, 1000) Traceback (most recent call last): ... ValueError: could not find root in given interval. >>> bisection(lambda x: x ** 2 - 4 * x + 3, 0, 2) 1.0 >>> bisection(lambda x: x ** 2 - 4 * x + 3, 2, 4) 3.0 >>> bisection(lambda x: x ** 2 - 4 * x + 3, 4, 1000) Traceback (most recent call last): ... ValueError: could not find root in given interval. .. py:function:: f(x: float) -> float