





"""simple docstring"""



from __future__ import annotations

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

from sympy import diff







def 						__lowercase	(  snake_case_    :    str							,snake_case_    :    float | Decimal							,snake_case_    :    float = 10**-10		)  ->float:



    '''simple docstring'''







    __A       :		Optional[int]							=	a
    while True:
        __A       :		int							=	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)}''')











"""simple docstring"""



def 						__lowercase	(  snake_case_    :    list		)  ->list:



    '''simple docstring'''







    for i in range(len(snake_case_		) - 1							,0							,-1		):
        __A       :		Union[str, Any]							=	False

        for j in range(snake_case_							,0							,-1		):
            if unsorted[j] < unsorted[j - 1]:
                __A					,			__A       :		Union[str, Any]							=	unsorted[j - 1], unsorted[j]
                __A       :		Optional[int]							=	True

        for j in range(snake_case_		):
            if unsorted[j] > unsorted[j + 1]:
                __A					,			__A       :		Optional[Any]							=	unsorted[j + 1], unsorted[j]
                __A       :		Union[str, Any]							=	True

        if not swapped:
            break
    return unsorted


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       a_					=     input("""Enter numbers separated by a comma:\n""").strip()
       a_					=     [int(item) for item in user_input.split(""",""")]
       print(f'''{cocktail_shaker_sort(unsorted) = }''')




