





from ..utils import DummyObject, requires_backends



class    _SCREAMING_SNAKE_CASE						(	metaclass=__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			["torch", "transformers", "onnx"]

 def __init__(self				:   Union[str, Any]       , *UpperCAmelCase_				:   Optional[Any]       , **UpperCAmelCase_				:   Dict)       ->Dict:



   '''simple docstring'''



   requires_backends(self       , ["torch", "transformers", "onnx"])

 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Optional[Any]       , *UpperCAmelCase_				:   Optional[int]       , **UpperCAmelCase_				:   str)       ->Any:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])







 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   List[Any]       , *UpperCAmelCase_				:   Optional[Any]       , **UpperCAmelCase_				:   Optional[Any])       ->Union[str, Any]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])



class    _SCREAMING_SNAKE_CASE						(	metaclass=__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			["torch", "transformers", "onnx"]

 def __init__(self				:   List[str]       , *UpperCAmelCase_				:   Union[str, Any]       , **UpperCAmelCase_				:   Optional[int])       ->Any:



   '''simple docstring'''



   requires_backends(self       , ["torch", "transformers", "onnx"])

 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Tuple       , *UpperCAmelCase_				:   Optional[Any]       , **UpperCAmelCase_				:   Any)       ->List[str]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])







 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Union[str, Any]       , *UpperCAmelCase_				:   int       , **UpperCAmelCase_				:   int)       ->Optional[Any]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])



class    _SCREAMING_SNAKE_CASE						(	metaclass=__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			["torch", "transformers", "onnx"]

 def __init__(self				:   Optional[Any]       , *UpperCAmelCase_				:   Any       , **UpperCAmelCase_				:   int)       ->int:



   '''simple docstring'''



   requires_backends(self       , ["torch", "transformers", "onnx"])

 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Dict       , *UpperCAmelCase_				:   str       , **UpperCAmelCase_				:   List[Any])       ->Union[str, Any]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])







 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Tuple       , *UpperCAmelCase_				:   str       , **UpperCAmelCase_				:   List[Any])       ->str:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])



class    _SCREAMING_SNAKE_CASE						(	metaclass=__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			["torch", "transformers", "onnx"]

 def __init__(self				:   Dict       , *UpperCAmelCase_				:   Dict       , **UpperCAmelCase_				:   Optional[int])       ->Union[str, Any]:



   '''simple docstring'''



   requires_backends(self       , ["torch", "transformers", "onnx"])

 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Optional[Any]       , *UpperCAmelCase_				:   Tuple       , **UpperCAmelCase_				:   List[str])       ->int:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])







 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Dict       , *UpperCAmelCase_				:   str       , **UpperCAmelCase_				:   str)       ->List[str]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])



class    _SCREAMING_SNAKE_CASE						(	metaclass=__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			["torch", "transformers", "onnx"]

 def __init__(self				:   int       , *UpperCAmelCase_				:   str       , **UpperCAmelCase_				:   Optional[int])       ->Dict:



   '''simple docstring'''



   requires_backends(self       , ["torch", "transformers", "onnx"])

 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   str       , *UpperCAmelCase_				:   int       , **UpperCAmelCase_				:   Optional[int])       ->List[str]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])







 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Optional[Any]       , *UpperCAmelCase_				:   str       , **UpperCAmelCase_				:   Dict)       ->Union[str, Any]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])



class    _SCREAMING_SNAKE_CASE						(	metaclass=__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			["torch", "transformers", "onnx"]

 def __init__(self				:   Dict       , *UpperCAmelCase_				:   Tuple       , **UpperCAmelCase_				:   Tuple)       ->Dict:



   '''simple docstring'''



   requires_backends(self       , ["torch", "transformers", "onnx"])

 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   Dict       , *UpperCAmelCase_				:   str       , **UpperCAmelCase_				:   Tuple)       ->Union[str, Any]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])







 @classmethod
 def 							SCREAMING_SNAKE_CASE_					(cls				:   str       , *UpperCAmelCase_				:   str       , **UpperCAmelCase_				:   int)       ->Optional[int]:



   '''simple docstring'''



   requires_backends(cls       , ["torch", "transformers", "onnx"])








from __future__ import annotations

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

from sympy import diff





def      lowerCAmelCase_ (       __a	,    __a	,    __a = 10**-10		)     ->		float:







  """simple docstring"""





  lowerCamelCase__:      str			  =a
  while True:
    lowerCamelCase__:      Optional[Any]			  =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)}')

