






"""simple docstring"""



a  :						List[str]					       =							1000




def       snake_case__		(   _SCREAMING_SNAKE_CASE			)    ->float:
 return x * x




def       snake_case__		(   _SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE = 4			)    ->float:
 assert callable(
     _SCREAMING_SNAKE_CASE			), F'''the function(object) passed should be callable your input : {function}'''
 assert isinstance(_SCREAMING_SNAKE_CASE       ,	(float, int)			), F'''a should be float or integer your input : {a}'''
 assert isinstance(function(_SCREAMING_SNAKE_CASE			)       ,	(float, int)			), (
     "the function should return integer or float return type of your function, "
     F'''{type(_SCREAMING_SNAKE_CASE			)}'''
 )
 assert isinstance(_SCREAMING_SNAKE_CASE       ,	(float, int)			), F'''b should be float or integer your input : {b}'''
 assert (
     isinstance(_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE			) 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

 UpperCAmelCase__ 						=				(b - a) / N_STEPS
 UpperCAmelCase__ 						=				function(_SCREAMING_SNAKE_CASE			) + function(_SCREAMING_SNAKE_CASE			)

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

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


if __name__ == "__main__":
 import doctest

 doctest.testmod()











"""simple docstring"""



from math import exp




def       snake_case__		(   _SCREAMING_SNAKE_CASE			)    ->float:
 return 8 * x - 2 * exp(-x			)




def       snake_case__		(   _SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE			)    ->float:
 UpperCAmelCase__ 						=				lower_bound
 UpperCAmelCase__ 						=				upper_bound
 for _ in range(0       ,	_SCREAMING_SNAKE_CASE			):
  UpperCAmelCase__						,	UpperCAmelCase__ 						=				xa, xa - (f(_SCREAMING_SNAKE_CASE			) * (xa - xa)) / (f(_SCREAMING_SNAKE_CASE			) - f(_SCREAMING_SNAKE_CASE			))
 return xa


if __name__ == "__main__":
 print(F'''Example: {secant_method(1, 3, 2)}''')



