


from __future__ import annotations

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

from sympy import diff

def       lowercase_		(		_A			:    Dict    ,					_A			:    List[Any]    ,					_A			:    int = 10**-10						):

      """simple docstring"""




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



from ..utils import DummyObject, requires_backends




class    _UpperCamelCase      (						metaclass=_UpperCAmelCase ):


			"""simple docstring"""






			__a  : Dict			 =						['''keras_nlp''']





			def __init__(   self      ,   *lowerCAmelCase__      ,   **lowerCAmelCase__						)     ->					Tuple:

							'''simple docstring'''


							requires_backends(self      ,   ['''keras_nlp''']						)