





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

def    A__(		__lowerCAmelCase						,      __lowerCAmelCase						,      __lowerCAmelCase = "x"						,      __lowerCAmelCase = 10**-10						,      __lowerCAmelCase = 1						,      ):
				_snake_case			:      List[str]	    = symbols(lowerCAmelCase_			)
				_snake_case			:      str	    = lambdify(lowerCAmelCase_						,      lowerCAmelCase_			)
				_snake_case			:      List[str]	    = lambdify(lowerCAmelCase_						,      diff(lowerCAmelCase_						,      lowerCAmelCase_			)			)

				_snake_case			:      str	    = starting_point

				while True:
								if diff_function(lowerCAmelCase_			) != 0:
												_snake_case			:      Optional[int]	    = 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

								_snake_case			:      Union[str, 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)}''')










def       _lowerCAmelCase    (				lowerCAmelCase_				:int		,    lowerCAmelCase_				:int				)->str:
   '''simple docstring'''






   if not isinstance(lowerCAmelCase_		,    lowerCAmelCase_				):
      raise ValueError("iterations must be defined as integers"				)
   if not isinstance(lowerCAmelCase_		,    lowerCAmelCase_				) or not number >= 1:
      raise ValueError(
          "starting number must be\n                         and integer and be more than 0"				)
   if not iterations >= 1:
      raise ValueError("Iterations must be done more than 0 times to play FizzBuzz"				)

   snake_case_            =       ""
   while number <= iterations:
      if number % 3 == 0:
         out += "Fizz"
      if number % 5 == 0:
         out += "Buzz"
      if 0 not in (number % 3, number % 5):
         out += str(lowerCAmelCase_				)

      # print(out)
      number += 1
      out += " "
   return out


if __name__ == "__main__":
   import doctest

   doctest.testmod()




