





"""simple docstring"""




def 		UpperCAmelCase__						(	_UpperCAmelCase					,   _UpperCAmelCase   ):






  """simple docstring"""





  A_    :			Any									=    1
  while b > 0:
    if b & 1:
      res *= a

    a *= a
    b >>= 1

  return res





def 		UpperCAmelCase__						(	_UpperCAmelCase					,   _UpperCAmelCase					,   _UpperCAmelCase   ):






  """simple docstring"""





  A_    :			List[str]									=    1
  while b > 0:
    if b & 1:
      A_    :			int									=    ((res % c) * (a % c)) % c

    a *= a
    b >>= 1

  return res
lowerCAmelCase      :				Union[str, Any]     			=1000







def     A__	(       __A						):







    '''simple docstring'''
    return x * x







def     A__	(       __A ,			__A ,			__A ,			__A = 4						):







    '''simple docstring'''
    assert callable(
        __A						), F"""the function(object) passed should be callable your input : {function}"""
    assert isinstance(__A ,			(float, int)						), F"""a should be float or integer your input : {a}"""
    assert isinstance(function(__A						) ,			(float, int)						), (
        "the function should return integer or float return type of your function, "
        F"""{type(__A						)}"""
    )
    assert isinstance(__A ,			(float, int)						), F"""b should be float or integer your input : {b}"""
    assert (
        isinstance(__A ,			__A						) and precision > 0
    ), F"""precision should be positive integer your input : {precision}"""

    # just applying the formula of simpson for approximate integration written in
    # mentioned article in first comment of this file and above this function

    _lowerCamelCase  :		Optional[Any]			    =    (b - a) / N_STEPS
    _lowerCamelCase  :		str			    =    function(__A						) + function(__A						)

    for i in range(1 ,			__A						):
        _lowerCamelCase  :		str			    =    a + h * i
        result += function(__A						) * (4 if i % 2 else 2)

    result *= h / 3
    return round(__A ,			__A						)


if __name__ == "__main__":
    import doctest

    doctest.testmod()




