hyp2f1_1b_3half_quad#
jeanspy.hyp2f1_jax.hyp2f1_1b_3half_quad
- jeanspy.hyp2f1_jax.hyp2f1_1b_3half_quad(b, w, *, n_points=128, quad_rule='tanh_sinh')[source]#
Numerically stable evaluation of 2F1(1, b; 3/2; w) for w in [0, 1).
Uses the Euler integral representation (valid for 0 < b < 3/2):
2F1(1,b;3/2;w) = Γ(3/2) / (Γ(b) Γ(3/2-b)) * ∫_0^1 dt t^{b-1} (1-t)^{1/2-b} / (1-w t)
We approximate the integral with a fixed quadrature rule on [0,1]: -
quad_rule='tanh_sinh': tanh-sinh nodes (robust near endpoint singularities) -quad_rule='gauss_kronrod': composite 15-point Gauss-Kronrod on uniform panelsThis avoids the catastrophic cancellation that appears in analytic-continuation formulas near b≈1/2 and w≈1, and works well in float32.
Notes
Inputs and units. Dimensionless scalar or broadcastable array
bandw, with 0<b<3/2 and 0<=w<1.quad_ruleis a static rule choice;n_pointssets the panel count forgauss_kronrodand is ignored by the precomputedtanh_sinhrule.Returns and shape. Approximation to 2F1(1,b;3/2;w), with the broadcast shape of
bandw.Validity. The Euler integral requires 0<b<3/2. Fixed quadrature can lose accuracy near the domain boundaries; check convergence.
Errors. Unsupported
quad_rulevalues raise ValueError. Numerical inputs outside the integral domain are not rejected explicitly and can produce nonfinite or inaccurate values.Backend. JAX arrays on the configured CPU/GPU, with dtype set before import.
Differentiation. Fixed-loop continuous expressions support autodiff in their valid regions; piecewise thresholds and parameter singularities need checks.
Examples.
examples/docs_numerics.py