


from collections.abc import Callable



def       _lowerCAmelCase    (				lowerCAmelCase_				:Callable[[float], float]		,    lowerCAmelCase_				:float		,    lowerCAmelCase_				:float				)->float:
   '''simple docstring'''






   snake_case_            =       a
   snake_case_            =       b
   if function(lowerCAmelCase_				) == 0:  # one of the a or b is a root for the function
      return a
   elif function(lowerCAmelCase_				) == 0:
      return b
   elif (
       function(lowerCAmelCase_				) * function(lowerCAmelCase_				) > 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(lowerCAmelCase_				) == 0:
            return mid
         elif function(lowerCAmelCase_				) * function(lowerCAmelCase_				) < 0:
            snake_case_            =       mid
         else:
            snake_case_            =       mid
         snake_case_            =       start + (end - start) / 2.0
      return mid



def       _lowerCAmelCase    (				lowerCAmelCase_				:float				)->float:
   '''simple docstring'''






   return x**3 - 2 * x - 5


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

   import doctest

   doctest.testmod()








def       _lowerCAmelCase    (				lowerCAmelCase_				:int		,    lowerCAmelCase_				:int				)->int:
   '''simple docstring'''






   return int((input_a, input_a).count(0				) == 0				)



def       _lowerCAmelCase    (				)->None:
   '''simple docstring'''






   assert and_gate(0		,    0				) == 0
   assert and_gate(0		,    1				) == 0
   assert and_gate(1		,    0				) == 0
   assert and_gate(1		,    1				) == 1


if __name__ == "__main__":
   test_and_gate()
   print(and_gate(1, 0))
   print(and_gate(0, 0))
   print(and_gate(0, 1))
   print(and_gate(1, 1))




