


'''simple docstring'''

from __future__ import annotations





def __snake_case      (   UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int	):
 if b == 0:
  return (1, 0)
 ((lowerCamelCase_)				,(lowerCamelCase_))  				=						extended_euclid(UpperCAmelCase_      ,       a % b	)
 lowerCamelCase_  				=						a // b
 return (y, x - k * y)





def __snake_case      (   UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int	):
 ((lowerCamelCase_)				,(lowerCamelCase_))  				=						extended_euclid(UpperCAmelCase_      ,       UpperCAmelCase_	)
 lowerCamelCase_  				=						na * na
 lowerCamelCase_  				=						ra * x * na + ra * y * na
 return (n % m + m) % m





def __snake_case      (   UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int	):
 ((lowerCamelCase_)				,(lowerCamelCase_))  				=						extended_euclid(UpperCAmelCase_      ,       UpperCAmelCase_	)
 if b < 0:
  lowerCamelCase_  				=						(b % n + n) % n
 return b





def __snake_case      (   UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int      ,       UpperCAmelCase_		:		int	):
 lowerCamelCase_				,lowerCamelCase_  				=						invert_modulo(UpperCAmelCase_      ,       UpperCAmelCase_	), invert_modulo(UpperCAmelCase_      ,       UpperCAmelCase_	)
 lowerCamelCase_  				=						na * na
 lowerCamelCase_  				=						ra * x * na + ra * y * na
 return (n % m + m) % m


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

 testmod(name="""chinese_remainder_theorem""", verbose=True)
 testmod(name="""chinese_remainder_theorem2""", verbose=True)
 testmod(name="""invert_modulo""", verbose=True)
 testmod(name="""extended_euclid""", verbose=True)







'''simple docstring'''

import math





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





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





def __snake_case      (   UpperCAmelCase_		:		float	):
 lowerCamelCase_  				=						2.0

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

 return start





def __snake_case      (   UpperCAmelCase_		:		float      ,       UpperCAmelCase_		:		int = 9999      ,       UpperCAmelCase_		:		float = 0.00_0000_0000_0001	):

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

 lowerCamelCase_  				=						get_initial_point(UpperCAmelCase_	)

 for _ in range(UpperCAmelCase_	):
  lowerCamelCase_  				=						value
  lowerCamelCase_  				=						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()



