






'''simple docstring'''







from collections.abc import Callable

__lowerCAmelCase					   =       Callable[[float], float]  # type alias for a real -> real function


def 			__UpperCamelCase				(			lowercase_					:     RealFunc      ,					lowercase_					:     RealFunc      ,					lowercase_					:     int      ,					):
       """simple docstring"""




       a_	    = float(lowercase_      )
       while True:
              try:
                     a_	    = prev_guess - function(lowercase_      ) / derivative(lowercase_      )
              except ZeroDivisionError:
                     raise ZeroDivisionError('Could not find root'      ) from None
              if abs(prev_guess - next_guess      ) < 10**-5:
                     return next_guess
              a_	    = next_guess


def 			__UpperCamelCase				(			lowercase_					:     float      ):
       """simple docstring"""




       return (x**3) - (2 * x) - 5


def 			__UpperCamelCase				(			lowercase_					:     float      ):
       """simple docstring"""




       return 3 * (x**2) - 2


if __name__ == "__main__":
  print(newton(f, fa, 3))












'''simple docstring'''







import re


def 			__UpperCamelCase				(			lowercase_					:     int      ):
       """simple docstring"""




       def docstring_decorator(lowercase_					:     int      ):
              a_	    = fn.__doc__
              a_	    = func_doc.split('\n'      )
              a_	    = 0
              while i < len(lowercase_      ) and re.search(R'^\s*Examples?:\s*$'      ,					lines[i]      ) is None:
                     i += 1
              if i < len(lowercase_      ):
                     a_	    = example_docstring
                     a_	    = '\n'.join(lowercase_      )
              else:
                     raise ValueError(
                         F'The function {fn} should have an empty \'Examples:\' in its docstring as placeholder, '
                         F'current docstring is:\n{func_doc}'      )
              a_	    = func_doc
              return fn

       return docstring_decorator




