




"""simple docstring"""

from collections.abc import Callable

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



def   UpperCamelCase__     (		lowercase__  :     Union[str, Any]       ,     lowercase__  :     Optional[int]       ,     lowercase__  :     Optional[int]       ,     ):
		snake_case		:						int								=				float(__A   )
		while True:
				try:
						snake_case		:						Dict								=				prev_guess - function(__A   ) / derivative(__A   )
				except ZeroDivisionError:
						raise ZeroDivisionError("Could not find root"   ) from None
				if abs(prev_guess - next_guess   ) < 10**-5:
						return next_guess
				snake_case		:						Tuple								=				next_guess



def   UpperCamelCase__     (		lowercase__  :     Dict   ):
		return (x**3) - (2 * x) - 5



def   UpperCamelCase__     (		lowercase__  :     Optional[Any]   ):
		return 3 * (x**2) - 2


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







"""simple docstring"""

def   UpperCamelCase__     (		lowercase__  :     int   ):
		if not isinstance(lowercase__       ,     lowercase__   ):
				snake_case		:						Optional[Any]								=				F'''Input value of [number={number}] must be an integer'''
				raise TypeError(lowercase__   )
		if number < 0 or number % 2 == 1:
				return False
		snake_case		:						str								=				int(number**0.5   )
		return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
							import doctest

							doctest.testmod()

