


from collections.abc import Callable





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





	"""simple docstring"""







	A								=				a
	A								=				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:
		A								=				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:
				A								=				mid
			else:
				A								=				mid
			A								=				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()







import math





def   _lowerCAmelCase				(   UpperCamelCase__:     int						) ->   bool:





	"""simple docstring"""







	if 1 < number < 4:
		# 2 and 3 are primes
		return True
	elif number < 2 or number % 2 == 0 or number % 3 == 0:
		# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
		return False

	# All primes number are in format of 6k +/- 1
	for i in range(5							,					int(math.sqrt(UpperCamelCase__						) + 1						)							,					6						):
		if number % i == 0 or number % (i + 2) == 0:
			return False
	return True





def   _lowerCAmelCase				(   UpperCamelCase__:     float = 0.1						) ->   int:





	"""simple docstring"""







	A								=				3
	A								=				3

	while primes / (2 * j - 1) >= ratio:
		for i in range(j * j + j + 1							,					(j + 2) * (j + 2)							,					j + 1						):
			primes += is_prime(UpperCamelCase__						)
		j += 2
	return j


if __name__ == "__main__":
				import doctest

				doctest.testmod()



