


'''simple docstring'''



from __future__ import annotations

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

from sympy import diff



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				str      ,    UpperCAmelCase_    :				float | Decimal      ,    UpperCAmelCase_    :				float = 10**-10							)     ->		float:
     __lowerCamelCase   :	List[str]								=		a
     while True:
          __lowerCamelCase   :	Tuple								=		Decimal(UpperCAmelCase_							) - (
              Decimal(eval(UpperCAmelCase_							)							) / Decimal(eval(str(diff(UpperCAmelCase_							)							)							)							)  # noqa: S307
          )
          # This number dictates the accuracy of the answer
          if abs(eval(UpperCAmelCase_							)							) < precision:  # noqa: S307
               return float(UpperCAmelCase_							)


# 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'''



from math import isqrt



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				int							)     ->		bool:
     return all(number % divisor != 0 for divisor in range(2      ,    isqrt(UpperCAmelCase_							) + 1							)							)



def 			UpperCAmelCase__					(	UpperCAmelCase_    :				int = 10**6							)     ->		int:
     __lowerCamelCase   :	Optional[Any]								=		0
     __lowerCamelCase   :	Optional[int]								=		1
     __lowerCamelCase   :	List[str]								=		7
     while prime_candidate < max_prime:
          primes_count += is_prime(UpperCAmelCase_							)

          cube_index += 1
          prime_candidate += 6 * cube_index

     return primes_count


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






