

from math import isclose, sqrt






def    SCREAMING_SNAKE_CASE__       (  lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__			)  ->     tuple[float, float, float]:
	__lowerCamelCase				:				Tuple					       = point_y / 4 / point_x
	__lowerCamelCase				:				Tuple					       = 2 * normal_gradient / (1 + normal_gradient * normal_gradient)
	__lowerCamelCase				:				List[Any]					       = (1 - normal_gradient * normal_gradient) / (
	    1 + normal_gradient * normal_gradient
	)
	__lowerCamelCase				:				int					       = (sa - ca * incoming_gradient) / (ca + sa * incoming_gradient)

	# to find the next point, solve the simultaeneous equations:
	# y^2 + 4x^2 = 100
	# y - b = m * (x - a)
	# ==> A x^2 + B x + C = 0
	__lowerCamelCase				:				Any					       = outgoing_gradient**2 + 4
	__lowerCamelCase				:				Optional[int]					       = 2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
	__lowerCamelCase				:				str					       = (point_y - outgoing_gradient * point_x) ** 2 - 1_0_0

	__lowerCamelCase				:				str					       = (
	    -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term			)
	) / (2 * quadratic_term)
	__lowerCamelCase				:				Optional[Any]					       = (
	    -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term			)
	) / (2 * quadratic_term)

	# two solutions, one of which is our input point
	__lowerCamelCase				:				Optional[Any]					       = x_minus if isclose(lowerCamelCase__	, lowerCamelCase__			) else x_plus
	__lowerCamelCase				:				Tuple					       = point_y + outgoing_gradient * (next_x - point_x)

	return next_x, next_y, outgoing_gradient






def    SCREAMING_SNAKE_CASE__       (  lowerCamelCase__ = 1.4	, lowerCamelCase__ = -9.6			)  ->     int:
	__lowerCamelCase				:				int					       = 0
	__lowerCamelCase				:				float					       = first_x_coord
	__lowerCamelCase				:				float					       = first_y_coord
	__lowerCamelCase				:				float					       = (10.1 - point_y) / (0.0 - point_x)

	while not (-0.01 <= point_x <= 0.01 and point_y > 0):
		__lowerCamelCase       , __lowerCamelCase       , __lowerCamelCase				:				Any					       = next_point(lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__			)
		num_reflections += 1

	return num_reflections


if __name__ == "__main__":
					print(F"""{solution() = }""")









from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


SCREAMING_SNAKE_CASE_:str             =						{
    """configuration_transfo_xl""": ["""TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP""", """TransfoXLConfig"""],
    """tokenization_transfo_xl""": ["""TransfoXLCorpus""", """TransfoXLTokenizer"""],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     SCREAMING_SNAKE_CASE_:Union[str, Any]             =						[
         """TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """AdaptiveEmbedding""",
         """TransfoXLForSequenceClassification""",
         """TransfoXLLMHeadModel""",
         """TransfoXLModel""",
         """TransfoXLPreTrainedModel""",
         """load_tf_weights_in_transfo_xl""",
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     SCREAMING_SNAKE_CASE_:Any             =						[
         """TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """TFAdaptiveEmbedding""",
         """TFTransfoXLForSequenceClassification""",
         """TFTransfoXLLMHeadModel""",
         """TFTransfoXLMainLayer""",
         """TFTransfoXLModel""",
         """TFTransfoXLPreTrainedModel""",
     ]


if TYPE_CHECKING:
     from .configuration_transfo_xl import TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig
     from .tokenization_transfo_xl import TransfoXLCorpus, TransfoXLTokenizer

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_transfo_xl import (
              TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
              AdaptiveEmbedding,
              TransfoXLForSequenceClassification,
              TransfoXLLMHeadModel,
              TransfoXLModel,
              TransfoXLPreTrainedModel,
              load_tf_weights_in_transfo_xl,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_transfo_xl import (
              TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFAdaptiveEmbedding,
              TFTransfoXLForSequenceClassification,
              TFTransfoXLLMHeadModel,
              TFTransfoXLMainLayer,
              TFTransfoXLModel,
              TFTransfoXLPreTrainedModel,
          )

else:
     import sys

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


