numba-bessel 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+
2
+ MIT License
3
+
4
+ Copyright (c) 2026 34j
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ include conftest.py
2
+ recursive-include docs *.md
3
+ recursive-include tests *.md *.py
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: numba-bessel
3
+ Version: 0.1.0
4
+ Summary: Bessel functions in numba / numba-cuda-mlir
5
+ Author-email: 34j <34j.github@proton.me>
6
+ License-Expression: MIT
7
+ Project-URL: Bug Tracker, https://github.com/34j/numba-bessel/issues
8
+ Project-URL: Changelog, https://github.com/34j/numba-bessel/blob/main/CHANGELOG.md
9
+ Project-URL: documentation, https://numba-bessel.readthedocs.io
10
+ Project-URL: repository, https://github.com/34j/numba-bessel
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numba>=0.63
25
+ Requires-Dist: numpy>=1.22
26
+ Provides-Extra: cuda
27
+ Requires-Dist: numba-cuda-mlir[cu13]>=0.6.1; extra == "cuda"
28
+ Dynamic: license-file
29
+
30
+ # numba-bessel
31
+
32
+ <p align="center">
33
+ <a href="https://github.com/34j/numba-bessel/actions/workflows/ci.yml?query=branch%3Amain">
34
+ <img src="https://img.shields.io/github/actions/workflow/status/34j/numba-bessel/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
35
+ </a>
36
+ <a href="https://numba-bessel.readthedocs.io">
37
+ <img src="https://img.shields.io/readthedocs/numba-bessel.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
38
+ </a>
39
+ <a href="https://codecov.io/gh/34j/numba-bessel">
40
+ <img src="https://img.shields.io/codecov/c/github/34j/numba-bessel.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
41
+ </a>
42
+ </p>
43
+ <p align="center">
44
+ <a href="https://github.com/astral-sh/uv">
45
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
46
+ </a>
47
+ <a href="https://github.com/astral-sh/ruff">
48
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
49
+ </a>
50
+ <a href="https://github.com/j178/prek">
51
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json" alt="prek">
52
+ </a>
53
+ </p>
54
+ <p align="center">
55
+ <a href="https://pypi.org/project/numba-bessel/">
56
+ <img src="https://img.shields.io/pypi/v/numba-bessel.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
57
+ </a>
58
+ <img src="https://img.shields.io/pypi/pyversions/numba-bessel.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
59
+ <img src="https://img.shields.io/pypi/l/numba-bessel.svg?style=flat-square" alt="License">
60
+ </p>
61
+
62
+ ---
63
+
64
+ **Documentation**: <a href="https://numba-bessel.readthedocs.io" target="_blank">https://numba-bessel.readthedocs.io </a>
65
+
66
+ **Source Code**: <a href="https://github.com/34j/numba-bessel" target="_blank">https://github.com/34j/numba-bessel </a>
67
+
68
+ ---
69
+
70
+ Bessel functions in numba / numba-cuda-mlir
71
+
72
+ ## Installation
73
+
74
+ Install this via pip (or your favourite package manager):
75
+
76
+ `pip install numba-bessel`
77
+
78
+ ## Supported inputs
79
+
80
+ The first release computes complex `J`, `Y`, `I`, and `K` at orders `ν+n`
81
+ for `0 ≤ ν < 1`, `0 ≤ n ≤ 8`, and `¼ ≤ max(|Re z|, |Im z|) ≤ 2.5`.
82
+ Calls outside that domain report a failure status. Both signed-zero sides of
83
+ the negative-real cut are supported.
84
+
85
+ See the [usage guide](docs/usage.md), [literature findings](docs/findings.md),
86
+ and [mathematical derivation](docs/algorithm.md).
87
+
88
+ ## Contributors ✨
89
+
90
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
91
+
92
+ <!-- prettier-ignore-start -->
93
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
94
+ <!-- markdownlint-disable -->
95
+ <!-- markdownlint-enable -->
96
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
97
+ <!-- prettier-ignore-end -->
98
+
99
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
100
+
101
+ ## Credits
102
+
103
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)
104
+
105
+ This package was created with
106
+ [Copier](https://copier.readthedocs.io/) and the
107
+ [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
108
+ project template.
@@ -0,0 +1,79 @@
1
+ # numba-bessel
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/34j/numba-bessel/actions/workflows/ci.yml?query=branch%3Amain">
5
+ <img src="https://img.shields.io/github/actions/workflow/status/34j/numba-bessel/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
6
+ </a>
7
+ <a href="https://numba-bessel.readthedocs.io">
8
+ <img src="https://img.shields.io/readthedocs/numba-bessel.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
9
+ </a>
10
+ <a href="https://codecov.io/gh/34j/numba-bessel">
11
+ <img src="https://img.shields.io/codecov/c/github/34j/numba-bessel.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
12
+ </a>
13
+ </p>
14
+ <p align="center">
15
+ <a href="https://github.com/astral-sh/uv">
16
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
17
+ </a>
18
+ <a href="https://github.com/astral-sh/ruff">
19
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
20
+ </a>
21
+ <a href="https://github.com/j178/prek">
22
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json" alt="prek">
23
+ </a>
24
+ </p>
25
+ <p align="center">
26
+ <a href="https://pypi.org/project/numba-bessel/">
27
+ <img src="https://img.shields.io/pypi/v/numba-bessel.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
28
+ </a>
29
+ <img src="https://img.shields.io/pypi/pyversions/numba-bessel.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
30
+ <img src="https://img.shields.io/pypi/l/numba-bessel.svg?style=flat-square" alt="License">
31
+ </p>
32
+
33
+ ---
34
+
35
+ **Documentation**: <a href="https://numba-bessel.readthedocs.io" target="_blank">https://numba-bessel.readthedocs.io </a>
36
+
37
+ **Source Code**: <a href="https://github.com/34j/numba-bessel" target="_blank">https://github.com/34j/numba-bessel </a>
38
+
39
+ ---
40
+
41
+ Bessel functions in numba / numba-cuda-mlir
42
+
43
+ ## Installation
44
+
45
+ Install this via pip (or your favourite package manager):
46
+
47
+ `pip install numba-bessel`
48
+
49
+ ## Supported inputs
50
+
51
+ The first release computes complex `J`, `Y`, `I`, and `K` at orders `ν+n`
52
+ for `0 ≤ ν < 1`, `0 ≤ n ≤ 8`, and `¼ ≤ max(|Re z|, |Im z|) ≤ 2.5`.
53
+ Calls outside that domain report a failure status. Both signed-zero sides of
54
+ the negative-real cut are supported.
55
+
56
+ See the [usage guide](docs/usage.md), [literature findings](docs/findings.md),
57
+ and [mathematical derivation](docs/algorithm.md).
58
+
59
+ ## Contributors ✨
60
+
61
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
62
+
63
+ <!-- prettier-ignore-start -->
64
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
65
+ <!-- markdownlint-disable -->
66
+ <!-- markdownlint-enable -->
67
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
68
+ <!-- prettier-ignore-end -->
69
+
70
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
71
+
72
+ ## Credits
73
+
74
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)
75
+
76
+ This package was created with
77
+ [Copier](https://copier.readthedocs.io/) and the
78
+ [browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
79
+ project template.
@@ -0,0 +1,32 @@
1
+ from sybil import Sybil
2
+ from sybil.evaluators.doctest import NUMBER
3
+ from sybil.parsers.myst import ClearNamespaceParser as MarkdownClearNamespaceParser
4
+ from sybil.parsers.myst import DocTestDirectiveParser as MarkdownDocTestParser
5
+ from sybil.parsers.myst import PythonCodeBlockParser as MarkdownPythonCodeBlockParser
6
+ from sybil.parsers.myst import SkipParser as MarkdownSkipParser
7
+ from sybil.parsers.rest import ClearNamespaceParser as ReSTClearNamespaceParser
8
+ from sybil.parsers.rest import DocTestParser as ReSTDocTestParser
9
+ from sybil.parsers.rest import PythonCodeBlockParser as ReSTPythonCodeBlockParser
10
+ from sybil.parsers.rest import SkipParser as ReSTSkipParser
11
+
12
+ markdown_examples = Sybil(
13
+ parsers=[
14
+ MarkdownDocTestParser(NUMBER),
15
+ MarkdownPythonCodeBlockParser(doctest_optionflags=NUMBER),
16
+ MarkdownSkipParser(),
17
+ MarkdownClearNamespaceParser(),
18
+ ],
19
+ patterns=["*.md"],
20
+ )
21
+
22
+ rest_examples = Sybil(
23
+ parsers=[
24
+ ReSTDocTestParser(NUMBER),
25
+ ReSTPythonCodeBlockParser(),
26
+ ReSTSkipParser(),
27
+ ReSTClearNamespaceParser(),
28
+ ],
29
+ patterns=["*.py", "*.rst"],
30
+ )
31
+
32
+ pytest_collect_file = (markdown_examples + rest_examples).pytest()
@@ -0,0 +1,246 @@
1
+ # Complex Bessel functions: derivation and production baseline
2
+
3
+ **v0.1: use the bounded series design in §9.** Sections 1–5 give the mathematical derivation; §§6–8 retain the broader AMOS/CF2 investigation for future expansion, not v0.1 dispatch or fallback. This is a design, not an implementation or a performance claim. The independent oracle is external. The mathematical order is the **exact real** `α = ν+n`; imaginary `+0` selects the upper lip of the negative real axis and `−0` the lower lip.
4
+
5
+ ## 1. Two function families on the closed right half-plane
6
+
7
+ Use the principal sheet. Let `P_s=e^(s iπα)` and `p_s=e^(s iπα/2)` for `s=±1`. Build phases from `ν` and `n mod 4` (or exact phase reduction), not by multiplying a rounded `ν+n` by π. Preserve the input lip before conversion to any arithmetic type without signed zeros. On the left half-plane set `q=-z` and choose `s` so `z=q e^(s iπ)` by rotation, i.e. the sign of `Im z` including the cut bit. With all RHS functions at `q` and order `α`,
8
+
9
+ | Function at `z` | Continuation |
10
+ | --- | --- |
11
+ | `I` | `P_s I` |
12
+ | `K` | `P_{-s} K − s iπ I` |
13
+ | `J` | `P_s J` |
14
+ | `Y` | `P_{-s} Y + 2s i cos(πα) J` |
15
+
16
+ These are [DLMF 10.11.1–2](https://dlmf.nist.gov/10.11) and [10.34.1–2](https://dlmf.nist.gov/10.34) at rotations `±π`. The ratios of sines cancel *symbolically*; the formulas hold at integer order by continuity. Do not evaluate the unsimplified formulas. In particular integer `J/I` have no jump, while `Y/K` generally do.
17
+
18
+ For an ordinary-Bessel evaluation at `q` in the closed right half-plane (including an input already there), use `s` for the sign of `Im q` and `w=−s i q`; either side works on the positive real axis. Both `q` and `w` are in the closed right half-plane. Then
19
+
20
+ \[
21
+ J_\alpha(q)=p_s I_\alpha(w),\qquad
22
+ Y_\alpha(q)=s i J_\alpha(q)-\frac{2}{\pi}p_{-s}K_\alpha(w).
23
+ \]
24
+
25
+ The series gives the `J` rotation; [DLMF 10.27.8](https://dlmf.nist.gov/10.27.E8) gives `H^(1)` on the upper half-plane and `H^(2)` on the lower, with `H^(s) = J+s iY`. These identities avoid division by `sin(πα)` and avoid a difference of *two growing Hankel functions* for `J`. They do not remove cancellation in `Y` or branch restoration. Propagate each term's ball (including scale and phase); do not decide accuracy using a relative error for each core function alone. A particularly delicate case is a tiny Cartesian component produced by cancellation of large terms.
26
+
27
+ ## 2. Direct seeds and a rigorous large-argument shortcut
28
+
29
+ ### I: convergent series for any nonnegative order
30
+
31
+ On the right half-plane use `S = (w/2)^α / Γ(1+α)`, `v=w²/4`, and `t_0=1`, `t_{k+1}=t_k v/[(k+1)(k+1+α)]`. Then `I_α=S Σ t_k`. For truncation before `t_N`, take an outward upper bound `q_N` on `|v|/[(N+1)(N+1+α)]`. If `q_N<1`, an absolute tail bound is `|S| |t_N|/(1−q_N)`. This follows from the decreasing successive ratio bound. Enclose the retained sum separately. Compute powers via the exact order and the chosen log; keep exponent and significand separate where necessary. This terminates in exact arithmetic for every finite `w`, but oscillatory cancellation and term count can be prohibitive. Small term size relative to the last term is not a stopping test. cf. Johansson, §4.1 theorem 1, for the general hypergeometric tail argument.
32
+
33
+ ### K: a uniform small-base-order seed without a near-integer quotient
34
+
35
+ Reduce to `μ=ν−r ∈ [−1/2,1/2]` with `r=0` or `1`. With `G(β)=I_β(w)` and analytic continuation at zero order,
36
+
37
+ \[
38
+ K_\mu(w)=-\frac{1}{2\,\mathrm{sinc}(\pi\mu)}\int_{-1}^{1}G'(\mu t)\,dt,
39
+ \qquad \mathrm{sinc}(x)=\sin(x)/x .
40
+ \]
41
+
42
+ Here the prime is the **order derivative**. This is [DLMF 10.27.4](https://dlmf.nist.gov/10.27.E4) and the fundamental theorem of calculus; the prefactor is nonsingular with `sinc(πμ)≥2/π`. Compute it as a removable analytic function, not as `0/0`. Obtain `∂_w K_μ` by differentiating the integral in `w`. Recover `K_{μ+1}=μ K_μ/w − ∂_w K_μ`. The desired index in this ladder is `j=n+r`. The formula applies to signed `μ` and is valid at `μ=0`, including subnormal approaches to zero.
43
+
44
+ For a concrete certificate, write the individual terms as `B_k(β)=(w/2)^β v^k/[k! Γ(1+β+k)]`. On the union of disks of radius `1/4` around real orders in `[-1/2,1/2]`, `Re β≥−3/4`, so the ratio after `B_N` is at most `q=|v|/[(N+1)(N+1/4)]`. Let `B` bound `|B_N|` on the covering box, using interval exp and reciprocal gamma (or recurrence from `B_0`). For `q<1`, Cauchy's derivative bound on those disks bounds the omitted **order derivative** by `4B/(1−q)`. Similarly the tail of `∂_w I` before order differentiation is bounded there by
45
+
46
+ \[
47
+ \frac{B}{|w|}\left(\frac{2N+1}{1-q}+\frac{2q}{(1-q)^2}\right),
48
+ \]
49
+
50
+ since `|β|≤1` on the covering box and `∂_w B_k=(β+2k)B_k/w`. Multiply by 4 for its order derivative. Integrate finite derivatives with interval range quadrature (sum panel lengths times outward interval ranges on `β=μt`), then add integrated tail bounds and apply the prefactor. Derivatives of retained terms may use `B_k′=B_k[log(w/2)−ψ(1+β+k)]` and the product rule. Finite range quadrature converges by subdivision with convergent interval primitives. This is a bounded-error seed *formula*, not a claim that complex reciprocal gamma, digamma, or that quadrature is cheap on GPU. The positive-real anchor below needs none of those order derivatives.
51
+
52
+ ### K: large argument via an explicit absolute remainder
53
+
54
+ For real `α≥0`, let `a=α+1/2`. On `w≠0`, `|arg w|<π`, the integral form of Kummer U ([DLMF 10.39.6](https://dlmf.nist.gov/10.39.E6), [13.4.4](https://dlmf.nist.gov/13.4.E4)) yields
55
+
56
+ \[
57
+ K_\alpha(w)=\sqrt{\pi/(2w)}e^{-w}\frac1{\Gamma(a)}
58
+ \int_0^\infty e^{-t}t^{a-1}(1+t/(2w))^{a-1}\,dt.
59
+ \]
60
+
61
+ It follows by substitution for positive `w`; the RHS continues analytically by compact domination in the slit plane. Expand the last power through degree `N−1`, with integer `N≥1` and `N≥a−1`. The resulting normalized sum is `Σ a_k/w^k` where `a_0=1`, `a_k/a_{k−1}=(4α²−(2k−1)²)/(8k)` (use multiplication, including zero coefficients). Put `d=1` for `Re w≥0`, otherwise take any certified positive lower bound for `|Im w|/|w|`. The normalized remainder satisfies
62
+
63
+ \[
64
+ |R_N|\le |a_N/w^N|\, d^{a-1-N}.
65
+ \]
66
+
67
+ Indeed `|1+u t/(2w)|≥d` for `0≤u≤1` by the distance from zero to a ray. The Taylor integral remainder is bounded by `|binom(a−1,N)| |t/(2w)|^N d^(a−1−N)`, since the last exponent is nonpositive. Integrate using `Γ(a+N)/Γ(a)`. Multiply by the modulus of the prefactor for absolute error, or work scaled. A zero coefficient in a terminating half-integer expansion is exact (the derivative in this proof vanishes). This simple bound is not uniform near the negative real axis or when `α` is large relative to `|w|`. It is not a licence to keep adding terms until the divergent expansion converges. Nemes's theorems 1.1–1.2 give more refined terminant representations (in particular `|Re α|<N+1/2`, `|arg w|<3π/2` for the K remainder on the appropriate sheet); any tighter bound requires checking its own hypotheses and phase conventions.
68
+
69
+ An optional `I` shortcut near the imaginary axis preserves both exponentials: for right-half-plane `w` with `Im w≠0`, choose `s=−sign(Im w)` and compute
70
+
71
+ \[
72
+ I_\alpha(w)=\frac{P_{-s}K_\alpha(w)-K_\alpha(w e^{s i\pi})}{s\pi i}.
73
+ \]
74
+
75
+ Use the above asymptotic ball for the rotated argument **directly**, not the continuation that already needs `I`. Reject if either ball or the subtraction cannot meet the downstream budget. The rotated bound can become useless near the positive real axis; this is not a single-exponential expansion for `I` and is not proposed as one. In particular it does not discard an exponentially small term on a boundary where it becomes comparable.
76
+
77
+ ### I: an endpoint bound in the growing sector
78
+
79
+ A complementary certificate near the positive real direction follows from [DLMF 10.32.2](https://dlmf.nist.gov/10.32.E2). With `a=α+1/2` and `x=Re w>0`, the normalized function `sqrt(2πw) e^(−w) I_α(w)` equals `w^a/Γ(a)` times
80
+
81
+ \[
82
+ \int_0^2 e^{-wt}t^{a-1}(1-t/2)^{a-1}\,dt.
83
+ \]
84
+
85
+ Expand `(1−t/2)^(a−1)` on `[0,1]` with `b_k=(−1/2)^k binom(a−1,k)` and extend the integrated polynomial to `[0,∞)`; the normalized sum is `Σ_{k<N} (−1)^k a_k/w^k` with the same coefficients as K. For `N≥1`, `N≥a−1`, and `x>max(0,a+N−2)`, bound the normalized remainder by `|w|^a/Γ(a)` times the sum of the following three nonnegative bounds:
86
+
87
+ 1. On `[0,1]`, Taylor's remainder: `|b_N| 2^(N+1−a) Γ(a+N)/x^(a+N)`, since `1−t/2≥1/2` and the remaining power is nonpositive.
88
+ 2. The omitted original endpoint `[1,2]`: `exp(−x) max(1,2^(a−1)) 2^(1−a)/a`, from integrating `(1−t/2)^(a−1)` exactly and bounding `t^(a−1)`.
89
+ 3. The artificial polynomial tail `[1,∞)`: `exp(−x) Σ_{k<N} |b_k|/[x−max(a+k−1,0)]`, using `t^(a+k−1)≤exp(max(a+k−1,0)(t−1))`.
90
+
91
+ This explicitly accounts for the other endpoint; it does not assume that endpoint is negligible. Even when the polynomial terminates, terms 2–3 still matter (e.g. the second exponential in `I_(1/2)`). The bound is deliberately conservative and may be useless as `x/|w|` decreases or order increases. Try the two-K formula, convergent series, or a separately certified regime there; no guessed sector boundary is needed to justify the estimates.
92
+
93
+ ## 3. Certified argument transport: a small alternative to a full AMOS port
94
+
95
+ For `K_β` at any nonnegative seed order `β`, one independent positive-real anchor is at `w=1`:
96
+
97
+ \[
98
+ K_\beta^{(d)}(1)=(-1)^d\int_0^\infty e^{-\cosh t}(\cosh t)^d\cosh(\beta t)\,dt,\qquad d=0,1.
99
+ \]
100
+
101
+ Here `(d)` is the **argument derivative** ([DLMF 10.32.9](https://dlmf.nist.gov/10.32.E9), differentiating under the integral). On `[0,T]`, integrate by outward range quadrature, or a faster rule with a proved remainder. For the tail put `U=e^T/2` and `b=β+d−1`. A computable bound, for `U>max(b,0)`, is
102
+
103
+ \[
104
+ 2^{\beta+d}\frac{e^{-U}U^b}{1-\max(b,0)/U}.
105
+ \]
106
+
107
+ Use `cosh t≥e^t/2`, `cosh(βt)≤e^(βt)` and substitute `u=e^t/2`; then use `(1+v/U)^b≤e^(max(b,0)v/U)` for `u=U+v`. This anchor can supply `K_ν` and its derivative, hence `K_{ν+1}`, without integer-order singularities. The convergent I series supplies an I anchor if wanted; its argument derivative follows from `∂_w I_β=I_{β+1}+β I_β/w`.
108
+
109
+ **Taylor construction.** For either solution `f`, use `w² f″+w f′−(w²+β²)f=0`. At `w_0≠0`, set `P(ξ)=Σ c_k ξ^k`, `ξ=w−w_0`, with initial centers `c_0,c_1`; solve successively (negative subscripts are zero)
110
+
111
+ \[
112
+ w_0^2(k+2)(k+1)c_{k+2}=-w_0(k+1)(2k+1)c_{k+1}
113
+ -(k^2-w_0^2-\beta^2)c_k+2w_0c_{k-1}+c_{k-2}.
114
+ \]
115
+
116
+ There is no need to assume high coefficients were computed exactly: certify the *actual* center polynomial. The residual `R(ξ)=(w_0+ξ)^2P″+(w_0+ξ)P′−((w_0+ξ)^2+β²)P` is a finite polynomial; compute outward coefficients including any terms of low degree that fail to cancel because of rounding. On a step `w(t)=w_0+t h`, `0≤t≤1`, bound `|R(th)|` by the sum of coefficient magnitude bounds times `|h|^k` (or subdivided interval ranges). Keep steps inside the chosen analytic sheet and away from zero. For convergence of Taylor truncation choose `|h|<|w_0|`, e.g. `≤|w_0|/2`.
117
+
118
+ **Defect theorem.** Fix a positive scale `λ` for the step and use the state `(f,w f′/λ)` with complex max norm. Along the segment it solves `X′=A X` with
119
+
120
+ \[
121
+ A(t)=\frac{h}{w(t)}\begin{pmatrix}0&\lambda\\(w(t)^2+\beta^2)/\lambda&0\end{pmatrix}.
122
+ \]
123
+
124
+ The state built from `P` solves the same equation plus a defect `(0,h R/(λ w(t)))`. If `l>0` is a lower bound on `|w(t)|`, `u` an upper bound, `ρ≥sup |R|` and `E_0` bounds the initial state error, choose
125
+
126
+ \[
127
+ M=\frac{|h|}{l}\max(\lambda,(u^2+\beta^2)/\lambda),\qquad D=\frac{|h|\rho}{\lambda l}.
128
+ \]
129
+
130
+ The endpoint error is at most `exp(M) E_0 + φ(M) D`, `φ(M)=(exp(M)−1)/M`, `φ(0)=1`. Subtract the two equations, use variation of constants and bound the propagator from `t` to 1 by `exp(M(1−t))`. Include interval endpoint polynomial evaluation error and any exact rescaling of the derivative state before the next step. A lower bound for `l` is `|w_0|−|h|`; sharper geometry is optional. This gives a posteriori truncation **and** rounding control; no last-term heuristic or trust in rounded Taylor coefficients is needed.
131
+
132
+ For any fixed finite nonzero target in the closed right half-plane the segment from 1 avoids zero and admits a finite partition with strictly interior Taylor steps. With arbitrary precision and order, anchor errors and defects can be made arbitrarily small: convergent Taylor series and their first two derivatives converge uniformly on each strict subdisk, and the finite product of step amplifications is finite. This does **not** give a useful binary64 work bound. In particular forward transport of recessive `K` can admit growing `I` contamination; smaller steps alone do not fix amplification of initial error. Try a certified local seed first, or a certified exterior K anchor and transport back toward the target; choose only by a sufficient error budget. Even that may need a sharper scaled transfer bound in complex regions.
133
+
134
+ ## 4. Shifts, normalization and failure rules
135
+
136
+ `K_{β+1}=K_{β−1}+2β K_β/w` and `I_{β−1}=I_{β+1}+2β I_β/w` ([DLMF §10.29](https://dlmf.nist.gov/10.29)). For upward K combine certified `K` seeds and propagate outward, with local contribution `|2β/w| E_j+E_{j−1}` plus rounding/coefficients if using scalar radii. Do not label upward recurrence uniformly accurate in the complex plane; assess the final enclosure. For I at an isolated order the direct series (or direct certified shortcut) is a fallback to recurrence. Never use unguarded forward I recurrence to reach a small solution.
137
+
138
+ A **finite Miller certificate** for the `ν+j` ladder is available when a long ladder justifies it. Write `I_j=I_{ν+j}(w)`, `K_j=K_{ν+j}(w)`, and `D_j=(−1)^j K_j`. Then `I_j,D_j` solve the same I recurrence. Choose `M≥n`; certify `K_{M+1}≠0`. Backward propagation from trial `V_M=1,V_{M+1}=0` and the cross-product normalization give
139
+
140
+ \[
141
+ W=V_j K_{j+1}+V_{j+1}K_j,\qquad Q_j=V_j/(wW).
142
+ \]
143
+
144
+ Use any adjacent pair available for normalization, with a nonzero enclosure for `W`; the cross-product is invariant across indices by the recurrences. The exact identity `I_jK_{j+1}+I_{j+1}K_j=1/w` ([DLMF 10.28.2](https://dlmf.nist.gov/10.28.E2)) and zero cross-product for `D` show that `Q_j=I_j−(I_{M+1}/D_{M+1})D_j`. Hence add the explicit error radius
145
+
146
+ \[
147
+ E_j^{\mathrm{terminal}} \le U_I(M+1)\,U_K(j)/L_K(M+1),
148
+ \]
149
+
150
+ where `U` and `L` are certified modulus bounds. One crude upper bound is `U_I(m)=|(w/2)^(ν+m)/Γ(1+ν+m)| exp(|w|²/[4(1+ν+m)])`, from the series and `(1+ν+m)_k≥(1+ν+m)^k`. Sharpen with the direct series if needed. Trial and normalization rounding are additional to this terminal radius. This bound can fail to be useful if `K` enclosures are wide, near an I zero the requested relative tolerance is unattainable, or an excessively large `M` is necessary. Reject or re-evaluate by another certified route. Agreement of two cutoffs or a small Wronskian residual alone is not a certificate. This construction does not prove a uniformly cheap cutoff.
151
+
152
+ Use separate scaled balls for quantities with disparate dynamic ranges, not a shared scale that erases the smaller term by construction. Evaluate recurrence coefficients, phases, powers and scale conversions with certified errors; a nominal binary64 expression with exact symbolic inputs does not itself certify exact order semantics. For all candidate routes propagate to the final complex components before testing the error budget. Use outward arithmetic, an independently justified implementation of elementary bounds, and component-aware range conversion. Never replace a failed certificate with zero or infinity merely because an intermediate scale crosses a floating-point threshold. Near zeros use a predeclared absolute/local-scale requirement; where correct rounding is required enclose the answer in a single rounding cell or prove a tie. This derivation does not guarantee exact ties are resolved by precision escalation. Exhausting a work or precision budget is an explicit unresolved outcome, not evidence for success.
153
+
154
+ ## 5. Alternatives and limits
155
+
156
+ - **AMOS port.** Amos, SAND83-0086 (1983), §§1–4, uses the same I/K reduction plus small-argument K series, Miller-type methods and Wronskian normalization. SAND83-0643 adds large-order uniform and turning-region machinery; Algorithm 644 is the mature baseline for comparisons. Porting it offers wide practical coverage, but imports regional switches, scaling, conservative machine/range guards and large-order machinery. A literal port is not a proof of exact split-order, lip, extended range or strict component rounding semantics. Audit code provenance and license before any port. Neither report is being dismissed on performance grounds without measurements.
157
+ - **Smaller certified core.** The formulas above give a truncation/defect/terminal certificate for each proposed route (and mathematical fallback via direct I and anchor/transport K). They are attractive for a bounded envelope, shared CPU/GPU math and low duplication. Neither uniform latency nor a binary64-only precision bound follows; phase reduction for huge arguments, recession, cancellation, and turning/large-order regimes can dominate. Need an explicit supported envelope or better uniform Airy/sector-specific methods before claiming comparable production coverage.
158
+ - **Other evidence.** [Johansson, arXiv:1606.06977](https://arxiv.org/abs/1606.06977) gives ball-arithmetic hypergeometric tail, order-series and asymptotic techniques; it is a model for certification, not a GPU budget. [Nemes, arXiv:1606.07961](https://arxiv.org/abs/1606.07961) supplies rigorous large-argument remainders, not uniform large-order turning coverage. [Zaghloul–Johnson I](https://arxiv.org/abs/2505.09770), [II](https://arxiv.org/abs/2606.14839), [III](https://arxiv.org/abs/2606.14937) motivate stable regional formulas, Temme/Miller K and improved range handling; their reported tests and switch choices are not proofs for this API. [Bremer, arXiv:1705.07820](https://arxiv.org/abs/1705.07820), §§3–6, motivates ODE/phase and tables for **positive real arguments**, not certified continuation of those tables in complex argument. Gil–Segura–Temme and [Dunster–Gil–Segura's Cauchy-integral turning-point approach](https://arxiv.org/abs/1607.08269) are leads for uniform machinery, not a transferred error bound. The available Dunster arXiv:2412.12595 studies *imaginary order*; its bounds do not close the real-order gap here.
159
+
160
+ Sections 1–5 derive the mathematical candidate and its guarantees, not the production acceptance criteria. The decision and executable design constraints (not runtime code) follow.
161
+
162
+ ## 6. Broader-domain candidate: AMOS portfolio, deferred beyond v0.1
163
+
164
+ For a future expanded envelope, use the right-half-plane reduction of §1, then an AMOS-derived scaled I/K portfolio. Use §2's certified shortcuts where their actual error and work fit; do not use Taylor continuation as a silent device fallback. [Findings](findings.md) records source provenance and the release blockers. This is a selection of what to port and qualify, not a license to ship inherited IEEE behavior or a claim of per-call certification. The qualification scope starts with nonnegative shifts.
165
+
166
+ **Core ordering and numerical boundaries.** Let `r=|w|` (scaled hypot), `h` be the highest order called for by the internal computation, and `x=Re w`, `y=|Im w|`. These are nominal AMOS/XFS routing values, not proved error boundaries. Respect any additional seed/scale checks in the named source; these rules describe the route portfolio, not a reimplementation of every legacy return code.
167
+
168
+ | Route | Initial rule and recovery |
169
+ | --- | --- |
170
+ | I: direct series | Try for `r≤2` or `r²/4≤h+1`. Use §2's geometric tail and a sum-amplification/rounding budget. Evaluate as scaled values even if the target sequence entry is individually too small; omit it only at final conversion. If the series is too long or cancellation cannot be bounded, continue to the next applicable route. |
171
+ | I: large argument | AMOS tests `r≥RL` and (`h≤1` or `2r≥h²`), where `RL=1.2 dig+3` (~22 for the XSF binary64 setup). Use a sector-correct expansion, not just the growing exponential. Prefer the proved §2 bound if usable (positive-sector endpoint or two K's). Approximation acceptance then also requires bounding arithmetic and final continuation. Otherwise use the qualified AMOS asymptotic path with its full sector term and guards or continue to recurrence/uniform paths. |
172
+ | K: base seeds | Center `μ=ν−r₀`, `r₀∈{0,1}`, `abs(μ)≤1/2`. At `r≤2` use small-K Temme series; §7 gives an explicit centered, nonsingular version. Beyond `2` use the AMOS intermediate K seed (scaled Miller on the auxiliary confluent-hypergeometric problem, not Thompson–Barnett's unchecked Steed stop); use §2 large-argument K directly if its bound fits. Preserve both `K_μ` and `K_(μ+1)`, and recur upward only while the range/error checks permit. |
173
+ | Remaining I/K and higher order | I uses backward Miller, series normalization for `r≤RL` (including AMOS's early `h≤1` route below `RL`), Wronskian for remaining `r>RL`; for remaining I work, invoke the AMOS uniform lift/backward scheme when `h>FNUL` or `r>FNUL`. For K use the large-order uniform route when its requested starting order exceeds `FNUL`; use centered seeds/upward recurrence below that, with separately bounded ladder length. `FNUL=10+6(dig−3)` (~86 in the named binary64 setup). Uniform route: Debye-type when `y≤1.7321 x` (about 60 degrees), rotated Airy/Hankel otherwise. Keep this second sector: turning points are not fixed-order expansion territory. Capture supplied statuses, including partial coverage of a sequence, rather than treating them as success. |
174
+
175
+ `dig` is the machine-decimal-digit estimate used in the source; `RL`, `FNUL`, `1.7321` and the series tests are empirical switches. Compare `r²/4` and `h²` without overflowing; test both neighbors around every switch. For a single large shifted output do not require an O(n) sequence from ν: use target-oriented uniform/direct routes when appropriate. Keep the original `(ν,n)` or an exact two-term representation through integer/fraction extraction and phase reduction. Where a port uses rounded coefficients or a rounded elementary argument, account for that arithmetic error or use a split evaluation; never reconstruct the fractional part, parity, or a turning-point offset by subtraction of rounded large values. Stable `w±iα` detuning can be formed before dividing by α. Underflow/overflow estimates may route or trigger a range check; replacing finite values or setting both components to infinity based on magnitude is forbidden. No AMOS range cutoff extends the supported envelope by itself.
176
+
177
+ **Acceptance and escape rules.** Use scaled complex pairs for recurrence, retain absolute component budgets through the wrapper, and avoid I log derivatives or single-ratio normalizations near zeros. In the Wronskian method propagate a projective pair `V_j,V_(j+1)` and normalize once using `W=V_j K_(j+1)+V_(j+1)K_j`. With certified radii, require a positive lower bound on `|W|` and check the propagated quotient radius and §4 terminal error. For an empirical AMOS lane, record the cancellation diagnostic `(abs(V_j K_(j+1))+abs(V_(j+1)K_j))/abs(W)`; as an initial study gate reject when `32u` times this exceeds the assigned relative normalization budget (`u=2^-53`), or when the denominator or scale is invalid. Alternate adjacent normalizations or direct/series/uniform routes may recover. The `32u` model is a screening heuristic, not a bound on seed or terminal error. Apply analogous checks to final continuation: with certified term errors use their sum; for empirical lanes record amplification by component and norm and require qualification against reference, with exact structural zeros handled analytically. Never let a tiny Wronskian residual serve as an independent check. On nonconvergence, a failed range check, or work exhaustion, use only another in-budget, qualified route; otherwise report unresolved, not an approximate successful value or CPU fallback masquerading as device success.
178
+
179
+ ## 7. Compact challenger: exact CF2 identity and the missing guard
180
+
181
+ For centered `abs(μ)<1/2`, set `a=1/2−μ`, `b=1/2+μ`, `u=−1/(2w)`. Thompson–Barnett §2.1 uses `P_k={}_2F_0(a+k,b+k;;u)` interpreted by the Kummer-U integral, **not** its divergent power series. Use coefficients `A_k=1−(a+b+2k+1)u`, `B_k=−u²(a+k+1)(b+k+1)` in `P_k=A_k P_(k+1)+B_k P_(k+2)`. The index shift in `B_k` follows by integrating the derivative of `e^(−t) t^(a+k) (1−ut)^(−b−k−1)` from zero to infinity; the boundary terms vanish. The projective ratios satisfy `R_k=P_(k+1)/P_k=1/(A_k+B_k R_(k+1))`; extended Steed updates the ratio and Temme normalization together. With `C_0=1`, `C_(k+1)=−u(a+k)(b+k)C_k/(k+1)`, normalize by `Σ C_k P_k=1`. Then `K_μ=F P_0`, `K_μ′=F[(-1−1/(2w))P_0+ab P_1/(2w²)]`, `F=sqrt(π/(2w)) exp(−w)`. The second seed is `μ K_μ/w−K_μ′`. Use the elementary K seed at `abs(μ)=1/2` (plus its derivative); never apply the recurrence/normalization formula with its endpoint degeneracy. Use backward projective Miller and §4 normalization for I; leave legacy upward I disabled unless a separately qualified regime warrants it.
182
+
183
+ **Proved sum tail, not a CF convergence test.** For `Re w≥0`, the defining integral for `P_k` is the average of `(1−ut)^(-b−k)` under the unit-rate gamma density of shape `a+k`, with `t>0`. After multiplying by `C_k` all terms share the shape-`a` density and the additional factor `(b)_k/k!` times `(-ut/(1−ut))^k`. The binomial sum integrates to 1. Indeed for `q=|ut|/|1−ut|`, `q<1`, and the absolute sum's non-density factor is `( |1−ut|−|ut| )^(-b)≤1+2|u|t`, by `Re u≤0`, `0<b<1`. Thus exchange of sum/integral is justified also on the imaginary axis. For a tail starting at `N` and any `T>0`, take `q_T=|u|T/sqrt(1+|u|²T²)`; a computable bound is
184
+
185
+ \[
186
+ \frac{q_T^N}{1-q_T}+\frac{\Gamma(a,T)+2|u|\Gamma(a+1,T)}{\Gamma(a)}.
187
+ \]
188
+
189
+ This uses `(b)_k/k!≤1` on `[0,T]` and the full absolute majorant beyond `T`. It bounds the tail of the **true** `P_k`, not the effect of setting a terminal projective ratio to zero. The integral independently encloses `P_0` and `P_1` with respective tail bounds `Γ(a+k,T)/Γ(a+k)` (since `|1−ut|≥1`); substitute `t=s^(1/(a+k))` to regularize the integrable endpoint on `[0,T]`. This gives an offline or expensive validation guard on both seeds, but no established cheap interval enclosure for the CF terminal ratio on the sector. Propagating a valid ratio disk through the Möbius maps and through the finite normalization is a sufficient route if such a disk is found; a disk crossing a pole must be rejected. The sum tail can itself be too wide at useful `N`. Do not use this bound on the rotated left-half-plane branch of a two-CF representation.
190
+
191
+ **Nonsingular small-K route for either design.** The centered Temme-style series can avoid order quadrature: put `L=log(w/2)`, `H_k=(w²/4)^k/(k!)²` and `A(β)=β L−log Γ(1+β)−Σ_(j=1)^k log(1+β/j)`. Set `C=(A(μ)+A(−μ))/2` and `D=(A(μ)−A(−μ))/(2μ)`. Compute even/odd parts without subtraction: for the finite logs the contributions are `−log1p(−μ²/j²)/2` and `−atanhc(μ/j)/j`, respectively, where `atanhc(t)=atanh(t)/t`. Use the even/odd power series of `log Γ(1+β)=−γβ+Σ_(m≥2)(−1)^m ζ(m)β^m/m`; `ζ(m)≤2` gives geometric tails for `abs(μ)≤1/2` (including the series divided by μ). Then
192
+
193
+ \[
194
+ K_\mu(w)=-\frac{\sum_k H_k e^C D\,\mathrm{sinhc}(\mu D)}{\mathrm{sinc}(\pi\mu)}.
195
+ \]
196
+
197
+ For the argument derivative, replace each summand by `H_k e^C [2k D sinhc(μD)+cosh(μD)]/w`. Interpret `sinhc(t)=sinh(t)/t` and the other removable ratios by their analytic limits. The omitted sums have the §2 Cauchy tail bounds on the order derivative of the `I` series (then divide by `sinc(πμ)`); the finite retained part still needs bounded arithmetic and cancellation checks. Use scaled elementary factors for tiny `w`. This is distinct from adopting BESSCC's historical Neumann truncation heuristics.
198
+
199
+ **Numerical challenger map (not approved production switches).** Thompson–Barnett §3.2 and Fig. 2 use centered order, with symmetry to the first quadrant: case 1 `r>25` and `h<0.6r` (two irregular solutions and a guarded upward I attempt); case 2 otherwise `r>3` and `10x+y≥20` (one CF2, Miller/Wronskian); case 3 small `r` or `10x+y<20` (Neumann K, sum-normalized Miller I). For the challenger use `r≤3` at the tie, the centered series instead of the Neumann series, and §2's bounded large-argument shortcuts instead of the two-CF/upward-I route. Probe the full imaginary-axis wedge between radii 3 and 20: small Re alone is not a reason to assume the small-K series is cheap, and a CF2 pass at `12.2+13.3i` is not evidence there. Use overlap comparisons and actual downstream bounds; no forced success on either side of a threshold.
200
+
201
+ ## 8. Qualification budget and decision gate
202
+
203
+ Use these **initial study limits**, not promises or reasons to silently exclude hard inputs: shifts `0…128` and radii through `1024`, including subnormal coordinates down to the smallest nonzero binary64, both lips, integer/half/near-integer orders and all rotations. Add stress outside that envelope separately. Cap each series at 128 retained terms, CF2 at depth 128 (try 32/64/128 for diagnostics), and all order/auxiliary recurrence work at 512 updates per attempted route; at most two attempted paths per required core quantity in the first bounded study. Record order steps, terms, CF depth, uniform calls, retries, workspace and device kernel wall time by stratum, with max/p99 and failed/capped counts. Uniform-path internal loops must also be counted/capped before claiming bounded work. Caps are deliberate fail-fast limits to test the design; if any required point hits them without a qualified result, measure and revise the budget or branch, or narrow the published envelope. A cap is not a claim of observed maximum. Include unequal path lengths in a GPU warp and no dynamic allocation in the qualified device route.
204
+
205
+ Before running, freeze the accuracy and latency gates; a useful initial comparison target (not a public API promise) is `2e-13` norm-relative away from predeclared zero zones, `2e-13` in the independent local scale there, and ≤8 minimum-subnormal units for subnormal components with separate class/sign boundary checks. Use the independent plan for exact representability, mixed components and unresolved oracle points. Cover at least thousands of independently certified tuples per function on **both** CPU nopython and actual CUDA-MLIR, with dedicated turning-point, CF wedge, underflow/overflow and signed-zero strata; freeze a holdout, and sweep adjacent inputs on every real dispatch boundary. No capped or uncertified oracle case can be counted as a pass. Publish counts, errors and work together. Local library behavior and historical tables are not these tests. If rigorous per-call acceptance is required, use only branches whose propagated errors meet the target; empirical uniform/CF/Miller regions remain release blockers until bounded. Otherwise qualify and document the empirical AMOS envelope, and only replace regions by the compact method after both its independent guard and its bounded-work tests pass. These are future expansion studies, not the v0.1 contract.
206
+
207
+ ## 9. v0.1 selection: bounded series and a short K ladder
208
+
209
+ ### Supported inputs and explicit rejection
210
+
211
+ Support all four unscaled functions for finite binary64 `ν,x,y`, exact integer `0≤n≤8`, and
212
+
213
+ ```
214
+ 0 ≤ ν < 1, 1/4 ≤ max(|x|, |y|) ≤ 5/2, z = x + i y.
215
+ ```
216
+
217
+ Bounds are inclusive except `ν<1`. Accept `ν=−0` as order zero and preserve both signs of an imaginary zero. The square shell is deliberate: validation needs only absolute-value comparisons, not an inexact radius calculation. It reaches the first real J₀ zero and its imaginary-axis I₀ counterpart, includes both cut lips and quadrants, and gives `1/4≤|z|<4` in every rotated core call. A finite minor coordinate may be any binary64, including a subnormal; use its original bit pattern to select the side. No origin, infinities, NaNs, negative shifts, or larger shifts/arguments: reject before evaluation with an explicit `out of domain` status (the host may translate that to a domain exception; device consumers must check per-result status). An uncertified result **inside** the domain has a distinct numerical-failure status and blocks qualification, not an `out of domain` result. Never return a silent numerical value for either failure. On the positive real axis make the imaginary output exactly zero; v0.1 does not promise the sign of a mathematically zero output component or correct rounding of either component.
218
+
219
+ ### Accuracy contract, also at zeros
220
+
221
+ Let `F` be the exact function at exact `α,z` on the specified sheet, and `F′` its **argument** derivative on that same analytic branch (one-sided analytic continuation at a cut lip). For the delivered `complex128` value `v`, require
222
+
223
+ \[
224
+ |v-F| \le 2^{-40}\,S_F(z),\qquad S_F(z)=\max\bigl(|F|,\;|zF'|/16\bigr).
225
+ \]
226
+
227
+ All moduli are Euclidean. At an ordinary point where `|F|` dominates, this is relative error at most `2^-40` (about `9.1e−13`). At a simple zero the allowed absolute error is `2^-44 |zF′|`; for example, the corresponding displacement to first order is `2^-44 |z|`. There is no blanket absolute floor that would let a tiny nonzero function be returned as zero when its derivative scale is comparable. Conversely there is no promise of relative accuracy for a vanishing Cartesian component. Report per-component errors and signs as diagnostics; enforce cut selection separately on known distinct lips. Use independent FLINT balls for both `F` and `F′` (standard adjacent-order derivative identities on the correct sheet) in qualification; the scale is never estimated from the output under test.
228
+
229
+ The scale cannot vanish: a nontrivial solution of the Bessel equation cannot have both value and derivative zero away from the origin. A quantitative check for the entire shell is given below. A future in-kernel certificate could use balls for `F` and `zF′`: take the maximum of the two lower modulus bounds (the derivative bound divided by 16), and compare it to an upper bound for `|v−F|`, including binary64 output conversion. An interval containing `F=0` need not stall such a check if the derivative supplies a positive scale. v0.1 applies this comparison only in offline FLINT validation.
230
+
231
+ ### Single production route, independent of sector
232
+
233
+ 1. Classify exact inputs and retain the cut bit before conversions. Use §1's reflection and ±90° rotation, evaluating only the required core quantities. Keep `ν` and `n` separate or represent them by a correctly enclosed sum; use parity/integer reduction for phases. Where a coordinate or order rounds away inside a working representation, its contribution must remain in the enclosure. Multiplication of an exact order by a rounded π is not an exact phase reduction.
234
+ 2. Evaluate target-order I directly with §2's Frobenius formula, **48 retained terms** (`k=0,…,47`); for its derivative multiply each term by `α+2k` to obtain `w I′`. Obtain the reciprocal gamma at `α+1` from centered `μ=ν−r₀` (`r₀=0` for `ν≤1/2`, else 1) via `1/Γ(1+μ)` and the finite product over `1+μ` through `j+μ`, `j=n+r₀≤9`. The centered gamma log uses 26 even/odd coefficient pairs through degree 53, with compensated sums for the argument series.
235
+ 3. Evaluate `K_μ` and `w K_μ′` by §7's centered even/odd series, also **48 retained terms**, sharing the gamma parts across terms. Form `K_(μ+1)=μK_μ/w−K_μ′`; for higher orders take at most **eight** upward recurrence updates. If a target derivative is needed for a future certificate, use `wK_α′=−wK_(α−1)−αK_α` once the previous ladder value is present; at ladder index zero use the differentiated seed. No Miller, CF2, asymptotic switch, transport step, or AMOS fallback is needed. Feed the values and derivatives through §1 with the chain factors (`−1` for reflection and `−s i` for the ordinary-function rotation). The upper and lower cut limits are evaluated by the same formulas with the selected lip, not by a perturbation.
236
+ 4. Use normal strict binary64 on CPU and device (`fastmath=False`), rounded elementary functions and coefficients, and no runtime balls, wider retry, or host fallback. Only the offline FLINT gate evaluates derivative scales and checks accuracy; a successful runtime status means valid inputs and finite results, not a per-call error certificate. The mathematical formulas and truncation bounds are interval-arithmetic-ready. A future certified variant would additionally enclose elementary and arithmetic operations, propagate the derivative and value bounds through continuation, and include output rounding in the comparison. No such runtime variant is required in v0.1.
237
+
238
+ ### Why the fixed term counts are sufficient for truncation
239
+
240
+ On this shell `|w²/4|≤4` and `|log(w/2)|<2.61` in the closed right half-plane. For centered K, throughout the disks of radius `1/4` from §2, `|β|≤3/4`. The centered log-gamma series, `γ<1`, and `ζ(m)≤2` give `|B_0|≤exp((3/4)(2.61+1)+(3/4)^2/(1−3/4))<256`. Thus a uniform term bound is `B_k=256·4^k/[k! (1/4)_k]`, with `(·)_k` the rising factorial. At `N=48` the rational bounds of §2 give (before multiplication by the order-derivative Cauchy factor 4) an I-family tail below `8.74e−90` and an argument-derivative tail below `3.39e−87` on those disks. The average order derivative over `[-1,1]` introduces at most `1/sinc(πμ)≤π/2<2`, in addition to the Cauchy factor. Forming the second K seed amplifies the first seed error by at most 2. During the ladder each update increases the max of the two absolute errors by at most 70 (`|2β/w|≤68` at the updated indices). A loose bound `70^9` including spare margin gives target K truncation error below `2^-229` before continuation. For direct I, the exponent bound and the centered gamma product give `|(w/2)^α/Γ(1+α)|<4096`; its unscaled remainder is bounded by `4096·4^48/(48!)²/(1−4/49²)<2^-297`. The continuation factors have modulus at most the explicit coefficients in §1, so the final **value** truncation is below `2^-220` for all four functions. Derivative tails also propagate by the displayed identities, and must be included when computing a lower bound for `S_F`.
241
+
242
+ For a uniform size check, sum `B_k≤256·16^k/k!`: the absolute majorants for the centered K value and `wK′` are `8·256 e^16 < 2^35` and `8·256(1+32)e^16 < 2^41`, respectively. They bound the next K seed by `2^44`; the at-most-eight factors 70 bound the target K by `2^94`, and the adjacent-order derivative by `2^98`. The direct I and scaled derivative have smaller bounds (use `4096e^4` and `4096(9+8)e^4`). Including reflections and rotations, `|F|,|zF′|<2^104` for every family; no mathematical output overflow occurs. With companion `G` from the same pair (I/K or J/Y), the Wronskian gives `|F zG′−zF′G|` equal to 1 or `2/π`, respectively. It is at most `17·2^104 S_F`, so `S_F>2^-110`. The permitted absolute error is therefore everywhere greater than `2^-150`, well above the fixed truncation bound. This argument separates lost precision from insufficient term count; it does not substitute for outward bounds on the implemented elementary or arithmetic operations.
243
+
244
+ ### Release gate
245
+
246
+ Port only the above route to CPU nopython and CUDA-MLIR in v0.1. Verify the representable neighbors on each square boundary and order/shift limit; origin and all nonfinite inputs reject; both tiny nonzero imaginary signs and signed-zero lips select correctly. Include roots on the real and imaginary axes, transverse offsets, small but nonzero high-shift results, cancellations in Y, and quadrant corners at the largest allowed radius. Compare each actual backend to independently certified `F,F′` with the same metric, and record failing or reference-undecided in-domain calls and device work/timing. This is an empirical production gate, with rigorous oracle enclosures and mathematical truncation bounds, not a claim of total arithmetic error certification across all binary64 points. Unresolved cases are not passes and cannot be hidden by increasing a test tolerance. If the bounded route cannot be qualified, change the published domain or the design before release—do not add an unqualified general-purpose fallback.
@@ -0,0 +1,5 @@
1
+ (changelog)=
2
+
3
+ ```{include} ../CHANGELOG.md
4
+
5
+ ```
@@ -0,0 +1,5 @@
1
+ (contributing)=
2
+
3
+ ```{include} ../CONTRIBUTING.md
4
+
5
+ ```
@@ -0,0 +1,36 @@
1
+ # Literature findings and production decision
2
+
3
+ **v0.1 selects the bounded series design in §9 of [algorithm.md](algorithm.md), not AMOS or CF2.** It supports `0 ≤ ν < 1`, integer shifts `0…8` and `1/4 ≤ max(|Re z|,|Im z|) ≤ 5/2`; reject other inputs explicitly. Both cut lips are supported. The error target is `2^-40 max(|F|, |z F′|/16)` for complex norm error, with a nonzero derivative scale at function zeros. The series truncation is proved for the whole shell. v0.1 uses strict binary64 and requires empirical CPU/CUDA-MLIR qualification against FLINT; runtime enclosing arithmetic is deferred.
4
+
5
+ An implementation smoke sweep compared 24,264 outputs per backend with FLINT enclosures, using the derivative-scaled metric. On CPU Numba and actual CUDA-MLIR 0.6.1 on an RTX 4070 SUPER, the largest enclosed scores were `2.27e-14` and `2.67e-14`, respectively, versus the `2^-40` target. The sweep covered nine shifts, all families, sampled quadrants and corners, cut lips, near-zero arguments of the function, and selected subnormal cases. It is not a substitute for the independent release suite or a runtime certificate.
6
+
7
+ **For later expansion, AMOS remains the leading broad-domain port baseline**, with the shared I/K and exact branch wrapper. Do not ship it unchanged. The compact Thompson–Barnett CF2/Temme–Steed/Miller approach is not qualified as the primary or as an automatic runtime fallback: we have neither a useful verified continued-fraction tail guard over the needed sectors nor a CPU/GPU accuracy and bounded-work result. A reasonable fixed work cap is not evidence that the method succeeds below it. Use the compact method as a bounded challenger; promote it by region only after the stated gates pass. The Taylor-defect method is a reference/fallback construction in arbitrary precision, not the production workhorse.
8
+
9
+ **A broad-domain release is blocked**, separately from this architecture choice, on fixing the larger advertised input/accuracy/work envelope, preserving exact split order and the cut bits in the adapted portfolio, and validating the port's accuracy and work limits on both backends. If the project requires per-call rigorous error or correct rounding rather than measured accuracy, the AMOS port is also blocked by missing enclosures for its transition and uniform paths. Neither legacy package satisfies that stronger requirement by reputation. The AMOS-derived broad-domain portfolio was not implemented or tested on either backend.
10
+
11
+ ## What the papers establish
12
+
13
+ | Source | Useful result | Limitation for production |
14
+ |---|---|---|
15
+ | Amos, [SAND83-0086](https://doi.org/10.2172/6148453) and [SAND83-0643](https://doi.org/10.2172/5903937), 1983; [Algorithm 644](https://doi.org/10.1145/7921.214331) | Right-half-plane I/K reduction; small-K series, intermediate recurrence and Wronskian, large-argument asymptotics; large-order Debye/Olver routes split by angle, including the sector near the imaginary-axis turning point. The portfolio has a structurally different escape from costly recurrence. | Machine thresholds, accuracy heuristics, rounded order argument and legacy range/phase statuses are not the new contract. The two reports are available; the Algorithm 644 source and later remark attachments are not substitutes for the unavailable full 1986 ACM paper. |
16
+ | Thompson & Barnett, *CPC* 47 (1987) 245–257, [BESSCC](https://www.ianthompson.org/papers/Besscc-CPC.pdf), §§2.1–2.4, 3.1–3.2, 4.2 and test deck | Center order in `[-1/2,1/2]`; use a Temme sum to normalize the recessive hypergeometric sequence, extended Steed for CF2 and its normalization, then upward K and downward I, with Wronskian or small-argument sum normalization. Large-argument branch combines two irregular solutions and tries upward I. Published deck reports, e.g., 114 Miller and 17 CF/Temme counts at `12.2+13.3i`, start order `0.1`, 31 orders. | Useful historical example, not a maximum or independent error certificate. Their requested ACC and achieved errors differ; agreement with Campbell/AMOS is empirical. Modest radius/order tests and historical arithmetic do not cover near poles, branch signs, tiny fractional orders or GPU tails. Work grows when order and argument are both large; no uniform turning-point shortcut. |
17
+ | Sookne (1973), Gautschi as cited by Thompson–Barnett, Olver (1967), *Numerical solution of second-order linear difference equations* | Explain why a two-point/minimal solution and a normalization condition are needed; motivate backward Miller, terminal-index estimates and independent checks on recurrence. | The integer-order Sookne result is not a proof of the same stopping heuristic or work limit for every shifted real order and complex argument. Neither a small recurrence residual nor a repeated-start match bounds the unwanted homogeneous solution. |
18
+ | Nemes, [large-argument remainders](https://arxiv.org/abs/1606.07961), [large order](https://arxiv.org/abs/1309.2209), [nearly equal order and argument](https://arxiv.org/abs/1407.5299) | Explicit remainder theory with different hypotheses in each regime. Use the simpler integral remainder in `algorithm.md` for a guarded shortcut; Nemes is a route to sharper bounds including difficult sectors. | Large-argument expansions at fixed order do not cover the `|w|≈α` transition. No Nemes bound was transferred wholesale to the AMOS switches. |
19
+ | Johansson, [rigorous hypergeometric computation](https://arxiv.org/abs/1606.06977); Pearson–Olver–Porter, [review](https://arxiv.org/abs/1407.7786) | Johansson gives interval arithmetic and computable series tails; independent `acb` remains the benchmark. The review explains why multiple representations and conditioning checks matter. | A ball enclosure at arbitrary precision is not a bounded binary64 device kernel. |
20
+ | Dunster–Gil–Segura, [turning-point coefficients](https://arxiv.org/abs/1607.08269), [sharp error bounds](https://arxiv.org/abs/2009.04666) | Concrete leads for eventual certification of complex Airy-type approximations. | Need to match the exact expansion, coefficient normalization and complex domains of the selected port. Dunster's arXiv:2412.12595 and the CWI imaginary-order work do not establish real-order coverage here. |
21
+ | Zaghloul–Johnson [I](https://arxiv.org/abs/2505.09770), [II](https://arxiv.org/abs/2606.14839), [III](https://arxiv.org/abs/2606.14937) | Independent modern portfolio with adaptive series, asymptotic and recurrence regions; K also uses Temme-type intermediate machinery. Their comparisons motivate testing conservative AMOS range exits against actually representable outputs. | Reported double/quad results and speed are host empirical evidence, not exact-order, branch, rounding or CUDA qualification. Their wrappers are not necessarily the least redundant here. |
22
+ | [Bremer](https://arxiv.org/abs/1705.07820); Plesner et al., GPU log-Bessel paper | Real-argument phase/table compression and GPU-aware evaluation are useful performance precedents. | Neither covers all four unscaled complex functions with exact split order and two cut lips. |
23
+
24
+ ## Port provenance and what already fails unchanged
25
+
26
+ Use the [SciPy XSF AMOS translation at `45447c57`](https://github.com/scipy/xsf/blob/45447c57fef64dabca04e0f9cefc700fbd609a17/include/xsf/cpu/amos/amos.h) as the **named source baseline** for the eventual port, not a direct dependency or a drop-in GPU call. The file supplies an explicit SciPy BSD-3-Clause grant and retains the Sandia disclaimer and unlimited-release notice. The port has a viable notice-preserving route in an MIT project: retain that file's notices and conditions in source and distributions, retain provenance for extracted paths, and confirm the exact vendored file set and third-party notices before copying. Do not assume bare Netlib access, an Elsevier listing or the ACM archive alone grants the same redistribution rights. The compact challenger should be a derivation from formulas, not a transcription of BESSCC source or table data. XSF itself uses host C++ facilities including allocation; port only the numerical paths and replace host-only facilities with bounded target-compatible workspace. No source was vendored.
27
+
28
+ One read-only cross-check (SciPy 1.18.1 and python-flint 0.8.0 / FLINT 3.3.1) shows why the baseline needs adaptation. At `ν=0.3, z=-2±0i`, SciPy returned identical values for each pair for all four functions; `±2^-1074` instead produced opposite imaginary signs. For exact `α=1+2^-54`, `I_α(-2+i0)` had imaginary part about `−2.774e−16` by a 256-bit FLINT enclosure; the rounded-order SciPy call received `1.0` and returned zero imaginary part. These are contract discriminators, not an AMOS error survey or evidence about the future port.
29
+
30
+ ## Evidence required before expanding beyond v0.1
31
+
32
+ 1. First qualify the bounded method in §9. For a later expansion, run the AMOS-derived regional map with explicit counters and the exact wrapper, using the independent validation matrix. Compare CF2 as a challenger on the same frozen corpus, not by library agreement alone.
33
+ 2. To promote CF2, close **both** of its errors: truncation of the normalization sum and the errors of its continued-fraction approximants. The supplement derives a tail bound for the first and an independent value/slope enclosure for audit, but not a cheap propagated CF tail enclosure for the second. Convergent agreement at two depths, a well-conditioned Wronskian and passing sampled comparisons can justify an explicitly empirical method, not the requested verified guard on their own.
34
+ 3. Freeze and meet the numerical and work gates in `algorithm.md`; no unsupported regime or capped result may return a successful value silently. If no portfolio path passes a required regime, narrow the advertised envelope explicitly or block release. In particular, the open large-order and extreme-exponent requirements cannot be satisfied by switching invisibly to unbounded ODE continuation.
35
+
36
+ Corpus bookkeeping: the local `web/Zaghloul-Johnson-2026-I.pdf` actually contains Part III, not I; the recurrence manifest has the true Part I (arXiv:2505.09770). The two SAND83-0643 copies are one report, and `1607.08269` is Dunster–Gil–Segura despite a misleading university filename. The three manifests record retrieval/provenance, not validation of numerical results.