

'''simple docstring'''



from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff
def 						__lowerCamelCase	(       __snake_case					:		str,		__snake_case					:		float | Decimal,		__snake_case					:		float = 10**-10	)	->							float:






						"""simple docstring"""





						A__					:       List[Any]     =a
						while True:
												A__					:       Dict     =Decimal(__snake_case	) - (
												    Decimal(eval(__snake_case	)	) / Decimal(eval(str(diff(__snake_case	)	)	)	)  # noqa: S307
												)
												# This number dictates the accuracy of the answer
												if abs(eval(__snake_case	)	) < precision:  # noqa: S307
																		return float(__snake_case	)


# Let's Execute
if __name__ == "__main__":
						# Find root of trigonometric function
						# Find value of pi
						print(F"""The root of sin(x) = 0 is {newton_raphson('sin(x)', 2)}""")
						# Find root of polynomial
						print(F"""The root of x**2 - 5*x + 2 = 0 is {newton_raphson('x**2 - 5*x + 2', 0.4)}""")
						# Find Square Root of 5
						print(F"""The root of log(x) - 1 = 0 is {newton_raphson('log(x) - 1', 2)}""")
						# Exponential Roots
						print(F"""The root of exp(x) - 1 = 0 is {newton_raphson('exp(x) - 1', 0)}""")




'''simple docstring'''



def 						__lowerCamelCase	(       __snake_case					:		int	)	->							bool:






						"""simple docstring"""





						if p < 2:
												raise ValueError("""p should not be less than 2!"""	)
						elif p == 2:
												return True

						A__					:       Any     =4
						A__					:       int     =(1 << p) - 1
						for _ in range(p - 2	):
												A__					:       Dict     =((s * s) - 2) % m
						return s == 0


if __name__ == "__main__":
		print(lucas_lehmer_test(7))
		print(lucas_lehmer_test(11))

