hyp2f1_1b_3half#
jeanspy.hyp2f1_jax.hyp2f1_1b_3half
- jeanspy.hyp2f1_jax.hyp2f1_1b_3half(b, w, *, method='auto', n_terms=192, w_switch=0.65, w_asymptotic=0.6, w_asymptotic_negative=0.9, b_min_quad=1e-06, b_max_quad=1.49, b_half_avoid_asym=0.001, b_integer_avoid_asym=1e-08, n_quad=128, quad_rule='tanh_sinh', asym_n_terms=20)[source]#
2F1(1,b;3/2;w) specialized helper.
- Parameters:
method (str) –
“series”: fixed-term power series.
”quad”: Euler integral quadrature (0<b<3/2).
”asymptotic”: asymptotic expansion around w=1.
- ”auto”: uses the asymptotic continuation for positive
bonce it is more accurate than quadrature, uses it for negative non-integer
bonly very nearw=1, and otherwise falls back to quadrature or the terminating/power series.
- ”auto”: uses the asymptotic continuation for positive
n_quad (int) –
quad_rule='tanh_sinh': currently ignored (uses precomputed tanh-sinh rule).quad_rule='gauss_kronrod': number of uniform panels for composite GK.
w_asymptotic (float) – In
method='auto', switch positivebvalues from quadrature to asymptotic evaluation forw >= w_asymptotic.w_asymptotic_negative (float) – In
method='auto', allow negative non-integerbvalues onto the asymptotic branch only forw >= w_asymptotic_negative.b_half_avoid_asym (float) – In
method='auto', avoid asymptotic branch for|b-1/2| < b_half_avoid_asymand keep quadrature in this region.b_integer_avoid_asym (float) – In
method='auto', avoid the asymptotic branch whenbis close to a non-positive integer pole or negative half-integer pole of the continuation coefficient.asym_n_terms (int) – Number of terms kept for the regular
2F1(1,b;b+1/2;1-w)factor in the asymptotic branch.n_terms (int)
w_switch (float)
b_min_quad (float)
b_max_quad (float)
quad_rule (str)
- Return type:
Notes
Intended domain for this project is w in [0,1).
The “auto” choice is designed specifically to handle the numerically difficult region around b≈1/2 and w≈1.
Inputs and units. Dimensionless
bandw, with 0<=w<1. For the series, asymptotic and auto paths, the shape ofbmust broadcast to the shape ofw; the quad path also supports full array broadcasting.method,n_terms,n_quad,quad_rule,asym_n_termsand the selection thresholds above are static controls. The denominator is 3/2.Returns and shape. Approximation to 2F1(1,b;3/2;w), with the shape of
wexcept for the quad path’s broadcast output.Validity. The Euler integral branch requires 0<b<3/2. The auto selector routes around continuation poles and uses the power series where needed; accuracy still depends on the selected terms, rule and thresholds.
Errors. Unsupported methods or quadrature rules raise ValueError when selected. Out-of-domain values can produce nonfinite or inaccurate results.
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