back to table · edit · history · where entries came from · files · download
3028 bytes, as of the version from 2026-10-25 16:35. Recorded here, not run.
"""Values of the modified Struve function L_nu(x) -- numberdb.org/T494.
Run with SageMath (install numberdb once with sage -pip install numberdb):
sage -python generate.py # verify every stored entry
sage -python checks.py # independent checks, no network
sage -python checks.py --stored # repeat on the database values
sage -python generate.py --fill # write entries to the existing draft
Authenticated operations use NUMBERDB_API_KEY, or --key-stdin to read the
key from stdin. Filling entries does not offer or publish a website draft.
The DLMF 11.2.2 normalization is evaluated using Arb's 1F2 with the positive
real power at x>0. Parameters are exact rationals until they enter ball
arithmetic. The 64-bit guard gives 397 working bits for 100 significant digits.
The retained rectangle has orders 0, 1/2, 1, 3/2, 2 and positive reduced
rationals x<=20 with denominator<=4. The low orders include elementary cases;
the small denominators select simple fractional arguments, spanning small
arguments and the exponential growth regime. The companion H table uses the
same rectangle. checks.py measures the precision, checks the written decimal
intervals, and computes independent certified integral enclosures throughout.
"""
import os
import sys
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.complex_arb import ComplexBallField
WORKING_GUARD = 64
ORDERS = ('0', '1/2', '1', '3/2', '2')
def struve_l(nu, x, precision):
"""Principal modified Struve value, with all rounding enclosed."""
C = ComplexBallField(precision)
n, z = C(nu), C(x)
half_three = QQ(3) / 2
v = ((z / 2) ** (n + 1)
* (z * z / 4).hypergeometric([1], [half_three, n + half_three])
/ (C(half_three).gamma() * (n + half_three).gamma()))
assert v.real().is_finite() and v.imag().is_finite() and v.imag().contains_zero()
return v.real()
class ModifiedStruve(numberdb.Generator):
table = 'T494'
parameters = ('nu', 'x')
type = 'R'
digits = 100
rigour = 'proven'
files = ('generate.py', 'checks.py', 'check.py')
def enumerate(self):
arguments = sorted({QQ(a) / b for b in range(1, 5)
for a in range(1, 20 * b + 1)})
for nu in ORDERS:
for x in arguments:
yield {'nu': nu, 'x': str(x)}
def value(self, params, digits):
return struve_l(QQ(params['nu']), QQ(params['x']),
numberdb.bits(digits, losing=WORKING_GUARD))
if __name__ == '__main__':
if '--key-stdin' in sys.argv or os.environ.get('NUMBERDB_KEY_FROM_STDIN') == '1':
numberdb.configure(api_key=sys.stdin.read().strip())
generator = ModifiedStruve()
if '--fill' in sys.argv:
print(generator.publish(message='Fill modified Struve values after independent integral checks'))
else:
report = generator.verify(sample=None)
print(report)
sys.exit(0 if report.ok else 1)