Shunyaya Symbolic Mathematics — Inverse trigonometric lifts — arctan & atan2 (2.33C)

Abstract
We complete the inverse trigonometric family by lifting arctan and atan2 to symbolic numerals (m, a). For arctan we apply the unary lift with alignment carry; for atan2 we compute the classical angle on magnitudes and attach an alignment summary via a rapidity-weighted mean with geometry-sensitive weights. We give domains, ranges, monotonicity, branch/axis rules, stable numerics, and guard policies. Under collapse phi(m,a) = m, all formulas reduce to the classical functions.


Definitions (alignment carry and aggregation)

Unary arctan (x = (m, a)):
arctan*(m, a) = ( arctan(m) , a ) for m in R

Binary atan2 (y = (m_y, a_y), x = (m_x, a_x)):
atan2*((y, x)) = ( atan2(m_y, m_x) , a_out )

Alignment summary for atan2 (default):
u_y = atanh( clamp(a_y, -1+eps, +1-eps) )
u_x = atanh( clamp(a_x, -1+eps, +1-eps) )
Choose geometry-sensitive weights (gamma = 0):
w_y = |m_x|, w_x = |m_y|
u_out = ( w_y * u_y + w_x * u_x ) / ( w_y + w_x ) if w_y + w_x > 0
a_out = tanh( u_out )
If w_y + w_x = 0 (i.e., m_x = m_y = 0), apply domain_guard (see below).

Notes:
• The unary map carries alignment unchanged.
• The binary angle uses a rapidity mean emphasizing the axis that most conditions the angle near a point (weight on y uses |x| and vice versa). This mirrors the local sensitivities |∂theta/∂x| ∝ |y|, |∂theta/∂y| ∝ |x| up to a common factor.


Domains, ranges, and monotonicity

arctan
• Domain: R
• Range: (-pi/2, pi/2)
• Odd; strictly increasing on R.

atan2
• Domain: all (m_y, m_x) except (0, 0).
• Principal range: (-pi, pi] (branch = “principal”).
• Alternative range (optional): [0, 2*pi) (branch = “two_pi”).
• Axis rules (principal):
atan2( 0, x>0 ) = 0
atan2( 0, x<0 ) = pi
atan2( y>0, 0 ) = +pi/2
atan2( y<0, 0 ) = -pi/2
• Not odd/even; not globally monotone (angle wraps at the branch cut).

Endpoint behavior and continuity.
• arctan(m) -> +pi/2 as m -> +inf, -> -pi/2 as m -> -inf.
• atan2 is continuous away from the branch cut; at the cut (principal: -pi vs pi) select a side consistently per branch policy.


Collapse and order

Collapse check.
phi( arctan*(m,a) ) = arctan(m)
phi( atan2*((y,x)) ) = atan2( m_y, m_x )

Order rules (magnitude channel).
• arctan: increasing on R, so (m1 <= m2) ⇒ arctan(m1) <= arctan(m2).
• atan2: no global monotonicity; use local or ray-wise comparisons only.


Asymptotics and small-angle guides

arctan
• Small |m|: arctan(m) ≈ m – m^3/3 + m^5/5.
• Large |m|: arctan(m) ≈ sign(m)*(pi/2) – 1/m + O(1/m^3).

atan2
• For m_x > 0 and small |m_y/m_x|: atan2(m_y, m_x) ≈ m_y / m_x.
• Near axes, prefer explicit axis returns per branch rules to avoid loss of significance.


Numerical guard policies (manifest recommendations)

arctan
• Use reciprocal identity for large |m| to avoid loss:
arctan(m) = sign(m)*(pi/2) – arctan( 1/|m| ).
• For very small |m|, series m – m^3/3 is adequate for quick checks.

atan2
• Domain guard: if (m_x, m_y) = (0, 0) → domain_guard = “error” (default) or “nan”.
• Branch selection:
branch = “principal” → range (-pi, pi] (default)
branch = “two_pi” → range [0, 2*pi)
• Axis handling: implement explicit tests for m_x = 0 or m_y = 0 with exact returns shown above.
• Use hypot for r = sqrt(m_x^2 + m_y^2) when needed; avoid divisions by near-zero denominators.
• Alignment aggregation: use geometry-sensitive weights (w_y = |m_x|, w_x = |m_y|); fallback to equal weights if both are 0 (but that case is guarded out).


Worked examples

A) arctan on R (increasing, odd).
x1 = (-2.0, +0.3) → arctan*(x1) ≈ ( -1.1071 , +0.3 )
x2 = ( 0.5, -0.6) → arctan*(x2) ≈ ( 0.4636 , -0.6 )
Order preserved: -2.0 < 0.5 ⇒ -1.1071 < 0.4636.

B) atan2 in quadrant II (principal).
y = ( 1.0, 0.2), x = (-1.0, 0.9)
theta = atan2(1.0, -1.0) = 3pi/4 ≈ 2.3562
Weights: w_y = |m_x| = 1.0, w_x = |m_y| = 1.0
u_y = atanh(0.2) ≈ 0.2027, u_x = atanh(0.9) ≈ 1.4722
u_out = (1.0
0.2027 + 1.01.4722)/2 ≈ 0.8375
a_out = tanh(0.8375) ≈ 0.684
atan2
((y,x)) ≈ ( 2.3562 , 0.684 )

C) Axis case (x < 0, y = 0).
y = ( 0.0, -0.4 ), x = (-2.0, 0.7)
theta = atan2(0, -2) = pi
Weights: w_y = |m_x| = 2, w_x = |m_y| = 0
u_out = (2atanh(-0.4) + 0atanh(0.7)) / 2 = atanh(-0.4)
a_out = -0.4
Result: ( pi , -0.4 ) # alignment comes from the conditioning axis (y-channel) per weights.

D) Domain guard (both zero).
y = (0, a1), x = (0, a2) → atan2*((y,x)) => domain_guard (“error” by default).


Implementation notes (manifest)

arctan.domain = “R”
arctan.range = “(-pi/2, pi/2)”
arctan.order = “increasing”
arctan.numerics.large = “reciprocal_identity”
arctan.numerics.small = “series_odd_terms”

atan2.domain = “(x,y) != (0,0)”
atan2.range = “(-pi, pi]” # set branch = “principal”
atan2.range.alt = “[0, 2*pi)” # set branch = “two_pi”
atan2.axis_rules = “explicit_returns” # as listed above
atan2.domain_guard = “error” # or “nan”
atan2.align.policy = “rapidity_mean”
atan2.align.weights = “geom_sensitivity” # w_y = |x|, w_x = |y|, gamma = 0
atan2.align.fallback = “equal_weights_if_positive_sum”
eps = 1e-6 # clamp for atanh
zero_policy = “canonical_zero” # if theta == 0, report (0, +1)


Takeaway
arctan lifts as a strictly increasing odd map with alignment carry; atan2 computes the classical quadrant-correct angle on magnitudes and summarizes alignment with geometry-sensitive rapidity weights. Clear branch and axis rules, plus stable identities, deliver robust numeric behavior. Under collapse, both reduce exactly to classical trigonometry.


Navigation
Previous → Inverse trigonometric lifts — arccos (2.33B)
Next → Hyperbolic & inverse hyperbolic (2.34)


Disclaimer
Observation only. Results reproduce mathematically; domain claims require independent peer review. Defaults: mult_mode = M2, clamp_eps = 1e-6, |a| < 1. All formulas are presented in plain text. Collapse uses phi(m,a) = m.