



'''simple docstring'''






from collections.abc import Callable




def     snake_case_					(     lowerCAmelCase_       ,   lowerCAmelCase_       ,   lowerCAmelCase_		)->		float:





       '''simple docstring'''


       _UpperCAmelCase  :						float			     = a
       _UpperCAmelCase  :						float			     = 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:
              _UpperCAmelCase  :						float			     = 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:
                            _UpperCAmelCase  :						Any			     = mid
                     else:
                            _UpperCAmelCase  :						Union[str, Any]			     = mid
                     _UpperCAmelCase  :						List[str]			     = start + (end - start) / 2.0
              return mid




def     snake_case_					(     lowerCAmelCase_		)->		float:





       '''simple docstring'''


       return x**3 - 2 * x - 5


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

   import doctest

   doctest.testmod()








'''simple docstring'''






from __future__ import annotations

import typing
from collections import Counter




def     snake_case_					(     lowerCAmelCase_		)->		typing.Counter[int]:





       '''simple docstring'''


       _UpperCAmelCase  :						typing.Counter[int]			     = Counter()
       for base in range(1       ,   max_perimeter + 1		):
              for perpendicular in range(lowerCAmelCase_       ,   max_perimeter + 1		):
                     _UpperCAmelCase  :						List[str]			     = (base * base + perpendicular * perpendicular) ** 0.5
                     if hypotenuse == int(lowerCAmelCase_		):
                            _UpperCAmelCase  :						Optional[Any]			     = int(base + perpendicular + hypotenuse		)
                            if perimeter > max_perimeter:
                                   continue
                            triplets[perimeter] += 1
       return triplets




def     snake_case_					(     lowerCAmelCase_ = 1000		)->		int:





       '''simple docstring'''


       _UpperCAmelCase  :						int			     = pythagorean_triple(lowerCAmelCase_		)
       return triplets.most_common(1		)[0][0]


if __name__ == "__main__":
   print(f"""Perimeter {solution()} has maximum solutions""")



