fn order_series<const DERIVATIVE: bool>(
v: f64,
m: i32,
y: f64,
sin: f64,
cos: f64,
frac_cot: f64,
) -> Result<(f64, f64)>Expand description
P_ν^m(-y) for 0 < y < 1, 1 <= μ = |m| <= ⌊ν⌋, from the expansion about x = -1 in
s = (1 - y)/2: the degenerate case c - a - b = μ of the 1 - z connection formulas
(DLMF §15.8) applied to DLMF 14.3.1, after the digamma reflection DLMF 5.5.4,
P_ν^{-μ}(-y) = (-1)^μ cos(νπ) R + sin(νπ) (L + F/G) with G = Γ(ν+μ+1)/Γ(ν-μ+1),
R = (w/4)^{μ/2}/μ! Σ r_k (that is P_ν^{-μ}(y)),
L = (-1)^μ (w/4)^{μ/2}/(π μ!) Σ r_k [ln s - ψ(k+1) - ψ(k+μ+1) + ψ(ν+μ+k+1) + ψ(ν-μ-k+1)],
F = (-1)^{μ+1} (μ-1)!/π (w/4)^{μ/2} s^{-μ} Σ_{k<μ} (ν+1)_k (-ν)_k s^k/(k! (1-μ)_k) and
r_k = (ν+μ+1)_k (μ-ν)_k s^k/((μ+1)_k k!). As in log_series, the pole of
ψ(ν - μ - k + 1) is cancelled against the factor n - ν of r_k (n = ⌊ν⌋).