

def   _lowerCAmelCase(						__A      ):
  if not isinstance(__A ,							__A      ):
    raise ValueError("Input series is not valid, valid series - [1, 2/3, 2]"      )
  if len(__A      ) == 0:
    raise ValueError("Input list must be a non empty list"      )
  if len(__A      ) == 1 and series[0] != 0:
    return True
  UpperCAmelCase          =	[]
  UpperCAmelCase          =	len(__A      )
  for i in range(0 ,							__A      ):
    if series[i] == 0:
      raise ValueError("Input series cannot have 0 as an element"      )
    rec_series.append(1 / series[i]      )
  UpperCAmelCase          =	rec_series[1] - rec_series[0]
  for index in range(2 ,							__A      ):
    if rec_series[index] - rec_series[index - 1] != common_diff:
      return False
  return True
def   _lowerCAmelCase(						__A      ):
  if not isinstance(__A ,							__A      ):
    raise ValueError("Input series is not valid, valid series - [2, 4, 6]"      )
  if len(__A      ) == 0:
    raise ValueError("Input list must be a non empty list"      )
  UpperCAmelCase          =	0
  for val in series:
    answer += 1 / val
  return len(__A      ) / answer


if __name__ == "__main__":
      import doctest

      doctest.testmod()




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()




