





from math import isclose, sqrt





def      _UpperCamelCase  (a__ :float ,      a__ :float ,      a__ :float							):






							"""simple docstring"""





							UpperCamelCase__					  =      point_y / 4 / point_x
							UpperCamelCase__					  =      2 * normal_gradient / (1 + normal_gradient * normal_gradient)
							UpperCamelCase__					  =      (1 - normal_gradient * normal_gradient) / (
							    1 + normal_gradient * normal_gradient
							)
							UpperCamelCase__					  =      (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__					  =      outgoing_gradient**2 + 4
							UpperCamelCase__					  =      2 * outgoing_gradient * (point_y - outgoing_gradient * point_x)
							UpperCamelCase__					  =      (point_y - outgoing_gradient * point_x) ** 2 - 100

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

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

							return next_x, next_y, outgoing_gradient





def      _UpperCamelCase  (a__ :float = 1.4 ,      a__ :float = -9.6							):






							"""simple docstring"""





							UpperCamelCase__					  =      0
							UpperCamelCase__					  =      first_x_coord
							UpperCamelCase__					  =      first_y_coord
							UpperCamelCase__					  =      (10.1 - point_y) / (0.0 - point_x)

							while not (-0.01 <= point_x <= 0.01 and point_y > 0):
														UpperCamelCase__  ,  UpperCamelCase__  ,  UpperCamelCase__					  =      next_point(a__ ,      a__ ,      a__							)
														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__           =			{
    "tanreinama/GPTSAN-2.8B-spout_is_uniform": (
        "https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json"
    ),
}

class 							__SCREAMING_SNAKE_CASE       (  _a							):
							snake_case  :   Optional[Any]      =							"""gptsan-japanese"""
							snake_case  :   Any      =							[
							    """past_key_values""",
							]
							snake_case  :   str      =							{
							    """hidden_size""": """d_model""",
							    """num_attention_heads""": """num_heads""",
							    """num_hidden_layers""": """num_layers""",
							}






							def __init__(    self	,			__lowerCAmelCase=36000	,			__lowerCAmelCase=1280	,			__lowerCAmelCase=1024	,			__lowerCAmelCase=8192	,			__lowerCAmelCase=4096	,			__lowerCAmelCase=128	,			__lowerCAmelCase=10	,			__lowerCAmelCase=0	,			__lowerCAmelCase=16	,			__lowerCAmelCase=16	,			__lowerCAmelCase=128	,			__lowerCAmelCase=0.0	,			__lowerCAmelCase=1E-5	,			__lowerCAmelCase=False	,			__lowerCAmelCase=0.0	,			__lowerCAmelCase="float32"	,			__lowerCAmelCase=False	,			__lowerCAmelCase=False	,			__lowerCAmelCase=False	,			__lowerCAmelCase=0.002	,			__lowerCAmelCase=False	,			__lowerCAmelCase=True	,			__lowerCAmelCase=35998	,			__lowerCAmelCase=35995	,			__lowerCAmelCase=35999	,			**__lowerCAmelCase	,			):
														UpperCamelCase__					  =      vocab_size
														UpperCamelCase__					  =      max_position_embeddings
														UpperCamelCase__					  =      d_model
														UpperCamelCase__					  =      d_ff
														UpperCamelCase__					  =      d_ext
														UpperCamelCase__					  =      d_spout
														UpperCamelCase__					  =      num_switch_layers
														UpperCamelCase__					  =      num_ext_layers
														UpperCamelCase__					  =      num_switch_layers + num_ext_layers
														UpperCamelCase__					  =      num_heads
														UpperCamelCase__					  =      num_experts
														UpperCamelCase__					  =      expert_capacity
														UpperCamelCase__					  =      dropout_rate
														UpperCamelCase__					  =      layer_norm_epsilon
														UpperCamelCase__					  =      router_bias
														UpperCamelCase__					  =      router_jitter_noise
														UpperCamelCase__					  =      router_dtype
														UpperCamelCase__					  =      router_ignore_padding_tokens
														UpperCamelCase__					  =      output_hidden_states
														UpperCamelCase__					  =      output_attentions
														UpperCamelCase__					  =      initializer_factor
														UpperCamelCase__					  =      output_router_logits
														UpperCamelCase__					  =      use_cache

														super().__init__(
														    separator_token_id=__lowerCAmelCase	,			pad_token_id=__lowerCAmelCase	,			eos_token_id=__lowerCAmelCase	,			**__lowerCAmelCase	,			)




