


from __future__ import annotations
def     __lowerCamelCase						(			UpperCAmelCase_						:		list[int | float]			,  UpperCAmelCase_						:		int			,  UpperCAmelCase_						:		int						):




      """simple docstring"""





      if len(UpperCAmelCase_						) == 0:
            raise ValueError('''find_max() arg is an empty sequence'''						)
      if (
          left >= len(UpperCAmelCase_						)
          or left < -len(UpperCAmelCase_						)
          or right >= len(UpperCAmelCase_						)
          or right < -len(UpperCAmelCase_						)
      ):
            raise IndexError('''list index out of range'''						)
      if left == right:
            return nums[left]
      a						:Optional[Any]										=	(left + right) >> 1  # the middle
      a						:Union[str, Any]										=	find_max(UpperCAmelCase_			,  UpperCAmelCase_			,  UpperCAmelCase_						)  # find max in range[left, mid]
      a						:List[Any]										=	find_max(UpperCAmelCase_			,  mid + 1			,  UpperCAmelCase_						)  # find max in range[mid + 1, right]

      return left_max if left_max >= right_max else right_max


if __name__ == "__main__":
     import doctest

     doctest.testmod(verbose=True)









import math
def     __lowerCamelCase						(			UpperCAmelCase_						:		float			,  UpperCAmelCase_						:		float						):




      """simple docstring"""





      return math.pow(UpperCAmelCase_			,  2						) - a
def     __lowerCamelCase						(			UpperCAmelCase_						:		float						):




      """simple docstring"""





      return 2 * x
def     __lowerCamelCase						(			UpperCAmelCase_						:		float						):




      """simple docstring"""





      a						:int										=	2.0

      while start <= a:
            a						:int										=	math.pow(UpperCAmelCase_			,  2						)

      return start
def     __lowerCamelCase						(			UpperCAmelCase_						:		float			,  UpperCAmelCase_						:		int = 9999			,  UpperCAmelCase_						:		float = 0.00000000000001						):




      """simple docstring"""





      if a < 0:
            raise ValueError('''math domain error'''						)

      a						:List[Any]										=	get_initial_point(UpperCAmelCase_						)

      for _ in range(UpperCAmelCase_						):
            a						:Optional[int]										=	value
            a						:int										=	value - fx(UpperCAmelCase_			,  UpperCAmelCase_						) / fx_derivative(UpperCAmelCase_						)
            if abs(prev_value - value						) < tolerance:
                  return value

      return value


if __name__ == "__main__":
     from doctest import testmod

     testmod()





