
def        A__					(						lowerCamelCase						)  ->	float:
				return 10 - x * x







def        A__					(						lowerCamelCase     ,    lowerCamelCase						)  ->	float:
				# Bolzano theory in order to find if there is a root between a and b
				if equation(lowerCamelCase						) * equation(lowerCamelCase						) >= 0:
								raise ValueError("""Wrong space!"""						)

				UpperCamelCase_:							List[Any]	=						a
				while (b - a) >= 0.01:
								# Find middle point
								UpperCamelCase_:							Tuple	=						(a + b) / 2
								# Check if middle point is root
								if equation(lowerCamelCase						) == 0.0:
												break
								# Decide the side to repeat the steps
								if equation(lowerCamelCase						) * equation(lowerCamelCase						) < 0:
												UpperCamelCase_:							Union[str, Any]	=						c
								else:
												UpperCamelCase_:							List[str]	=						c
				return c


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							print(bisection(-2, 5))
							print(bisection(0, 6))








from sympy import diff, lambdify, symbols
from sympy.functions import *  # noqa: F403







def        A__					(						lowerCamelCase     ,    lowerCamelCase     ,    lowerCamelCase = "x"     ,    lowerCamelCase = 10**-10     ,    lowerCamelCase = 1     ,    )  ->	complex:
				UpperCamelCase_:							Optional[Any]	=						symbols(lowerCamelCase						)
				UpperCamelCase_:							int	=						lambdify(lowerCamelCase     ,    lowerCamelCase						)
				UpperCamelCase_:							Optional[Any]	=						lambdify(lowerCamelCase     ,    diff(lowerCamelCase     ,    lowerCamelCase						)						)

				UpperCamelCase_:							Tuple	=						starting_point

				while True:
								if diff_function(lowerCamelCase						) != 0:
												UpperCamelCase_:							List[Any]	=						prev_guess - multiplicity * func(lowerCamelCase						) / diff_function(
												    lowerCamelCase						)
								else:
												raise ZeroDivisionError("""Could not find root"""						) from None

								# Precision is checked by comparing the difference of consecutive guesses
								if abs(next_guess - prev_guess						) < precision:
												return next_guess

								UpperCamelCase_:							Any	=						next_guess


# 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
							# Find fourth Root of 5
							print(F"""The root of x**4 - 5 = 0 is {newton_raphson('x**4 -5', 0.4 +5J)}""")

							# Find value of e
							print(
							    """The root of log(y) - 1 = 0 is """,
							    F"""{newton_raphson('log(y) - 1', 2, variable='y')}""",
							)

							# Exponential Roots
							print(
							    """The root of exp(x) - 1 = 0 is""",
							    F"""{newton_raphson('exp(x) - 1', 10, precision=0.005)}""",
							)

							# Find root of cos(x)
							print(F"""The root of cos(x) = 0 is {newton_raphson('cos(x)', 0)}""")






