





from collections.abc import Callable





def 						lowerCamelCase__     (     UpperCamelCase__			:       Callable[[float], float]       ,    UpperCamelCase__			:       float       ,    UpperCamelCase__			:       float						)			-> float:



					'''simple docstring'''




					_snake_case									=				a
					_snake_case									=				b
					if function(UpperCamelCase__						) == 0:  # one of the a or b is a root for the function
										return a
					elif function(UpperCamelCase__						) == 0:
										return b
					elif (
					    function(UpperCamelCase__						) * function(UpperCamelCase__						) > 0
					):  # if none of these are root and they are both positive or negative,
										# then this algorithm can't find the root
										raise ValueError('could not find root in given interval.'						)
					else:
										_snake_case									=				start + (end - start) / 2.0
										while abs(start - mid						) > 10**-7:  # until precisely equals to 10^-7
															if function(UpperCamelCase__						) == 0:
																				return mid
															elif function(UpperCamelCase__						) * function(UpperCamelCase__						) < 0:
																				_snake_case									=				mid
															else:
																				_snake_case									=				mid
															_snake_case									=				start + (end - start) / 2.0
										return mid





def 						lowerCamelCase__     (     UpperCamelCase__			:       float						)			-> float:



					'''simple docstring'''




					return x**3 - 2 * x - 5


if __name__ == "__main__":
					print(bisection(f, 1, 1000))

					import doctest

					doctest.testmod()










def 						lowerCamelCase__     (     UpperCamelCase__			:       List[Any]       ,    UpperCamelCase__			:       Dict       ,    UpperCamelCase__			:       str       ,    UpperCamelCase__			:       int       ,    UpperCamelCase__			:       List[str]       ,    UpperCamelCase__			:       str						)			-> List[Any]:



					'''simple docstring'''




					if index == r:
										for j in range(UpperCamelCase__						):
															print(data[j]       ,    end=' '						)
										print(' '						)
										return
					#  When no more elements are there to put in data[]
					if i >= n:
										return
					# current is included, put next at next location
					_snake_case									=				arr[i]
					combination_util(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    index + 1       ,    UpperCamelCase__       ,    i + 1						)
					# current is excluded, replace it with
					# next (Note that i+1 is passed, but
					# index is not changed)
					combination_util(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    i + 1						)
					# The main function that prints all combinations
					# of size r in arr[] of size n. This function
					# mainly uses combinationUtil()





def 						lowerCamelCase__     (     UpperCamelCase__			:       Optional[int]       ,    UpperCamelCase__			:       Tuple       ,    UpperCamelCase__			:       List[str]						)			-> Tuple:



					'''simple docstring'''




					_snake_case									=				[0] * r
					# Print all combination using temporary array 'data[]'
					combination_util(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    0       ,    UpperCamelCase__       ,    0						)


if __name__ == "__main__":
					# Driver code to check the function above
					UpperCAmelCase_      							=     [10, 20, 30, 40, 50]
					print_combination(arr, len(arr), 3)
					# This code is contributed by Ambuj sahu



