






from __future__ import annotations

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

from sympy import diff





def       __lowerCAmelCase      (						__snake_case					, __snake_case					, __snake_case = 10**-10       ):
     __lowerCAmelCase								=					a
     while True:
          __lowerCAmelCase								=					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)}''')














def       __lowerCAmelCase      (						__snake_case					, __snake_case       ):
     if not isinstance(__snake_case					, __snake_case       ):
          raise ValueError("iterations must be defined as integers"       )
     if not isinstance(__snake_case					, __snake_case       ) 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"       )

     __lowerCAmelCase								=					""
     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(__snake_case       )

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


if __name__ == "__main__":
 import doctest

 doctest.testmod()






