






from math import isclose, sqrt




def 	lowercase__ (	__snake_case       :				float	,			__snake_case       :				float	,			__snake_case       :				float    ):


					'''simple docstring'''


					UpperCAmelCase_       : Optional[Any]				=		point_y / 4 / point_x
					UpperCAmelCase_       : Union[str, Any]				=		2 * normal_gradient / (1 + normal_gradient * normal_gradient)
					UpperCAmelCase_       : Dict				=		(1 - normal_gradient * normal_gradient) / (
					    1 + normal_gradient * normal_gradient
					)
					UpperCAmelCase_       : Union[str, Any]				=		(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
					UpperCAmelCase_       : List[str]				=		outgoing_gradient**2 + 4
					UpperCAmelCase_       : Any				=		2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
					UpperCAmelCase_       : Any				=		(point_y - outgoing_gradient * point_x) ** 2 - 100

					UpperCAmelCase_       : Dict				=		(
					    -linear_term - sqrt(linear_term**2 - 4 * quadratic_term * constant_term    )
					) / (2 * quadratic_term)
					UpperCAmelCase_       : Dict				=		(
					    -linear_term + sqrt(linear_term**2 - 4 * quadratic_term * constant_term    )
					) / (2 * quadratic_term)

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

					return next_x, next_y, outgoing_gradient




def 	lowercase__ (	__snake_case       :				float = 1.4	,			__snake_case       :				float = -9.6    ):


					'''simple docstring'''


					UpperCAmelCase_       : int				=		0
					UpperCAmelCase_       : float				=		first_x_coord
					UpperCAmelCase_       : float				=		first_y_coord
					UpperCAmelCase_       : float				=		(10.1 - point_y) / (0.0 - point_x)

					while not (-0.01 <= point_x <= 0.01 and point_y > 0):
										UpperCAmelCase_       : Tuple				=		next_point(_lowerCamelCase	,			_lowerCamelCase	,			_lowerCamelCase    )
										num_reflections += 1

					return num_reflections


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








from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase    :   Union[str, Any]						=			logging.get_logger(__name__)

lowercase    :   Union[str, Any]						=			{
    'snap-research/efficientformer-l1-300': (
        'https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'
    ),
}




class 					lowerCamelCase__				(							__lowercase):




	'''simple docstring'''




	_A								=	'efficientformer'







	def __init__(   self						:Union[str, Any]	,  a						:List[int] = [3, 2, 6, 4]	,  a						:List[int] = [4_8, 9_6, 2_2_4, 4_4_8]	,  a						:List[bool] = [True, True, True, True]	,  a						:int = 4_4_8	,  a						:int = 3_2	,  a						:int = 4	,  a						:int = 7	,  a						:int = 5	,  a						:int = 8	,  a						:int = 4	,  a						:float = 0.0	,  a						:int = 1_6	,  a						:int = 3	,  a						:int = 3	,  a						:int = 3	,  a						:int = 2	,  a						:int = 1	,  a						:float = 0.0	,  a						:int = 1	,  a						:bool = True	,  a						:bool = True	,  a						:float = 1E-5	,  a						:str = "gelu"	,  a						:float = 0.02	,  a						:float = 1E-1_2	,  a						:int = 2_2_4	,  a						:float = 1E-0_5	,  **a						:str	,  )						->					None:
								super().__init__(**a		)

								__UpperCamelCase      :  Optional[Any]       =   hidden_act
								__UpperCamelCase      :  Any       =   hidden_dropout_prob
								__UpperCamelCase      :  str       =   hidden_sizes
								__UpperCamelCase      :  Dict       =   num_hidden_layers
								__UpperCamelCase      :  Optional[Any]       =   num_attention_heads
								__UpperCamelCase      :  str       =   initializer_range
								__UpperCamelCase      :  List[str]       =   layer_norm_eps
								__UpperCamelCase      :  str       =   patch_size
								__UpperCamelCase      :  str       =   num_channels
								__UpperCamelCase      :  Any       =   depths
								__UpperCamelCase      :  Tuple       =   mlp_expansion_ratio
								__UpperCamelCase      :  List[str]       =   downsamples
								__UpperCamelCase      :  Optional[int]       =   dim
								__UpperCamelCase      :  Dict       =   key_dim
								__UpperCamelCase      :  Optional[Any]       =   attention_ratio
								__UpperCamelCase      :  Dict       =   resolution
								__UpperCamelCase      :  Union[str, Any]       =   pool_size
								__UpperCamelCase      :  Tuple       =   downsample_patch_size
								__UpperCamelCase      :  Optional[int]       =   downsample_stride
								__UpperCamelCase      :  Optional[int]       =   downsample_pad
								__UpperCamelCase      :  Union[str, Any]       =   drop_path_rate
								__UpperCamelCase      :  Union[str, Any]       =   num_metaad_blocks
								__UpperCamelCase      :  List[str]       =   distillation
								__UpperCamelCase      :  str       =   use_layer_scale
								__UpperCamelCase      :  Tuple       =   layer_scale_init_value
								__UpperCamelCase      :  str       =   image_size
								__UpperCamelCase      :  int       =   batch_norm_eps