visit

Function visit 

Source
fn visit(
    j1: i32,
    j2: i32,
    m1: i32,
    m2: i32,
    [first, last]: [i32; 2],
    emit: impl FnMut(i32, f64),
)
Expand description

Visits (j3, (j1 j2 j3; m1 m2 -m1-m2)) for every j3 in first..=last, a subrange of the admissible max(|j1 - j2|, |m1 + m2|)..=j1 + j2, with treams’ two-sided recurrence in j3 (Schulten and Gordon).

The upward recurrence from the closed form at the lower end is stable while the symbols grow, in the classically forbidden region above the lower end; the downward recurrence from the closed form at j1 + j2 is stable while they grow downward, through the upper forbidden region; both are neutral where the symbols oscillate. treams switches from upward to downward at |j1 - j2| + (j1 + j2 - |j1 - j2|) / 4, whatever the orders. For extreme orders either forbidden region can reach past that switch, and recurring into it loses all accuracy (errors up to 1e-2 below j = 90, a factor of 1800 at j = 260). Here the upward recurrence therefore continues past the switch while the symbols grow, and the downward recurrence continues below it while they grow downward: the turn is max(growth_end, min(switch, decay_start)). Whether a j3 is recurred upward or downward does not depend on first or last, so rows and single symbols agree bit for bit.