

import re







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

			return docstring_decorator


from collections.abc import Callable

lowercase     :       Optional[Any]        =       Callable[[float], float]  # type alias for a real -> real function







def  UpperCAmelCase_   (_lowerCAmelCase :		RealFunc     ,			_lowerCAmelCase :		RealFunc     ,			_lowerCAmelCase :		int     ,			):
			__UpperCamelCase    :    Any								=      float(_lowerCAmelCase		)
			while True:
						try:
									__UpperCamelCase    :    List[Any]								=      prev_guess - function(_lowerCAmelCase		) / derivative(_lowerCAmelCase		)
						except ZeroDivisionError:
									raise ZeroDivisionError("Could not find root"		) from None
						if abs(prev_guess - next_guess		) < 10**-5:
									return next_guess
						__UpperCamelCase    :    Tuple								=      next_guess







def  UpperCAmelCase_   (_lowerCAmelCase :		float		):
			return (x**3) - (2 * x) - 5







def  UpperCAmelCase_   (_lowerCAmelCase :		float		):
			return 3 * (x**2) - 2


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