





from __future__ import annotations

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

from sympy import diff







def       UpperCAmelCase							(     _lowerCamelCase      :  str			,   _lowerCamelCase      :  float | Decimal			,   _lowerCamelCase      :  float = 10**-10     ):





						'''simple docstring'''


						SCREAMING_SNAKE_CASE__     :				Tuple   =					a
						while True:
												SCREAMING_SNAKE_CASE__     :				Tuple   =					Decimal(a_     ) - (
												    Decimal(eval(a_     )     ) / Decimal(eval(str(diff(a_     )     )     )     )  # noqa: S307
												)
												# This number dictates the accuracy of the answer
												if abs(eval(a_     )     ) < precision:  # noqa: S307
																		return float(a_     )


# 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)}")










def       UpperCAmelCase							(     _lowerCamelCase      :  int = 1_000     ):





						'''simple docstring'''


						SCREAMING_SNAKE_CASE__     :				Dict   =					-1
						SCREAMING_SNAKE_CASE__     :				str   =					0
						for a in range(1			,   n // 3     ):
												# Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c
												SCREAMING_SNAKE_CASE__     :				Tuple   =					(n * n - 2 * a * n) // (2 * n - 2 * a)
												SCREAMING_SNAKE_CASE__     :				Dict   =					n - a - b
												if c * c == (a * a + b * b):
																		SCREAMING_SNAKE_CASE__     :				str   =					a * b * c
																		if candidate >= product:
																								SCREAMING_SNAKE_CASE__     :				List[str]   =					candidate
						return product


if __name__ == "__main__":
				print(f"{solution() = }")