from math import isclose, sqrt






def _lowerCamelCase  (		snake_case     , snake_case     , snake_case  ):
							_lowerCAmelCase							=							point_y / 4 / point_x
							_lowerCAmelCase							=							2 * normal_gradient / (1 + normal_gradient * normal_gradient)
							_lowerCAmelCase							=							(1 - normal_gradient * normal_gradient) / (
							    1 + normal_gradient * normal_gradient
							)
							_lowerCAmelCase							=							(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							=							outgoing_gradient**2 + 4
							_lowerCAmelCase							=							2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
							_lowerCAmelCase							=							(point_y - outgoing_gradient * point_x) ** 2 - 100

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

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

							return next_x, next_y, outgoing_gradient






def _lowerCamelCase  (		snake_case = 1.4     , snake_case = -9.6  ):
							_lowerCAmelCase							=							0
							_lowerCAmelCase							=							first_x_coord
							_lowerCAmelCase							=							first_y_coord
							_lowerCAmelCase							=							(10.1 - point_y) / (0.0 - point_x)

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

							return num_reflections


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













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


UpperCAmelCase_           =	logging.get_logger(__name__)

UpperCAmelCase_           =	{
    "tiiuae/falcon-40b": "https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json",
    "tiiuae/falcon-7b": "https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json",
}




class 			__UpperCamelCase    (							A__    ):
     __A	:  Dict							  =   """falcon"""
     __A	:  Any							  =   ["""past_key_values"""]





     def __init__(     self				,							_UpperCamelCase=65024				,							_UpperCamelCase=4544				,							_UpperCamelCase=32				,							_UpperCamelCase=71				,							_UpperCamelCase=1e-5				,							_UpperCamelCase=0.02				,							_UpperCamelCase=True				,							_UpperCamelCase=0.0				,							_UpperCamelCase=0.0				,							_UpperCamelCase=None				,							_UpperCamelCase=False				,							_UpperCamelCase=False				,							_UpperCamelCase=True				,							_UpperCamelCase=True				,							_UpperCamelCase=False				,							_UpperCamelCase=11				,							_UpperCamelCase=11				,							**_UpperCamelCase				,							):
        _UpperCAmelCase           =   vocab_size
        # Backward compatibility with n_embed kwarg
        _UpperCAmelCase           =   kwargs.pop('''n_embed'''				,							_UpperCamelCase					)
        _UpperCAmelCase           =   hidden_size if n_embed is None else n_embed
        _UpperCAmelCase           =   num_hidden_layers
        _UpperCAmelCase           =   num_attention_heads
        _UpperCAmelCase           =   layer_norm_epsilon
        _UpperCAmelCase           =   initializer_range
        _UpperCAmelCase           =   use_cache
        _UpperCAmelCase           =   hidden_dropout
        _UpperCAmelCase           =   attention_dropout

        _UpperCAmelCase           =   bos_token_id
        _UpperCAmelCase           =   eos_token_id
        _UpperCAmelCase           =   num_attention_heads if num_kv_heads is None else num_kv_heads
        _UpperCAmelCase           =   alibi
        _UpperCAmelCase           =   new_decoder_architecture
        _UpperCAmelCase           =   multi_query  # Ignored when new_decoder_architecture is True
        _UpperCAmelCase           =   parallel_attn
        _UpperCAmelCase           =   bias

        super().__init__(bos_token_id=_UpperCamelCase				,							eos_token_id=_UpperCamelCase				,							**_UpperCamelCase					)





     @property
     def 		UpperCamelCase(     self					):
        return self.hidden_size // self.num_attention_heads





     @property
     def 		UpperCamelCase(     self					):
        return not self.alibi