
from collections.abc import Callable






def 				UpperCAmelCase_						(				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE					,				__SCREAMING_SNAKE_CASE				):
	lowercase	    =       a
	lowercase	    =       b
	if function(__SCREAMING_SNAKE_CASE				) == 0:  # one of the a or b is a root for the function
		return a
	elif function(__SCREAMING_SNAKE_CASE				) == 0:
		return b
	elif (
	    function(__SCREAMING_SNAKE_CASE				) * function(__SCREAMING_SNAKE_CASE				) > 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:
		lowercase	    =       start + (end - start) / 2.0
		while abs(start - mid				) > 10**-7:  # until precisely equals to 10^-7
			if function(__SCREAMING_SNAKE_CASE				) == 0:
				return mid
			elif function(__SCREAMING_SNAKE_CASE				) * function(__SCREAMING_SNAKE_CASE				) < 0:
				lowercase	    =       mid
			else:
				lowercase	    =       mid
			lowercase	    =       start + (end - start) / 2.0
		return mid






def 				UpperCAmelCase_						(				__SCREAMING_SNAKE_CASE				):
	return x**3 - 2 * x - 5


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

	import doctest

	doctest.testmod()





from __future__ import annotations





def 						_lowerCAmelCase							(     _lowerCAmelCase			)    ->						list[int]:


						'''simple docstring'''






						__snake_case				=		2
						__snake_case				=		[]
						while i * i <= n:
												if n % i:
																		i += 1
												else:
																		n //= i
																		factors.append(_lowerCAmelCase			)
						if n > 1:
												factors.append(_lowerCAmelCase			)
						return factors


if __name__ == "__main__":
	import doctest

	doctest.testmod()





