

'''simple docstring'''







from math import isclose, sqrt
def    UpperCAmelCase__     (   UpperCAmelCase__,							UpperCAmelCase__,							UpperCAmelCase__					)      ->      tuple[float, float, float]:
       A_						       =   point_y / 4 / point_x
       A_						       =   2 * normal_gradient / (1 + normal_gradient * normal_gradient)
       A_						       =   (1 - normal_gradient * normal_gradient) / (
           1 + normal_gradient * normal_gradient
       )
       A_						       =   (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
       A_						       =   outgoing_gradient**2 + 4
       A_						       =   2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
       A_						       =   (point_y - outgoing_gradient * point_x) ** 2 - 1_00

       A_						       =   (
           -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term					)
       ) / (2 * quadratic_term)
       A_						       =   (
           -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term					)
       ) / (2 * quadratic_term)

       # two solutions, one of which is our input point
       A_						       =   x_minus if isclose(UpperCAmelCase__,							UpperCAmelCase__					) else x_plus
       A_						       =   point_y + outgoing_gradient * (next_x - point_x)

       return next_x, next_y, outgoing_gradient
def    UpperCAmelCase__     (   UpperCAmelCase__ = 1.4,							UpperCAmelCase__ = -9.6					)      ->      int:
       A_						       =   0
       A_						       =   first_x_coord
       A_						       =   first_y_coord
       A_						       =   (10.1 - point_y) / (0.0 - point_x)

       while not (-0.01 <= point_x <= 0.01 and point_y > 0):
              A_       ,      A_       ,      A_						       =   next_point(UpperCAmelCase__,							UpperCAmelCase__,							UpperCAmelCase__					)
              num_reflections += 1

       return num_reflections


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



'''simple docstring'''







from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__lowerCamelCase									=     logging.get_logger(__name__)

__lowerCamelCase									=     {
    '''microsoft/resnet-50''': '''https://huggingface.co/microsoft/resnet-50/blob/main/config.json''',
}


class        A__   (   _snake_case    ,    _snake_case      ):
    lowercase						       =		"resnet"
    lowercase						       =		["basic", "bottleneck"]



    def __init__(       self		,					UpperCamelCase__=3		,					UpperCamelCase__=64		,					UpperCamelCase__=[256, 512, 1024, 2048]		,					UpperCamelCase__=[3, 4, 6, 3]		,					UpperCamelCase__="bottleneck"		,					UpperCamelCase__="relu"		,					UpperCamelCase__=False		,					UpperCamelCase__=None		,					UpperCamelCase__=None		,					**UpperCamelCase__		,					)    ->   List[str]:





           '''simple docstring'''
           super().__init__(**UpperCamelCase__							)
           if layer_type not in self.layer_types:
                  raise ValueError(f'''layer_type={layer_type} is not one of {",".join(self.layer_types							)}'''							)
           A_						       =   num_channels
           A_						       =   embedding_size
           A_						       =   hidden_sizes
           A_						       =   depths
           A_						       =   layer_type
           A_						       =   hidden_act
           A_						       =   downsample_in_first_stage
           A_						       =   ["""stem"""] + [f'''stage{idx}''' for idx in range(1		,					len(UpperCamelCase__							) + 1							)]
           A_       ,      A_						       =   get_aligned_output_features_output_indices(
               out_features=UpperCamelCase__		,					out_indices=UpperCamelCase__		,					stage_names=self.stage_names							)


class        A__   (   _snake_case      ):
    lowercase						       =		version.parse("1.11"      )



    @property
    def        snake_case_      (       self							)    ->   Mapping[str, Mapping[int, str]]:





           '''simple docstring'''
           return OrderedDict(
               [
                   ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
               ]							)







    @property
    def        snake_case_      (       self							)    ->   float:





           '''simple docstring'''
           return 1e-3
