



from ..utils import requires_backends


UpperCAmelCase							=       None

class 			__snake_case   :







							'''simple docstring'''






							def __init__(				self	,	*a_	,	**a_		):
											requires_backends(self	,	["""detectron2"""]		)







							@classmethod
							def _a   (				cls	,	*a_	,	**a_		):
											requires_backends(cls	,	["""detectron2"""]		)






from collections.abc import Callable

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





def 		__snake_case						(    _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			):
					"""simple docstring"""






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





def 		__snake_case						(    _UpperCAmelCase				):
					"""simple docstring"""






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





def 		__snake_case						(    _UpperCAmelCase				):
					"""simple docstring"""






					return 3 * (x**2) - 2


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






