-
real(dp)
acosh_safe(x)
-
real(dp) intent(in) :: x
real(dp)
action_argument_x(l, nu, chi, loglambda)
Return the action-matched comparison argument x_*(chi).
integer intent(in) :: l
real(dp) intent(in) :: nu
real(dp) intent(in) :: chi
real(dp) intent(in) :: loglambda
real(dp)
arg_gamma_1_plus_i(nu)
Imaginary part of log Gamma(1+i nu), evaluated with the same
g = 7, n = 9 Lanczos approximation using real arithmetic specialized to z = 1 + i nu.
real(dp) intent(in) :: nu
real(dp)
comparison_u_from_loglambda(nu, chi, loglambda)
Reduced radial function, with log Lambda already precomputed.
Centralized through the same scaled-K router as scaled_ki_nu().
real(dp) intent(in) :: nu
real(dp) intent(in) :: chi
real(dp) intent(in) :: loglambda
real(dp)
harmonic_minus_euler(l)
H_l - gamma, with a direct sum for small l and an asymptotic expansion
for large l. For l = 0 this is -gamma.
integer intent(in) :: l
real(dp)
i0_approx(x)
real(dp) intent(in) :: x
real(dp)
ieee_nan()
real(dp)
inv_comp_forb(b, target)
Invert int_b^x sqrt(t^2-b^2)/t dt = target without bisection.
Write s = sqrt((x/b)^2-1). Then
target/b = s - atan(s), s >= 0,
and x = b*sqrt(1 + s^2).
real(dp) intent(in) :: b
real(dp) intent(in) :: target
real(dp)
inv_comp_osc(b, target)
Invert int_x^b sqrt(b^2-t^2)/t dt = target without bisection.
Write s = sqrt(1-(x/b)^2). Then
target/b = atanh(s) - s, 0 <= s < 1,
and x = b*sqrt(1-s^2). Four Halley steps from asymptotic/series
starts are overkill for the intended 1e-4 peak-normalized branch.
real(dp) intent(in) :: b
real(dp) intent(in) :: target
real(dp)
k0_approx(x)
Modified Bessel K0 approximation, adapted from the classic Cephes/NR
piecewise rational-polynomial form. Sufficient for the nu -> 0
fallback of this approximation branch.
real(dp) intent(in) :: x
real(dp)
k0_from_logz2(logz2)
K_0(2 exp(logz2)), retaining accuracy when the argument underflows.
real(dp) intent(in) :: logz2
real(dp)
log_sinh(x)
real(dp) intent(in) :: x
real(dp)
open_smallnu_action_u(l, nu, chi)
integer intent(in) :: l
real(dp) intent(in) :: nu
real(dp) intent(in) :: chi
real(dp)
open_smallnu_action_u_from_loglambda(l, nu, chi, loglambda)
Action-matched reduced radial approximation.
It keeps the same scaled K_{i nu} comparison solution as
open_smallnu_u, but replaces x = 2 Lambda exp(-chi) by an argument
x_*(chi) whose comparison action matches the exact open action, with
the additive constant chosen so x_* -> 2 Lambda exp(-chi) at infinity.
No Liouville amplitude factor is applied.
integer intent(in) :: l
real(dp) intent(in) :: nu
real(dp) intent(in) :: chi
real(dp) intent(in) :: loglambda
real(dp)
open_smallnu_liouville_amp_a0(l, nu, chi)
Leading fast Liouville amplitude for the high-l small-nu branch:
A0 = sqrt(asinh(eta)/eta), eta = csch(chi). The higher-order
exp((nu/sqrt(l(l+1)))^2 H) correction is deliberately omitted; it
worsened the calibrated mid-l gate while giving negligible benefit.
integer intent(in) :: l
real(dp) intent(in) :: nu
real(dp) intent(in) :: chi
real(dp)
open_smallnu_loglambda(l, nu)
Branch-continuous evaluation of
log Lambda = Im log Gamma(l + 1 + i nu)/nu.
For nu/(l+1) small, use the convergent tail expansion
H_l - gamma + sum_{m>=1} (-1)^(m+1) nu^(2m)/(2m+1)
sum_{n = l + 1}^infty n^{-(2m + 1)}.
Otherwise compute Im log Gamma(1+i nu) plus sum atan(nu/j).
integer intent(in) :: l
real(dp) intent(in) :: nu
real(dp)
open_smallnu_u(l, nu, chi, ok)
Validated small-nu reduced radial approximation for the regular open
hyperspherical Bessel. The high-l branch applies only the leading
Liouville amplitude A0 = sqrt(asinh(csch chi)/csch chi), which was
calibrated separately from the action-matched x_* argument.
integer intent(in) :: l
real(dp) intent(in) :: nu
real(dp) intent(in) :: chi
logical intent(out) :: ok
real(dp)
open_smallnu_u_from_loglambda(l, nu, chi, loglambda)
integer intent(in) :: l
real(dp) intent(in) :: nu
real(dp) intent(in) :: chi
real(dp) intent(in) :: loglambda
real(dp)
scaled_ki_airy_leading(nu, x)
Leading uniform Airy approximation for
sqrt(sinh(pi nu)/(pi nu))*K_{i nu}(x), nu > 20 large.
real(dp) intent(in) :: nu
real(dp) intent(in) :: x
real(dp)
scaled_ki_asymptotic(nu, x)
Large-x asymptotic for scaled K_{i nu}(x).
K_v(x) ~ sqrt(pi/(2x))*exp(-x) * sum_m a_m/x^m,
with mu = 4 v^2 = -4 nu^2.
real(dp) intent(in) :: nu
real(dp) intent(in) :: x
real(dp)
scaled_ki_from_logz2(nu, logz2)
Same evaluator as scaled_ki_nu(), but accepts log(x/2). This avoids
overflow/underflow in the open_smallnu_* wrappers.
real(dp) intent(in) :: nu
real(dp) intent(in) :: logz2
real(dp)
scaled_ki_from_xlog(nu, x, logz2)
Core router. nu must be positive and x>0.
real(dp) intent(in) :: nu
real(dp) intent(in) :: x
real(dp) intent(in) :: logz2
real(dp)
scaled_ki_integral(nu, x)
Fallback quadrature for the scaled K_{i nu}:
K_{i nu}(x) = int_0^infty exp(-x cosh t) cos(nu t) dt.
Uses composite 16-point Gauss-Legendre quadrature over [0,tmax].
This branch is deliberately robust rather than maximally fast.
real(dp) intent(in) :: nu
real(dp) intent(in) :: x
real(dp)
scaled_ki_nu(nu, x)
Standalone evaluator of
sqrt(sinh(pi nu)/(pi nu))*K_{i nu}(x), x>0.
Accuracy target: fast O(1e-4) peak-normalized use, not full double
precision everywhere.
- I_{i nu} power series while q = x^2/(4 nu) <= series_q_max;
- uniform Airy turning-point approximation otherwise.
real(dp) intent(in) :: nu
real(dp) intent(in) :: x
real(dp)
scaled_ki_series(nu, logz2, x, leading_only)
Compatibility wrapper around the checked series evaluator.
real(dp) intent(in) :: nu
real(dp) intent(in) :: logz2
real(dp) intent(in) :: x
logical intent(in) :: leading_only
real(dp)
true_action_forb(A, b, y)
int_b^y sqrt(t^2-b^2)/(t sqrt(1+t^2/A^2)) dt, for y >= b.
real(dp) intent(in) :: A
real(dp) intent(in) :: b
real(dp) intent(in) :: y
real(dp)
true_action_osc(A, b, y)
int_y^b sqrt(b^2-t^2)/(t sqrt(1+t^2/A^2)) dt, for 0 <= y <= b.
real(dp) intent(in) :: A
real(dp) intent(in) :: b
real(dp) intent(in) :: y
real(dp)
zeta_tail_em(p, a)
Euler-Maclaurin estimate of sum_{n = a}^infty n^{-p}, p > 1.
Good for a >= roughly 8; only used in that regime above.
integer intent(in) :: p
real(dp) intent(in) :: a