






def     _snake_case    (__lowercase):
   UpperCamelCase_									=     len(__lowercase)
   for i in range(1    ,      __lowercase):
      UpperCamelCase_									=     collection[i]
      UpperCamelCase_									=     0
      UpperCamelCase_									=     i - 1

      while low <= high:
         UpperCamelCase_									=     (low + high) // 2
         if val < collection[mid]:
            UpperCamelCase_									=     mid - 1
         else:
            UpperCamelCase_									=     mid + 1
      for j in range(__lowercase    ,      __lowercase    ,      -1):
         UpperCamelCase_									=     collection[j - 1]
      UpperCamelCase_									=     val
   return collection


if __name__ == "__main__":
 snake_case__      :	Union[str, Any]       	=      input("""Enter numbers separated by a comma:\n""").strip()
 snake_case__      :	Any       	=      [int(item) for item in user_input.split(""",""")]
 print(binary_insertion_sort(unsorted))













from sympy import diff, lambdify, symbols
from sympy.functions import *  # noqa: F403






def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase = "x"    ,      __lowercase = 10**-10    ,      __lowercase = 1    ,      ):
   UpperCamelCase_									=     symbols(__lowercase)
   UpperCamelCase_									=     lambdify(__lowercase    ,      __lowercase)
   UpperCamelCase_									=     lambdify(__lowercase    ,      diff(__lowercase    ,      __lowercase))

   UpperCamelCase_									=     starting_point

   while True:
      if diff_function(__lowercase) != 0:
         UpperCamelCase_									=     prev_guess - multiplicity * func(__lowercase) / diff_function(
             __lowercase)
      else:
         raise ZeroDivisionError('Could not find root') from None

      # Precision is checked by comparing the difference of consecutive guesses
      if abs(next_guess - prev_guess) < precision:
         return next_guess

      UpperCamelCase_									=     next_guess


# 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
 # Find fourth Root of 5
 print(f'The root of x**4 - 5 = 0 is {newton_raphson("x**4 -5", 0.4 +5J)}')

 # Find value of e
 print(
     """The root of log(y) - 1 = 0 is """,
     f'{newton_raphson("log(y) - 1", 2, variable="y")}',
 )

 # Exponential Roots
 print(
     """The root of exp(x) - 1 = 0 is""",
     f'{newton_raphson("exp(x) - 1", 1_0, precision=0.005)}',
 )

 # Find root of cos(x)
 print(f'The root of cos(x) = 0 is {newton_raphson("cos(x)", 0)}')





