StruveH¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
StruveH[nu, z]
gives the Struve function H_nu(z), the particular solution of the inhomogeneous Bessel equation with forcing (z/2)^(nu+1).
StruveH[nu, 0] = 0 for Re nu > -1. Numericizes to arbitrary precision via
Notes
H\_nu(z) = (z/2)^(nu+1) (2/(Sqrt\[Pi\] Gamma\[nu+3/2\])) 1F2(1; 3/2, nu+3/2; -z^2/4). FLINT/arb (the regularized 1F2, rigorous, all nu and complex z), and at machine precision via a fast real double kernel (convergent series / Y\_nu+K\_nu asymptotic) that also serves the packed/NDArray and Compile\[\] paths. Listable.Examples (13)¶
Every input below was run against the current Mathilda build and its output recorded.
Basic examples (3)¶
In[1]:= StruveH[0, 1.5]
Out[1]= 0.736723
In[2]:= N[StruveH[1, 13/10], 30]
Out[2]= 0.3201231459764202395239403961771
In[3]:= StruveH[1, {0.5, 1., 2.}]
Out[3]= {0.0521737, 0.198457, 0.646764}
Applications (10)¶
No closed form is substituted for exact symbolic input
Machine value from the double series kernel
The Poisson-type integral (2/π)∫ sin(z cos θ) dθ gives the same number
Agreement with the elementary half-integer form, to rounding
Arbitrary precision through the regularized 1F2 in arb
The arb path at ν = -3/2, checked against H_{-3/2} = -J_{3/2}
Large argument: the Y_ν + K_ν asymptotic regime
Independent check of the previous line
Listable; a packed list runs the same kernel
Complex z needs N: the machine kernel is real-only
Algorithm¶
Mathilda -- the Struve function H_nu(z).
Evaluation:
StruveH[nu, 0] = 0 exact, for a real nu > -1
numeric nu and inexact z via the 1F2 representation (reusing the tested
HypergeometricPFQ numeric evaluator)
everything else stays symbolic (return NULL)
The 1F2 identity is also the reduction used by the half-line Mellin transform (reduce_to_hypergeometric in integrate_ramanujan.c), so Integrate[x^(s-1) StruveH[0, a x], {x,0,Infinity}] closes through rec_pfq.
Attributes: Listable, NumericFunction, Protected.
Implementation notes¶
Algorithm. builtin_struveh first returns the exact 0 when z is the integer 0 and ν is real with ν > −1. It then numericizes only when some argument is inexact and both are numeric quantities. The output precision is the smallest inexact bit count among the arguments.
- Above 53 bits,
flint_num_struvehevaluates(z/2)^(ν+1) · acb_hypgeom_pfq(1; 3/2, ν+3/2; −z²/4, regularized)in arb. The regularized 1F2 absorbs the1/Γ(ν+3/2)pole, so every complex ν works. The starting working precision includes a cancellation allowance of about 1.45·|z| + 8 bits. Thenb_should_retry/nb_emit_bitsladder doubles the precision until the ball radius certifies the requested digits. - At machine precision with real ν and z,
sf_machine_struve_hruns two regimes. Each returns a value together with a predicted relative error: struve_series, the convergent 1F2 series. Its error estimate is the measured cancellationmax|term|/|sum| · ε.struve_asymp, which computesY_ν + K_νfrom two optimally truncated divergent series. Its error estimate is the size of the smallest omitted term.
The kernel keeps the regime with the smaller predicted error and declines when even that one exceeds STRUVE_ACCEPT = 1e-7. A declined real z is retried through an expression template built on HypergeometricPFQ.
Data structures. The machine path works only on scalar doubles and keeps nothing between calls. The arb path uses acb_t balls for ν, z and the result, plus acb_struct parameter arrays for the 1F2. In src/ndkernels.c, NDK_BIN2(StruveH, sf_machine_struve_h) and REG_B register the same kernel for packed lists and NDArray, and Compile[] lowers it at scalar and rank-1 shapes. Every surface calls the same function, so the results are bit-identical.
Complexity / limits. The series costs O(|z|) terms, with a cap of 8000. The asymptotic regime stops at its least term, at most 400 terms. The two error curves cross near z ≈ 12–24 for small ν, and there the double result is only good to about 1e-9 absolute. There is no complex machine kernel, so a machine complex z stays unevaluated; an exact complex z under N works through arb. There is no D rule. One defect: at a non-positive half-integer ν (where Γ(ν+3/2) has a pole), the machine fallback template returns an unevaluated 0.0 HypergeometricPFQ[...] instead of a number. The arb path gets these values right.
- Exact value:
StruveH[nu, 0] = 0for a real ν > −1. - Arbitrary precision (
N[StruveH[ν, z], p]with an exact or MPFR argument): the rigorous FLINT/arb kernelH_ν(z) = (z/2)^(ν+1) · ₁F̃₂(1; 3/2, ν+3/2; −z²/4)(the regularized ₁F₂, so it is entire in ν — no pole to dodge — and valid for all ν over the whole complex plane). The working precision carries a cancellation allowance (~1.44·|z| bits) so a large |z| is resolved without blind doubling; the ball ladder renders only correct digits. Example:N[StruveH[1, 13/10], 50] = 0.32012314597642023952394039617728160520311127053816(matches mpmath). - Machine precision: a fast real
doublekernel — the convergent ₁F₂-form series for small/moderate |z|, theY_ν + K_νasymptotic (DLMF 11.6.1 + 10.17.4) for large |z| — shared bit-for-bit with the packed/NDArray kernel andCompile[](StruveH[0, 1.5] = 0.736723, matching the integral representation (2/π)∫₀^(π/2) sin(z cos θ) dθ). Accurate to the double floor everywhere; in the narrow transition band z ∈ [~17, ~24] (small ν) both elementary series are intrinsically ill-conditioned and the result degrades to ~1e-9 absolute (as it does for every double implementation, scipy included) — the arb path above gives full precision there. A real argument the kernel declines falls back to the ₁F₂ template; a complex machine argument stays unevaluated (useNon an exact argument:N[StruveH[0, 1 + I], 20]goes through arb). - Mellin transform:
∫₀^∞ x^(s-1) StruveH[0, a x] dx = π 2^(s-1) a^(-s)/(Cos(πs/2) Γ(1−s/2)²), closed byMethod -> "Mellin"through the ₁F₂ reduction.
Attributes: Listable, NumericFunction, Protected.
References¶
See also: N
- DLMF §11.2.1 — the power series H_ν(z) = (z/2)^(ν+1) Σ (−1)^k (z/2)^(2k)/(Γ(k+3/2) Γ(k+ν+3/2)).
- DLMF §11.6.1 — the large-argument asymptotic expansion of K_ν = H_ν − Y_ν; DLMF §10.17.4 — the Hankel asymptotic expansion of Y_ν.
- Source:
src/special_functions/struveh.c - Specification:
docs/spec/builtins/special-functions.md - Tests:
tests/test_integrate_ramanujan.c - Tests:
tests/test_struveh.c
Notes & additional examples¶
Notes¶
Listable,NumericFunction,Protected. Exact input is never rewritten:StruveH[1/2, x]stays as it is.- The only exact value is
StruveH[nu, 0] = 0for a real ν > −1. - Machine-precision real input runs
sf_machine_struve_h: the convergent 1F2 series, or for large z theY_ν + K_νasymptotic, whichever predicts the smaller error. The same kernel backs packed lists,NDArrayandCompile[](scalar and rank-1), so all of them agree bit for bit. Between about z = 17 and z = 24 (small ν) the double answer is good to about 1e-9 absolute;N[..., p]gives full precision there. - With precision above machine (
N[StruveH[ν, z], p], or an MPFR argument) the value comes from FLINT/arb as(z/2)^(ν+1) · 1F2~(1; 3/2, ν+3/2; −z²/4), using the regularized 1F2, so it holds for any complex ν and z. - A machine complex argument (
StruveH[0, 1. + I]) stays unevaluated. UseNon exact input to get a complex value. - No derivative rule exists yet:
D[StruveH[n, x], x]returns an inertDerivative[0, 1][StruveH][n, x], soSeriesat a regular point yields onlyDerivativecoefficients. - See also:
BesselJ,BesselY,HypergeometricPFQ.