


'''simple docstring'''







def 			lowercase				(_A					):







       """simple docstring"""







       return 1_0 - x * x






def 			lowercase				(_A   ,						_A					):







       """simple docstring"""







       if equation(SCREAMING_SNAKE_CASE_					) * equation(SCREAMING_SNAKE_CASE_					) >= 0:
              raise ValueError('Wrong space!'					)

       _lowerCAmelCase    :							List[str]   			=       a
       while (b - a) >= 0.01:
              # Find middle point
              _lowerCAmelCase    :							Optional[int]   			=       (a + b) / 2
              # Check if middle point is root
              if equation(SCREAMING_SNAKE_CASE_					) == 0.0:
                     break
              # Decide the side to repeat the steps
              if equation(SCREAMING_SNAKE_CASE_					) * equation(SCREAMING_SNAKE_CASE_					) < 0:
                     _lowerCAmelCase    :							Optional[Any]   			=       c
              else:
                     _lowerCAmelCase    :							int   			=       c
       return c


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       print(bisection(-2, 5))
       print(bisection(0, 6))






'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase    :     Any					=						{
    """configuration_x_clip""": [
        """XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """XCLIPConfig""",
        """XCLIPTextConfig""",
        """XCLIPVisionConfig""",
    ],
    """processing_x_clip""": ["""XCLIPProcessor"""],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase    :     Optional[Any]					=						[
           """XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """XCLIPModel""",
           """XCLIPPreTrainedModel""",
           """XCLIPTextModel""",
           """XCLIPVisionModel""",
       ]

if TYPE_CHECKING:
       from .configuration_x_clip import (
           XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
           XCLIPConfig,
           XCLIPTextConfig,
           XCLIPVisionConfig,
       )
       from .processing_x_clip import XCLIPProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_x_clip import (
                  XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
                  XCLIPModel,
                  XCLIPPreTrainedModel,
                  XCLIPTextModel,
                  XCLIPVisionModel,
              )

else:
       import sys

       lowerCAmelCase    :     Dict					=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

