Software · Founding article · Published 2026-11-24 · Open access, CC-BY 4.0

libmatern: Fast and Accurate Matérn Covariance Evaluation on SIMD CPUs and CUDA GPUs

Daniel Mann1 · Matthis Ehrhardt2 · Martin Schlather3

1 Chair of Applied Stochastics, University of Mannheim · orcid 0009-0005-6089-0011 · 2 Chair of Applied Stochastics, University of Mannheim · 3 Chair of Applied Stochastics, University of Mannheim · orcid 0000-0002-6919-7249

Matérn covariancemodified Bessel function of the second kindSIMD vectorisationGPU computingreproducible benchmarkingSobolev kernel
doi: https://doi.org/10.68365/jrepstat.2026.13 Vol. 1 (2026) · Art. 13 Version 1 how to cite ↓ html pdf (typeset)
✓ Reproduced

Reproducibility record

verified 2026-11-09
Result
Reported results reproduced. All 736 printed values reproduce from the authors' run records. Timings, AVX-512 and GPU accuracy were not re-run here (no such hardware).
✓ measured
Entry point
cd libmatern* && make reproduce KAUST=yes
✓ executed
Environment
libmatern 0.9.6, Python 3.12.9; library on x86-64 under qemu (no AVX-512, no GPU)
✓ measured
Determinism
Seeded.
declared
Archive
libmatern-fast-and-accurate-mat-rn-covariance-evaluation-on-simd-cpus-and-cuda-gpus-v1-repro.zip · reviewed bundle SHA-256 e846b0baf31b46bd54e9813afd9bfcf1e34f3c43c1492eca041c869d926b0f8d · https://doi.org/10.5281/zenodo.24498597
✓ computed
Data
Open. https://doi.org/10.5281/zenodo.23393956
declared, route checked
AI use
Language editing, code assistance, literature search, analysis assistance and text generation, model not stated.
declared

Reproducibility package (.zip, 4.1 MB) · Zenodo doi:10.5281/zenodo.24498597 · SHA-256 0fc58c951434214cf49082b56f6efb93c656f249cb20d3aa68d3fdcabc96168a

$cd libmatern* && make reproduce KAUST=yes
Open review

Peer review record

2 rounds · 3 reviewers · signed Full reviewsHide reviews
2026-10-31Minor revision2026-11-0624 answers2026-11-14Accepted

The decision letters, the reports the authors read, their answers and the editor's signed decisions, as written. The reports come from the journal's review engine. The authors could have kept this record private until they confirmed the proof.

Round 1Minor revision3 reviewers · response
Minor revisionConfirmed and signed by Matthias Templ2026-10-31 · orcid 0000-0002-8638-5276
Decision letter2026-10-31libmatern evaluates the normalised Matérn covariance directly by folding the Gamma-power prefactor into several numerical formulations of the modified Bessel function Kν, with architecture-specific routing for scalar CPU, SIMD CPU and CUDA GPU. It matters to spatial-statistics and Gaussian-process practitioners who repeatedly assemble Matérn covariance matrices, especially when the smoothness parameter is estimated, because it returns finite, accurate values in regimes where common libraries overflow and delivers large CPU throughput gains. We would be glad to see the revised version.

Thank you for your submission to JRepStat. We are inviting a minor revision. The reviewers’ points follow, grouped by weight.

libmatern evaluates the normalised Matérn covariance directly by folding the Gamma-power prefactor into several numerical formulations of the modified Bessel function Kν, with architecture-specific routing for scalar CPU, SIMD CPU and CUDA GPU. It matters to spatial-statistics and Gaussian-process practitioners who repeatedly assemble Matérn covariance matrices, especially when the smoothness parameter is estimated, because it returns finite, accurate values in regimes where common libraries overflow and delivers large CPU throughput gains. We would be glad to see the revised version.

How to read this letter. The decision rests on the items marked required. If a required item seems wrong to you, or cannot be done within this paper, decline it on the revision page and give the reason. A reasoned decline is a legitimate answer, and the editor weighs it. Reviewers can be mistaken. Items marked recommended or optional are advice from the reviewers. Adopt them, decline them with a sentence, or leave them for later work. None of that counts against the paper. The reviewer reports below carry the same marks. The editor who signs this decision may weigh an item differently in the accompanying message, and that message prevails.

required (the decision rests on these):

  • [methods-soundness] The timing tables (Table 3, Table 4, Table B10) report a single “ns/value” for each method, and the speedup claims rest entirely on these numbers, but the central tendency (mean, median) and the spread across the 25 measured repetitions are not stated. Please name the statistic used and add a measure of spread from the runs you already have, or qualify the speedup figures as point estimates from a single summary. Figure A5 already shows IQR and whiskers for the transfer strategies, so the same can be given for the headline comparisons.
  • [Reviewer 1] The abstract and Section 5.3 headline the CPU gain as the maximum 6.6×, drawn from the random mixture that Table B5 states was built to cover routing regions, not application workloads. Report a typical CPU speedup alongside the maximum and name the benchmark nature, so an application reader does not expect 6.6× in their own pipeline.
  • [Reviewer 2] State which summary statistic over the 25 repetitions the per-element costs in Tables 3, 4 and B10 report, and give a dispersion measure for the headline speedups, so the numbers are interpretable.
  • [Reviewer 3] record the exact build configuration the reported ULP and timing numbers depend on, and attest that a repeat run reproduces them.
  • [Reviewer 3] pin the exact upstream version or commit of CuBesselK, and of every baseline, that the modification script and the ports target, since the manuscript states the CuBesselK source is downloaded separately and not redistributed.
  • [Reviewer 3] state what the headline “maximum 6.6× speedup” is taken over, and give the representative CPU speedup beside it, or qualify the abstract to call it a best case.

recommended:

  • [statistical-rigor] The speedup factors are ratios of two measured timings, so their uncertainty is larger than that of either timing alone, and a ratio near 1.00× (the grid end-to-end entry in Table 4) may be compatible with no difference once variability is included. State the central speedup with the range implied by the measured timing spread, so a reader can see which crossovers and which near-unity ratios are resolved by the data and which are not.
  • [visualisation] Figures A4, A10, A11, A14 and A15 separate nine or ten implementations, and the overview panels A10/A11/A16/A17 and the box plots A12/A13 do the same. Distinguishing that many series by hue alone is hard for readers with colour vision deficiency and in greyscale. Pair each series with a distinct marker or line style, or draw from a colourblind-safe qualitative palette (for example Okabe-Ito, which supports up to eight categories), and consider whether every baseline needs its own line in a single panel. Figure 2 already does this well with circles, triangles and squares, so the fix is to extend that practice.
  • [visualisation] Figure 1 identifies five algorithm regions (Temme, continued fractions, large-argument, large-order, Levin) plus hatched fused-exponent assembly by fill colour. The in-panel text labels help, but verify the region fills are distinguishable for colourblind readers and in print, since the hatching for fused-exponent assembly is the only non-colour encoding. The same applies to Figures A1, A8 and A9.
  • [writing-quality] A few phrasings sit below the register of the surrounding prose: “the conversion from Kν to Mν remains unfortunate” (Section 4.2 and again near Figures A8/A9) and “As a tiny step in this direction” (Section 6). Restating these in neutral terms would match the rest of the paper.
  • [software-landscape] scipy.special.kv (the Cephes-derived evaluator behind scikit-learn’s Matern kernel, GPy and GPyTorch) is the dominant Matern/Bessel implementation in the Python and machine-learning ecosystem and is absent from the CPU baselines. Adding it as one further CPU comparator on the existing eight datasets, or stating in Section 4.2 why the C/C++/Julia set already represents the fastest available evaluators, would close the one remaining gap in an otherwise complete landscape. The paper stands without it.
  • [Reviewer 1] Foreground the non-finite result: the Bessels.jl and Boost ports return roughly 12% non-finite covariances on the small-z set and 32% on the large-ν set, while libmatern returns none (Table B6). This is the clearest consequence for a practitioner and currently sits only in an appendix table.
  • [Reviewer 1] Promote the (h,ν,s) interface comparison from the Discussion, since practitioners call the function with (h,ν,s), and that is where libmatern’s accuracy edge is cleanest and least confounded by argument rounding.
  • [Reviewer 1] Make the Gaussian-process relevance concrete using Table B11, with a short estimate of the covariance-evaluation share of a likelihood loop where ν is estimated.
  • [Reviewer 2] Report the speedup distribution or median across the size ladder alongside the maximum, since the abstract leads with the most favourable single point.
  • [Reviewer 2] State the compiler optimisation flags and FMA-contraction settings used for the accuracy builds and the timing builds, which govern both the ULP figures and the runtimes.
  • [Reviewer 2] Add a determinism attestation for the SIMD and GPU reduction orders and a single command that reproduces the benchmark tables, and point to the captured environment.
  • [Reviewer 2] Clarify in Table 3 how the N=2^25 column relates to the stated batch of calls on blocks of 2^22, 2^22, 2^23 and 2^24 points.
  • [Reviewer 3] report dispersion for the headline timing tables, so a reader can judge whether a reproduced number falls within run-to-run variation.
  • [Reviewer 3] provide a map from each table and figure to the command that regenerates it.

optional:

  • [methods-soundness] Primary CPU results come from one AMD part with one Intel part for comparison, and GPU results from a single A100. Section 6 already notes this. A multi-architecture study (other AVX-512 microarchitectures, a consumer GPU) would show how far the routing boundaries and speedups transfer, and can be left to later work.
  • [visualisation] In the dense scatter overviews (A10, A11, A16, A17) the median-to-maximum “arrow” spanning each series and the hatched off-scale band at the top carry a lot of information in a small space. A short worked reading of one panel in the caption, or slightly larger panels, would make these easier to parse. The paper stands without this.
  • [Reviewer 1] A small end-to-end demonstration inside a real GP estimation loop would settle how the pointwise gains translate to inference wall-clock.
  • [Reviewer 2] Measurements on further CPU and GPU architectures would show how far the speedups carry beyond the EPYC 9454 and the A100.

We will correct these in production, and you confirm them in the proof:

  • [writing-quality] The figure captions for A8 and A9 read “Dependence of the maximum ULP error in dependance of the covariance-assembly strategy”, which both repeats “dependence/dependance” and misspells the second instance. The same “in dependance of” appears in the caption of A15. Consider “as a function of” in all three.
  • [writing-quality] In Section 3, “Mν(h)→ 0 as h = +∞” should read “as h → +∞”.

Reviews

Report Reviewer 1recommends minorThis is a careful and unusually well-documented software paper on a problem that genuinely recurs in spatial statistics and Gaussian-process work. The Matérn covariance is evaluated enormous numbers of times when a covariance matrix is assembled, and the cost grows when the smoothness parameter is estimated and the matrix is rebuilt across optimisation steps. The authors target exactly that kernel and are explicit that they do not target the full inference pipeline. The core idea, folding the complete Matérn prefactor into each numerical representation of Kν so the intermediate (z/2)^ν and 1/Γ(ν) factors never separately under- or overflow, is sound and directly addresses a failure mode that practitioners hit in real parameter ranges.

Written by the journal's review engine in the role of the application reviewer, and read by the editor before the decision. How the engine works is on the peer review page.

This is a careful and unusually well-documented software paper on a problem that genuinely recurs in spatial statistics and Gaussian-process work. The Matérn covariance is evaluated enormous numbers of times when a covariance matrix is assembled, and the cost grows when the smoothness parameter is estimated and the matrix is rebuilt across optimisation steps. The authors target exactly that kernel and are explicit that they do not target the full inference pipeline. The core idea, folding the complete Matérn prefactor into each numerical representation of Kν so the intermediate (z/2)^ν and 1/Γ(ν) factors never separately under- or overflow, is sound and directly addresses a failure mode that practitioners hit in real parameter ranges.

The strongest application result is not the speed, it is the robustness. Table B6 shows that the Bessels.jl and Boost ports produce non-finite covariances on about 12% of the small-z set and about 32% of the large-ν set, while libmatern returns finite values throughout. A spatial model with large smoothness, or with sites at small separation relative to the scale, would receive NaN or Inf covariances from standard libraries, and a user would then be debugging a factorisation failure with no obvious cause. This result deserves a sentence in the abstract and the introduction rather than its current place in an appendix table. It is the finding most likely to change what a practitioner installs.

The performance claims are honestly hedged, and I want the hedging carried into the headline numbers. The 6.6× CPU figure is a maximum at the largest batch, measured on the random mixture that Table B5 describes as chosen to exercise routing regions, with the explicit note that it was not fitted to observed covariance parameters. An application reader scanning the abstract will read 6.6× as the gain to expect, when the common fixed-half-integer case (ν = 2.5, so Matérn-5/2) runs on the dedicated polynomial path with a far larger factor, and a single-region workload will differ again. Please state a typical value next to the maximum and name the benchmark nature in the abstract. On the GPU side the paper already does the right thing by reporting the end-to-end median of 1.1×, which tells the reader plainly that once host-device transfer is counted the practical GPU benefit over existing GPU libraries is small and the real GPU value is kernel accuracy and finiteness. That candour is welcome.

On accuracy, the per-dataset picture in Table 2 is more textured than “competitive or improved” suggests at a glance. On the grid and random sets, which are the broad coverage sets closest to a general parameter sweep, Boost reaches lower median and maximum errors than the AVX-512 backend. The paper states this in Section 5.2, so there is no inconsistency, and I note it only so the framing matches the evidence: the accuracy advantage is clearest in the stress regimes (small z, large ν) and in the (h,ν,s) interface, while in the broad regimes accuracy is competitive and the win is throughput and finiteness. The (h,ν,s) analysis in Section 6 is, from an application standpoint, the most useful comparison in the paper, because users pass physical distance, scale and smoothness, not a pre-rounded z, and the argument that external libraries lose accuracy to that rounding is a real interface point. It should not be buried at the end.

The one substantive gap for my role is the step from pointwise covariance accuracy to inference. The authors say clearly that pointwise accuracy need not imply stability in covariance-matrix factorisation or in the downstream likelihood, and they flag it for future work. I accept that scoping. The paper would still be more convincing to its intended audience with a short, cheap bridge using the material already present: Table B11 already counts the evaluations needed to build a matrix, so a back-of-envelope of what fraction of a varying-ν estimation loop those evaluations occupy would let a reader judge where a 6.6× (or 72×) kernel gain actually lands in end-to-end time. A full GP demonstration is more than this paper needs and I mark it optional.

Numbered suggestions to the authors:

  1. required In the abstract and in Section 5.3, report a typical CPU speedup (for example a median across datasets or at a representative batch size) next to the maximum 6.6×, and state that the random benchmark mixture (Table B5) is constructed to cover routing regions, so the headline figure is a benchmark maximum and not a workflow expectation.

  2. recommended Move the finiteness result forward: state in the abstract and introduction that common libraries return roughly 12% non-finite values on the small-z set and 32% on the large-ν set (Table B6), while libmatern returns none, and explain the application consequence for covariance-matrix assembly.

  3. recommended Promote the (h,ν,s) interface comparison from Section 6 to the main results, and make clear there that the headline (z,ν) numbers compare numerical methods while (h,ν,s) compares the interface a practitioner actually uses.

  4. recommended Add a short estimate, built on Table B11, of the share of a likelihood-estimation loop (with ν estimated, so the matrix is rebuilt each step) that covariance evaluation occupies, so readers can place the kernel speedups in inference wall-clock terms.

  5. optional An end-to-end demonstration inside a real Gaussian-process estimation loop, reporting the covariance-assembly share against factorisation, would settle the practical-benefit question for the paper’s intended audience.

Report Reviewer 2recommends minorThis is a careful numerical paper. The core methodological idea, folding the full Matérn prefactor into the series and asymptotic representations of K_ν so that the intermediate (z/2)^ν and 1/Γ(ν) factors never form on their own, is well motivated by the underflow and overflow behaviour set out in Section 2.1, and the derivations in Sections 2.2 and 2.3 are presented in enough detail to follow. The accuracy methodology is the strongest part. High-precision references from FLINT/Arb enclosed to at least 110 bits, stored as two binary64 components, with the ULP metric of Equation 35 and an explicit check that rlo quantisation below 2^-972 does not move the reported maxima, is the right way to measure these errors. The treatment of the baselines is fair in a way that works against the authors’ own headline: three assembly strategies per external library, the finite-result-then-lowest-max-ULP selection rule, and separately prepared modified variants of CuBesselK and Boost. That is the conservative choice and it is the correct one.

Written by the journal's review engine in the role of the methodology reviewer, and read by the editor before the decision. How the engine works is on the peer review page.

This is a careful numerical paper. The core methodological idea, folding the full Matérn prefactor into the series and asymptotic representations of K_ν so that the intermediate (z/2)^ν and 1/Γ(ν) factors never form on their own, is well motivated by the underflow and overflow behaviour set out in Section 2.1, and the derivations in Sections 2.2 and 2.3 are presented in enough detail to follow. The accuracy methodology is the strongest part. High-precision references from FLINT/Arb enclosed to at least 110 bits, stored as two binary64 components, with the ULP metric of Equation 35 and an explicit check that rlo quantisation below 2^-972 does not move the reported maxima, is the right way to measure these errors. The treatment of the baselines is fair in a way that works against the authors’ own headline: three assembly strategies per external library, the finite-result-then-lowest-max-ULP selection rule, and separately prepared modified variants of CuBesselK and Boost. That is the conservative choice and it is the correct one.

My reservations are about the reporting of the timing results rather than the numerical methods. The timing protocol gives two warm-ups and 25 repetitions on an exclusive node with an invariant TSC, but the text does not say which statistic over those 25 repetitions becomes the per-element cost in Tables 3, 4 and B10, nor does it report any dispersion. For a benchmarking paper the summary statistic (median, minimum, mean) and its spread are part of the claim, because a 6.6x ratio formed from two unstated point estimates cannot be read for stability. Please state the statistic and add a spread, which the 25 repetitions already contain.

The abstract leads with a maximum speedup. A maximum over the size ladder is the single most favourable operating point, and the per-dataset tables show the end-to-end GPU picture is much flatter (median 1.1x, range 1.00x to 1.81x), which the paper reports plainly. Carrying the same honesty into the CPU headline, by giving the median or the distribution of the speedup across ladder sizes next to the maximum, would make the summary match the body.

Two further items affect whether a reader can reconstruct the numbers. Compiler optimisation flags and FMA contraction settings change both accuracy and runtime, and the distinction between matched and matched_fma shows the authors know this, yet the flags themselves are not stated in the text. And since the ULP tables are exact down to single points, run-to-run determinism of the SIMD and GPU reductions is part of what is being claimed, so a short determinism attestation plus one reproduction command would let the journal verify the tables against the archived data. The environment in Table B7 already covers most of what is needed.

The scope limits are stated well in Section 6: pointwise accuracy rather than full Gaussian-process pipelines, and benchmark datasets that are not claimed to match application parameter distributions. The one scope point I would add is hardware. The speedups rest on one primary CPU and one GPU, and how they transfer to other SIMD widths and GPU generations is open. That is beyond this paper and is marked optional.

Numbered suggestions to the authors:

  1. required State which summary statistic over the 25 repetitions the per-element costs in Tables 3, 4 and B10 report, and add a dispersion measure (for example an interquartile range or a min-to-max band) for the reported speedups.
  2. recommended Report the median or the distribution of the CPU speedup across the size ladder next to the maximum, so the abstract headline reflects typical behaviour and not only the best operating point.
  3. recommended State the compiler optimisation flags and the FMA-contraction setting used for the accuracy builds and the timing builds.
  4. recommended Add a determinism attestation for the SIMD and GPU reduction orders and a single command that regenerates the benchmark tables from the archived arrays, with a pointer to the captured environment.
  5. recommended Clarify in the Table 3 caption how the N=2^25 column relates to the stated sequence of calls on blocks of 2^22, 2^22, 2^23 and 2^24 points.
  6. optional Measurements on additional CPU and GPU architectures would show how far the reported speedups extend beyond the EPYC 9454 and the A100.
Report Reviewer 3recommends minorThis is a careful piece of numerical software work, and from a reproducibility standpoint it starts from a strong position. The inputs are fixed binary64 arrays archived on Zenodo, the high-precision references are computed with FLINT/Arb to at least 110 bits and stored as two binary64 components, and the accuracy metric is defined explicitly in Equation (35) down to the nextafter call. Because the benchmark points are frozen and the references are archived, the accuracy tables are in principle exactly reproducible, which is more than most benchmarking papers in this area offer. The baseline handling is also unusually fair: versions are named, the Kν-to-Matérn assembly is selected per dataset to avoid handicapping external libraries, and the non-finite counts are tabulated rather than hidden. The end-to-end GPU result of 1.1× median, set against kernel speedups up to 6.8×, is reported plainly, and Table B6 and Figures A8 and A9 make the failure behaviour of competitors legible. I did not run a reproduction in this pass, so the comments below concern what the manuscript and the declared artifacts let a reader verify.

Written by the journal's review engine in the role of the software reviewer, and read by the editor before the decision. How the engine works is on the peer review page.

This is a careful piece of numerical software work, and from a reproducibility standpoint it starts from a strong position. The inputs are fixed binary64 arrays archived on Zenodo, the high-precision references are computed with FLINT/Arb to at least 110 bits and stored as two binary64 components, and the accuracy metric is defined explicitly in Equation (35) down to the nextafter call. Because the benchmark points are frozen and the references are archived, the accuracy tables are in principle exactly reproducible, which is more than most benchmarking papers in this area offer. The baseline handling is also unusually fair: versions are named, the Kν-to-Matérn assembly is selected per dataset to avoid handicapping external libraries, and the non-finite counts are tabulated rather than hidden. The end-to-end GPU result of 1.1× median, set against kernel speedups up to 6.8×, is reported plainly, and Table B6 and Figures A8 and A9 make the failure behaviour of competitors legible. I did not run a reproduction in this pass, so the comments below concern what the manuscript and the declared artifacts let a reader verify.

My main reproducibility concern is the build environment behind the ULP numbers. ULP distances for SIMD and FMA kernels are sensitive to compiler optimisation level, target architecture flags, and floating-point contraction settings. Table B7 gives compilers, toolkit, driver and hardware, which is good, and the matched and matched_fma backends show you are aware that FMA changes the result. What I cannot find is the exact flag set (optimisation level, -march, the contraction policy) that the reported numbers were produced under. For a software paper that ships code with its results, a captured and pinned build configuration plus a short attestation that a repeat run reproduces the reported ULP and timing values is the reproducibility floor. If the repository already contains the build scripts, the ask reduces to naming them in the paper and stating the determinism result.

A second verifiability gap is specific and the manuscript names it itself: the kaust-modified results depend on upstream CuBesselK source that is downloaded separately and not redistributed, with changes applied by a script. Without a pinned version or commit for that upstream, and for the other baselines, the modified-baseline comparisons drift the moment upstream moves. Recording the exact commit hashes closes this and costs almost nothing.

Third, the headline framing. The abstract leads with “maximum 6.6× speedup”, and the CPU result in Section 5.3 is likewise a maximum at a single N and workload. A maximum is the least reproducible summary a benchmark can report, since it is the most sensitive to run-to-run noise and to the choice of comparison point. Please state what the maximum is taken over and report the representative CPU speedup next to it, or qualify the sentence to say it is a best case. The GPU tables already give per-dataset figures and a median, which is the right pattern. Relatedly, Tables 3 and 4 give point estimates with no spread, although the timing protocol uses 25 repetitions. Reporting an interquartile range or a min and max for the headline rows would let a reader decide whether a reproduced value is consistent with yours, and the box plots in Figures A5 and A12 show you already have the machinery to do it.

None of this touches the correctness of the mathematics or the honesty of the reporting, both of which read well. The asks are about letting a second person stand up the same numbers from the artifacts you have.

Numbered suggestions to the authors:

  1. required Record in the paper, or name the file in the repository that records, the exact build configuration the ULP and timing results were produced under, including optimisation level, target-architecture flags and the floating-point contraction policy for each backend. Add one sentence attesting that a repeat run reproduces the reported ULP values and timings on the stated hardware.

  2. required Pin the exact version or commit hash of the CuBesselK upstream that the modification script targets, given that the source is not redistributed, and likewise pin the exact releases or commits of Boost, GSL, libstdc++ and both Bessels.jl ports used.

  3. required State what population the “maximum 6.6×” CPU speedup is taken over, and report the representative (for example median) CPU speedup alongside it, or qualify the abstract and Section 5.3 sentence to present it as a best-case figure.

  4. recommended Add a dispersion measure (interquartile range, or min and max over the 25 repetitions) to the headline timing rows in Tables 3 and 4, so a reader can place a reproduced timing against your run-to-run spread.

  5. recommended Provide a short table or script mapping each manuscript table and figure to the exact command that regenerates it from the archived inputs.

  6. optional A run on a second GPU and a third CPU microarchitecture would indicate how far the empirically chosen routing boundaries and the reported speedups transfer beyond the two tested machines.

Revision

Authors' response2026-11-06 · 24 answersAuthors confirm each required point as done or give their reason for declining it. Further answers are voluntary, because the review compares every revision with the previous version and the next round's reports say what remains open.

Authors confirm each required point as done or give their reason for declining it. Further answers are voluntary, because the review compares every revision with the previous version and the next round's reports say what remains open.

In the revised manuscript, the timing tables report medians of 25 repetitions with interquartile ranges, and the captions give speedup bounds obtained by pairing opposite quartiles of the two implementations. The CPU headline is given together with its range over datasets and batch sizes, and the build configuration, determinism, upstream versions and the block timing of the size ladders are documented. The non-finite results and the (h, ν, s) comparison are now part of the main results, the figures use a colour-blind-safe palette, Table B13 maps every table and figure to the command that regenerates it, and scipy.special.kv was evaluated as a further CPU comparator. Section 6 estimates the covariance-evaluation share of a likelihood evaluation.

required The timing tables (Table 3, Table 4, Table B10) report a single "ns/value" for each method, and the speedup claims rest entirely on these numbers, but the central tendency (mean, median) and the spread across the 25 measured repetitions are not stated. Please name the statistic used and add a measure of spread from the runs you already have, or qualify the speedup figures as point estimates from a single summary. Figure A5 already shows IQR and whiskers for the transfer strategies, so the same can be given for the headline comparisons.
Done All reported costs are now stated to be medians of 25 measured repetitions after two warm-up calls, and Tables 3, 4 and B10 give interquartile ranges (IQR) of the timings in per cent of the median. Section 4.4 defines speedup bounds, which pair the lower quartile of one implementation with the upper quartile of the other; the captions state that they differ from the speedups by less than 0.2% on the CPU (Table 3) and by at most 0.12 (kernel) and 0.02 (end-to-end) on the GPU.
required The abstract and Section 5.3 headline the CPU gain as the maximum 6.6×, drawn from the random mixture that Table B5 states was built to cover routing regions, not application workloads. Report a typical CPU speedup alongside the maximum and name the benchmark nature, so an application reader does not expect 6.6× in their own pipeline.
Done The abstract and Section 5.3 now present 6.6× as the single-threaded speedup for a synthetic random mixture of 2^25 evaluations and report, alongside it, the range over the eight benchmark datasets (3.9× to 21×, median 7.5×). Section 5.3 adds the range over batch sizes and the value for fixed ν = 2.5, and states that the random mixture was designed to cover the routing regions (Table B5), so that speedups in applications depend on their parameter distribution and batch sizes.
required State which summary statistic over the 25 repetitions the per-element costs in Tables 3, 4 and B10 report, and give a dispersion measure for the headline speedups, so the numbers are interpretable.
Done See above.
required record the exact build configuration the reported ULP and timing numbers depend on, and attest that a repeat run reproduces them.
Done Section 4.4 and Table B7 now give the compilers, optimisation levels, instruction-set flags and floating-point contraction settings for every backend and for the CUDA code; all results were computed with libmatern 0.9.5 at commit e370401. Each point is evaluated independently, so its result does not depend on batch composition, order or thread count; accordingly, the per-point outputs are byte-identical on both CPUs and across separate rebuilds within the CPU and GPU runs. A repeat of all nine runs at the same commit, on other nodes of the same types, reproduced every accuracy statistic exactly; the median costs of at least 98% of the timing rows on each machine agreed within ±10%, with larger differences for very short GPU kernels, in host–device transfers and at a few individual points (Section 4.4).
required pin the exact upstream version or commit of CuBesselK, and of every baseline, that the modification script and the ports target, since the manuscript states the CuBesselK source is downloaded separately and not redistributed.
Done Table B12 lists the upstream version or commit of every baseline and the packages used in the reported runs. CuBesselK has no tagged release; the modification script downloads its two source files at commit 94ec9ca and checks them against SHA-256 digests (Section 4.2). The bibliography entries for CuBesselK and the Bessels.jl main branch point to the pinned commits.
required state what the headline "maximum 6.6× speedup" is taken over, and give the representative CPU speedup beside it, or qualify the abstract to call it a best case.
Done The word “maximum” has been removed. The abstract and Section 5.3 now state that 6.6× is the speedup of the AVX-512 implementation over the fastest external implementation at N = 2^25 on the random mixture. It is also the median over the 18 batch sizes of the ladder (range 2.2× to 6.8×) and therefore not an exceptionally best case; representative values are given as described under REQ-02.
recommended The speedup factors are ratios of two measured timings, so their uncertainty is larger than that of either timing alone, and a ratio near 1.00× (the grid end-to-end entry in Table 4) may be compatible with no difference once variability is included. State the central speedup with the range implied by the measured timing spread, so a reader can see which crossovers and which near-unity ratios are resolved by the data and which are not.
Done The captions of Tables 3, 4 and B10 now give the speedup bounds defined in Section 4.4, which pair the lower quartile of one implementation with the upper quartile of the other; only those of the grid end-to-end ratio (0.99 to 1.01) include parity. For both GPU– CPU crossovers, the interquartile ranges of the GPU and CPU costs at the ladder sizes on either side do not overlap (Section 5.4).
recommended Figures A4, A10, A11, A14 and A15 separate nine or ten implementations, and the overview panels A10/A11/A16/A17 and the box plots A12/A13 do the same. Distinguishing that many series by hue alone is hard for readers with colour vision deficiency and in greyscale. Pair each series with a distinct marker or line style, or draw from a colourblind-safe qualitative palette (for example Okabe-Ito, which supports up to eight categories), and consider whether every baseline needs its own line in a single panel. Figure 2 already does this well with circles, triangles and squares, so the fix is to extend that practice.
Done All figures were revised. They use the Okabe–Ito palette, with the AVX-512 and CUDA implementations of libmatern in vermillion, and distinguish the implementations additionally by marker; in the line plots (Figures A4, A14 and A15), library backends are drawn with solid and external implementations with dashed lines, and the rows of the box plots (Figures A12 and A13) are labelled by name. To reduce the number of series per panel, Figures A4 and A15 omit the scalar backend and Boost (their costs are in Table 3), Figure A14 omits the scalar and matched+FMA backends, and Figures A10–A13 omit kaust-40, whose maximum error exceeds 10^6 ULP on every dataset; the captions state where the omitted series lie.
recommended Figure 1 identifies five algorithm regions (Temme, continued fractions, large-argument, large-order, Levin) plus hatched fused-exponent assembly by fill colour. The in-panel text labels help, but verify the region fills are distinguishable for colourblind readers and in print, since the hatching for fused-exponent assembly is the only non-colour encoding. The same applies to Figures A1, A8 and A9.
Done In Figures 1 and A1, every region now carries an in-panel label, so the regions remain identifiable in greyscale. In addition to the hatched fused-exponent assembly, the Temme region (Figure 1) and the power-series region (Figure A1) are dotted, and the borders in Figure 1 are distinguished by line style. In Figures A8 and A9, the assemblies differ by fill and hatching (direct: solid, logarithmic: hatched, scaled: dotted), and the libmatern value is a dashed line.
recommended A few phrasings sit below the register of the surrounding prose: "the conversion from Kν to Mν remains unfortunate" (Section 4.2 and again near Figures A8/A9) and "As a tiny step in this direction" (Section 6). Restating these in neutral terms would match the rest of the paper.
Done Both phrasings were revised: “remains unfortunate” now reads “remains a source of error”, and the paragraph beginning “As a tiny step” was moved to Section 5.2 and rewritten
recommended scipy.special.kv (the Cephes-derived evaluator behind scikit-learn's Matern kernel, GPy and GPyTorch) is the dominant Matern/Bessel implementation in the Python and machine-learning ecosystem and is absent from the CPU baselines. Adding it as one further CPU comparator on the existing eight datasets, or stating in Section 4.2 why the C/C++/Julia set already represents the fastest available evaluators, would close the one remaining gap in an otherwise complete landscape. The paper stands without it.
Done A clarification: SciPy documents scipy.special.kv as a wrapper of Amos’s routine zbesk (ACM TOMS Algorithm 644), not as Cephes-derived. It is the evaluator behind scikitlearn’s Matern kernel for orders other than 1/2, 3/2 and 5/2, whereas GPyTorch and GPy evaluate closed forms for these orders. We have evaluated scipy.special.kv on the eight datasets. To compare the evaluator rather than the Python layer, we compiled the C++ code that kv and kve of SciPy 1.18.1 call, unchanged, into the benchmark harness; without floating-point contraction it reproduces SciPy’s values bit for bit. It was assembled, selected, scored and timed like the other external implementations, on the Intel host. SciPy returns non-finite values on 12.4% of the small-z and 32.7% of the large-ν points in every assembly, similar to the Bessels.jl ports and Boost. On the other six datasets its maximum error is 186 to 1458 ULP, against 10.4 to 22.4 ULP for libmatern. With 256 to 607 ns per value it ranks third to fifth among the nine external CPU implementations and is 1.9 to 5.4 times slower than the fastest of them on every dataset, so none of the reported speedups changes. Its only effect on the summary statistics would be a lower external maximum on the half-integer set (907 instead of GSL’s 1248 ULP). Section 4.2 now states these results.
recommended Foreground the non-finite result: the Bessels.jl and Boost ports return roughly 12% non-finite covariances on the small-z set and 32% on the large-ν set, while libmatern returns none (Table B6). This is the clearest consequence for a practitioner and currently sits only in an appendix table.
Done Section 5.2 now gives the shares of non-finite results (about 12% on the small-z set and 32% on the large-ν set) and notes that such values propagate into any covariance matrix assembled from them. We report this result in Section 5.2 rather than in the abstract and introduction because finite output is not specific to libmatern on these sets: GSL and the modified CuBesselK port also return finite values throughout.
recommended Promote the (h,ν,s) interface comparison from the Discussion, since practitioners call the function with (h,ν,s), and that is where libmatern's accuracy edge is cleanest and least confounded by argument rounding.
Done The (h, ν, s) comparison has been moved from Section 6 to Section 5.2, which now states that the (z, ν) results compare the numerical methods and the (h, ν, s) results the interface that applications call.
recommended Make the Gaussian-process relevance concrete using Table B11, with a short estimate of the covariance-evaluation share of a likelihood loop where ν is estimated.
Done Section 6 now contains this estimate. In the non-stationary setting of Table B11, a dense Gaussian likelihood on n = M^2 sites requires E ≈ M^4/2 covariance values per iteration, all of which change when ν is estimated, and a Cholesky factorisation of about n^3/3 operations. With the measured costs per value (Table 3) and assumed single-core factorisation rates of 30 to 70 GFLOP/s, covariance evaluation takes 93 to 97% of an iteration atM = 23 and 46 to 66% atM = 91 with the fastest external implementation, against 67 to 82% and 11 to 23% with libmatern; a likelihood iteration thus becomes about 4.7 to 5.6 and 1.6 to 2.3 times faster. In the stationary settings of Table B11, the evaluation share of a dense likelihood is negligible.
recommended Report the speedup distribution or median across the size ladder alongside the maximum, since the abstract leads with the most favourable single point.
Done Section 5.3 now reports the speedup over all 18 batch sizes of the ladder (2.2× at N = 256 to 6.8× at N = 2^16) and its median (6.6×), which equals the value at N = 2^25 quoted in the abstract.
recommended State the compiler optimisation flags and FMA-contraction settings used for the accuracy builds and the timing builds, which govern both the ULP figures and the runtimes.
Done Section 4.4 and Table B7 now state the optimisation level, instruction-set flags and floating-point contraction for each library backend (-O2 -ffp-contract=fast; -mfma for AVX2, AVX-512 and matched+FMA), for the baselines (-march=native -O2) and for the CUDA code (-O2 -arch=sm_80, default FMA contraction). Accuracy and timings of each implementation are obtained with the same executable on the same points.
recommended Add a determinism attestation for the SIMD and GPU reduction orders and a single command that reproduces the benchmark tables, and point to the captured environment.
Done Section 4.4 now attests determinism: each point is evaluated by one SIMD lane or one CUDA thread without reductions across points, which the test suite checks bit for bit, and the per-point outputs are byte-identical on both CPUs and across rebuilds. The run directories are attached to release v0.9.6 (libmatern-0.9.6-runs.tar.gz); with the code of release v0.9.6, make figures and make tables regenerate the figures and tables of the revised manuscript from them, and make reproduce repeats the benchmarks. Each run directory records its environment in PROVENANCE.txt and MANIFEST.txt.
recommended Clarify in Table 3 how the N=2^25 column relates to the stated batch of calls on blocks of 2^22, 2^22, 2^23 and 2^24 points.
Done Section 4.3 now describes how the size ladders are timed: sizes up to 2^21 as single calls, larger sizes from one pass over consecutive blocks of 2^22, 22^3 and 22^4 points, so that the value at N = 2^25 is the time for all four blocks divided by 2^25. The captions of Table 3 and Figures A3 and A4 now refer to this description.
recommended report dispersion for the headline timing tables, so a reader can judge whether a reproduced number falls within run-to-run variation.
Done See Required-01.
recommended provide a map from each table and figure to the command that regenerates it.
Done Table B13 maps each generated table and figure, now including Figures 1 and A1, to the generated file and to the command (make figures or make tables) that regenerates it from the run directories of release v0.9.6. The generating code is part of release v0.9.6; the versions in the paper can differ from the generated files in caption, cropping and styling.
optional Primary CPU results come from one AMD part with one Intel part for comparison, and GPU results from a single A100. Section 6 already notes this. A multi-architecture study (other AVX-512 microarchitectures, a consumer GPU) would show how far the routing boundaries and speedups transfer, and can be left to later work.
Declined We agree that measurements on further architectures would show how far the routing boundaries and speedups transfer. This is beyond the scope of the present paper; the benchmark suite (make reproduce) supports such runs on other hardware.
optional In the dense scatter overviews (A10, A11, A16, A17) the median-to-maximum "arrow" spanning each series and the hatched off-scale band at the top carry a lot of information in a small space. A short worked reading of one panel in the caption, or slightly larger panels, would make these easier to parse. The paper stands without this.
Done The caption of Figure A10 now includes a worked reading of one panel; the captions of the other overview figures refer to it.
optional A small end-to-end demonstration inside a real GP estimation loop would settle how the pointwise gains translate to inference wall-clock.
Declined Section 6 now estimates the share of covariance evaluation against the factorisation in a likelihood iteration (see Recommended-08). We feel that a complete estimation loop, whose runtime also depends on the optimiser and the number of iterations, is beyond the scope of this paper.
optional Measurements on further CPU and GPU architectures would show how far the speedups carry beyond the EPYC 9454 and the A100.
Declined See Optional-01.

The authors' full response letter (PDF)

Round 2Accepted3 reviewers
AcceptedSigned by Matthias Templ2026-11-14 · orcid 0000-0002-8638-5276

The editor's note

Final acceptance of version 2, after the editor read the preview of the article. All 736 printed values reproduce from the authors’ run records. Timings, AVX-512 and GPU accuracy were not re-run, for want of such hardware.

Decision letter2026-11-14Congratulations, your manuscript has been accepted for publication in JRepStat. Production begins now.

Congratulations, your manuscript has been accepted for publication in JRepStat. Production begins now.

Where it is not on file yet, we still need the following for production.

  • a valid ORCID iD for every author
  • a captured computational environment (dependencies/lockfile/container)
  • a signed determinism attestation for the entry-point command

Reviews

Report Reviewer 1recommends acceptOf the one required and four lighter points I raised, all are met or reasonably declined.

Written by the journal's review engine in the role of the application reviewer, and read by the editor before the decision. How the engine works is on the peer review page.

Of the one required and four lighter points I raised, all are met or reasonably declined.

The required headline change is done. The abstract now gives 6.6× as the single-threaded AVX-512 speedup for the 2^25 random mixture and places the per-dataset range (3.9× to 21×, median 7.5×) beside it, with the ν = 2.5 polynomial path and the ladder range carried into Section 5.3. The word “maximum” is gone, and Section 5.3 states that the random mixture was built to cover the routing regions, so application speedups depend on the parameter distribution and batch size. An application reader now sees a representative figure, not a best case, which is what I asked for.

On the finiteness result, the authors declined to move it into the abstract and gave a reason I accept: on these two stress sets GSL and the modified CuBesselK port also return finite values throughout, so finiteness is not specific to libmatern there. Promoting it to the abstract would have overstated the distinction. Section 5.2 now reports the roughly 12% and 32% non-finite shares and notes their propagation into an assembled covariance matrix, which places the result where a reader meets it alongside the per-dataset accuracy. The (h,ν,s) interface comparison has moved to Section 5.2 with the clarifying sentence that (z,ν) compares numerical methods while (h,ν,s) compares the interface applications call. Both are resolved.

The inference bridge in Section 6 is the addition I most wanted and it reads well. The back-of-envelope using Table B11 (M^4/2 covariance values against an M^6/3 Cholesky, with 30 to 70 GFLOP/s factorisation rates) gives a covariance share of 67 to 82% at M = 23 and 11 to 23% at M = 91, against 93 to 97% and 46 to 66% with the fastest external implementation, and translates to a likelihood evaluation 4.7 to 5.6 and 1.6 to 2.3 times faster. This lets a reader see where the kernel gains land in a varying-ν estimation loop without the authors having to build a full pipeline. The decline on a complete end-to-end demonstration is reasonable for an optional item, since loop wall-clock also depends on the optimiser and iteration count.

Nothing is open. The scipy.special.kv comparator, the determinism attestation and the build and version pinning raised by the other reviewers are also in place and strengthen the paper for its intended audience. I recommend acceptance.

Numbered suggestions to the authors:

(none open)

Report Reviewer 2recommends acceptOf the one required point and five lighter ones I raised, all but the hardware item are met, and that one was declined with a reason I accept.

Written by the journal's review engine in the role of the methodology reviewer, and read by the editor before the decision. How the engine works is on the peer review page.

Of the one required point and five lighter ones I raised, all but the hardware item are met, and that one was declined with a reason I accept.

The required point is settled well. All per-element costs are now stated as medians of 25 repetitions, Tables 3, 4 and B10 carry interquartile ranges as a percentage of the median, and Section 4.4 defines the speedup bounds by pairing opposite quartiles of the two implementations. The headline 6.6x speedup now appears beside its range and median over the ladder sizes and over the eight datasets, so the summary matches the body. The construction of the speedup bound is a sound within-run spread descriptor, and the separate between-run agreement figures (the median cost of at least 98% of rows reproducing within ±10% across nodes of the same type) answer the reproducibility side of the same question. The compiler flags, FMA-contraction settings, pinned upstream versions, determinism attestation, block-timing description for the N=2^25 column, and the table-to-command map are all in place. The scipy.special.kv comparator and the likelihood-share estimate strengthen the paper beyond what I asked.

The decline on measurements across further CPU and GPU architectures is reasonable. The routing boundaries and speedups are empirical and machine-dependent, the paper says so in Section 6, and the benchmark suite supports such runs on other hardware. That work belongs in a later paper, not this one.

I have no open points.

Numbered suggestions to the authors: (none)

Report Reviewer 3recommends acceptOf the three required points and the two lighter reproducibility points I raised, all are met, and the single optional hardware-coverage point was declined with a reason I accept.

Written by the journal's review engine in the role of the software reviewer, and read by the editor before the decision. How the engine works is on the peer review page.

Of the three required points and the two lighter reproducibility points I raised, all are met, and the single optional hardware-coverage point was declined with a reason I accept.

On the build environment (my required point 1), Section 4.4 and Table B7 now give the compiler, optimisation level, instruction-set flags per backend and the contraction policy (-O2 -ffp-contract=fast, -mfma for the FMA backends; -march=native -O2 for baselines; -O2 -arch=sm_80 for CUDA), and the determinism attestation is concrete: each point is evaluated by one SIMD lane or one CUDA thread with no cross-point reduction, outputs are byte-identical across both CPUs and across rebuilds, a repeat of the nine runs reproduced every accuracy statistic exactly, and at least 98% of timing rows per machine agreed within ±10% with the larger differences localised to very short GPU kernels and transfers. That is the right shape for this claim, and it names where reproduction is tight and where it is not. The pinned upstream (required point 2) is now in Table B12, with the CuBesselK source pinned to commit 94ec9ca and checked against SHA-256 digests, which closes the one gap the manuscript had flagged against itself. The headline (required point 3) now reads as the AVX-512 speedup over the fastest external implementation for the random mixture at N = 2^25, reported beside the 3.9× to 21× range (median 7.5×) over the eight datasets and the 2.2× to 6.8× range over the ladder; I checked Table 3 and the arithmetic holds (156/23.7 ≈ 6.6, and 94.1/1.31 ≈ 72 for the ν = 2.5 path).

The two recommended items are also in: Tables 3, 4 and B10 carry IQR as a percentage of the median with speedup bounds from opposing quartiles, and Table B13 maps every table and figure to make figures or make tables run against the archived v0.9.6 run directories.

One point I note without an ask. The reported numbers come from libmatern 0.9.5 at commit e370401 while the regeneration tooling and run directories ship in release v0.9.6; the paper states the later commits change neither the computational sources nor the compiler flags, which resolves the mismatch for a reader standing the numbers up. From a reproducibility standpoint the paper is now in a strong position, with frozen inputs, archived high-precision references, pinned baselines, a determinism attestation and a regeneration map.

Numbered suggestions to the authors:

(none — all prior points are resolved)

Peer review record (PDF) · How open review works

Abstract

Efficient and accurate evaluation of the Matérn covariance function is essential for computationally demanding spatial statistics and Gaussian-process applications. We present libmatern, a numerical library that substantially accelerates Matérn covariance evaluation on SIMD CPUs and CUDA GPUs while maintaining competitive or improved numerical accuracy. On synthetic benchmarks, our single-threaded AVX-512 implementation is 6.6× faster than the fastest tested external CPU implementation for a random mixture of 2²⁵ evaluations, and 3.9× to 21× (median 7.5×) faster across eight test datasets. On the tested GPU, our CUDA implementation achieves kernel-level speedups of 1.7× to 6.8× (median 2.3×) over the fastest tested external implementations, with an end-to-end median speedup of 1.1× when host–device transfers are included. These performance gains are accompanied by competitive or improved numerical accuracy across the investigated parameter regimes. As a novelty of our approach we rigorously incorporate the Matérn prefactor directly into numerical formulations for the modified Bessel function Kν, reducing intermediate floating-point range restrictions and improving accuracy on nearly all tested datasets even without SIMD execution. Architecture-dependent algorithm selection and hardware-specific optimisation provide additional performance gains. The results demonstrate that mathematical reformulation and hardware-specific optimisation provide complementary benefits for accurate and efficient Matérn covariance evaluation.

1 Introduction

The Matérn covariance function, also called Sobolev kernel, is widely used in spatial statistics and Gaussian-process modelling, including applications in geostatistics (Chaudhuri et al., 2025), robotics (Jaquier et al., 2022) and biomedical research (Bahg et al., 2020). Constructing a covariance matrix for nn observation sites of a non-stationary process requires O(n2)O(n^2) covariance evaluations. Although matrix factorisation may entail O(n3)O(n^3) operations, repeated covariance evaluations can contribute appreciably to the cost of inference, prediction and simulation, particularly when the smoothness parameter varies or must be estimated (Stein, 2005).

The mathematical formula for the Matérn covariance multiplies the modified Bessel function KνK_\nu by a Gamma-normalised power. General-purpose special-function implementations usually evaluate KνK_\nu or an exponentially scaled form, as in Bessels.jl (JuliaMath, n.d.-a). However, separate evaluation of these factors can produce intermediate overflow or underflow, so that directly evaluating the normalised covariance offers an alternative numerical formulation.

Our principal contribution is the incorporation of the complete Matérn prefactor into various numerical representations of KνK_{\nu}. The resulting formulae are combined by architecture-dependent routing and are implemented for scalar CPUs, SIMD CPUs and CUDA GPUs. Accuracy is assessed against high-precision reference values on different datasets, while timings distinguish scalar reformulation, SIMD execution, GPU kernel evaluation and host–device transfer overhead.

Section 2 develops the formulae, Section 3 describes the implementation, and Section 4 specifies the test design. The latter concerns the numerical covariance kernel rather than complete Gaussian-process pipelines. Results and limitations are presented in Sections 5 and 6, respectively. Additional figures and tables are provided in the Appendix.

2 Mathematical background and numerical formulation

2.1 Matérn covariance

The normalised Whittle–Matérn covariance function is defined for ν>0\nu>0 and z>0z>0 as Mν(z)=2Γ(ν)(z2)νKν(z),(1)\begin{equation} \label{eq:matern} M_\nu(z)=\frac{2}{\Gamma(\nu)}\left(\frac z2\right)^\nu K_\nu(z), \end{equation} \qquad(1) where Γ\Gamma denotes the Gamma function and KνK_\nu the modified Bessel function of the second kind. The dimensionless argument zz separates the statistical parameterisation from the evaluation of the numerical kernel. For marginal variance σ2>0\sigma^2>0, spatial scale s>0s>0 and smoothness ν>0\nu>0, the Whittle–Matérn parameterisation is Cσ2,ν,s(h)=σ2Mν(z),z=h/s,\begin{equation*} \label{eq:param} C_{\sigma^2,\nu,s}(h)=\sigma^2M_\nu(z), \qquad z=h/s, \end{equation*} where h≥0h\geq0 is the Euclidean distance between two observation sites. The Matérn parameterisation sets z=2νh/sz=\sqrt{2\nu}h/s and the Handcock–Wallis parameterisation defines z=2νh/sz=2\sqrt{\nu}h/s.

At z=0z=0, the normalised covariance is defined by continuity. For ν>0\nu>0, the small-argument behaviour is Kν(z)∼12Γ(ν)(z2)−ν,z→0+.\begin{align*} K_\nu(z)&\sim\frac12\Gamma(\nu)\left(\frac z2\right)^{-\nu}, \qquad z\to0^+. \end{align*} Thus Mν(0)=1M_\nu(0)=1 and MνM_{\nu} is a correlation function. For sufficiently small zz or large ν\nu, the factor (z/2)ν(z/2)^\nu may underflow while Kν(z)K_\nu(z) becomes very large, even though the product in Equation (1) is within (0,1](0,1]. The formulations below incorporate the prefactor into the numerical methods to avoid these intermediate range limitations.

2.2 Numerical evaluation of the modified Bessel function

For the reader’s ease we present here known mathematical background that is needed for the numerical evaluation of KνK_{\nu} in our implementation. For non-integer order, the modified Bessel functions of the first and second kind satisfy (NIST Digital Library of Mathematical Functions, n.d.-c, n.d.-e) Kν(z)=π2sin⁡(πν)[I−ν(z)−Iν(z)],ν∉ℤ,z>0,(2)\begin{equation} \label{eq:integer-cancellation} K_\nu(z)=\frac{\pi}{2\sin(\pi\nu)}\left[I_{-\nu}(z)-I_\nu(z)\right], \qquad \nu\notin\mathbb Z, z > 0, \end{equation} \qquad(2) and Iν(z)=∑m=0∞1m!Γ(m+ν+1)(z2)2m+ν.(3)\begin{equation} \label{eq:bessel-I} I_\nu(z)=\sum_{m=0}^\infty\frac{1}{m!\,\Gamma(m+\nu+1)} \left(\frac z2\right)^{2m+\nu}. \end{equation} \qquad(3) For integer nn, we have I−n(z)=In(z)I_{-n}(z)=I_n(z) since 1/Γ(m−n+1)=01/\Gamma(m-n+1)=0 for m=0,…,n−1m=0,\ldots,n-1. Hence, both the numerator and the sine in Equation (2) vanish as ν→n\nu\to n. For non-integer ν\nu, substitution of Equation (3) gives Kν(z)=π2sin⁡(πν)[∑m=0∞(z/2)2m−νm!Γ(m−ν+1)−∑m=0∞(z/2)2m+νm!Γ(m+ν+1)].\begin{equation*} K_\nu(z)=\frac{\pi}{2\sin(\pi\nu)}\Biggl[ \sum_{m=0}^\infty\frac{(z/2)^{2m-\nu}}{m!\,\Gamma(m-\nu+1)} -\sum_{m=0}^\infty\frac{(z/2)^{2m+\nu}}{m!\,\Gamma(m+\nu+1)}\Biggr]. \end{equation*} Euler’s reflection formula and the Gamma-function recurrence formula imply Γ(ν)Γ(1−ν)=πsin⁡(πν),Γ(1−ν)Γ(k+1−ν)=1(1−ν)k,\begin{equation*} \Gamma(\nu)\Gamma(1-\nu)=\frac{\pi}{\sin(\pi\nu)}, \qquad \frac{\Gamma(1-\nu)}{\Gamma(k+1-\nu)}=\frac{1}{(1-\nu)_k}, \end{equation*} where (a)k=Γ(a+k)/Γ(a)(a)_k=\Gamma(a+k)/\Gamma(a) is the so-called rising factorial. Consequently, Kν(z)=12(z2)−ν{Γ(ν)[1+∑k=1∞(z/2)2kk!(1−ν)k]−(z2)2νπsin⁡(πν)Γ(ν+1)[1+∑k=1∞(z/2)2kk!(1+ν)k]}.(4)\begin{equation} \label{eq:bessel-power}\begin{aligned} K_\nu(z)=\frac12\left(\frac z2\right)^{-\nu}\Biggl\{& \Gamma(\nu)\left[1+\sum_{k=1}^\infty\frac{(z/2)^{2k}}{k!\,(1-\nu)_k}\right] \\ &-\left(\frac z2\right)^{2\nu}\frac{\pi}{\sin(\pi\nu)\Gamma(\nu+1)} \left[1+\sum_{k=1}^\infty\frac{(z/2)^{2k}}{k!\,(1+\nu)_k}\right]\Biggr\}. \end{aligned} \end{equation} \qquad(4) This representation separates the dominant powers of zz, but direct evaluation becomes poorly conditioned near integer orders because one of the separate terms contains a factor proportional to 1/sin⁡(πν)1/\sin(\pi\nu).

Temme’s series avoids this near-integer cancellation (Temme, 1975). For general positive order, write m=⌊ν+12⌋,α=ν−m,−12≤α<12.(5)\begin{equation} \label{eq:order-reduction} m=\left\lfloor\nu+\frac12\right\rfloor, \qquad \alpha=\nu-m, \qquad -\frac12\leq\alpha<\frac12. \end{equation} \qquad(5) The modified Bessel recurrence (NIST Digital Library of Mathematical Functions, n.d.-g) Kα+j+1(z)=Kα+j−1(z)+2(α+j)zKα+j(z),j=1,…,m−1,(6)\begin{equation} \label{eq:bessel-recurrence} K_{\alpha+j+1}(z)=K_{\alpha+j-1}(z) +\frac{2(\alpha+j)}{z}K_{\alpha+j}(z), \qquad j=1,\ldots,m-1, \end{equation} \qquad(6) recovers the required order from KαK_\alpha and Kα+1K_{\alpha+1}. The latter can be represented by the coupled Temme series Kα(z)=∑k=0∞ckfk,Kα+1(z)=2z∑k=0∞ckhk,(7)\begin{equation} \label{eq:temme-series} K_\alpha(z)=\sum_{k=0}^\infty c_k f_k, \qquad K_{\alpha+1}(z)=\frac2z\sum_{k=0}^\infty c_k h_k, \end{equation} \qquad(7) with ck=(z2/4)kk!.\begin{equation*} c_k=\frac{(z^2/4)^k}{k!}. \end{equation*} Let μ=αlog⁡(2/z)\mu=\alpha\log(2/z). Then, the first coefficient is f0=παsin⁡(πα)[−γ1(α)coshμ+γ2(α)log(2z)sinh⁡μμ],\begin{equation*} f_0=\frac{\pi\alpha}{\sin(\pi\alpha)}\left[ -\gamma_1(\alpha)\cosh\mu+ \gamma_2(\alpha)\log\!\left(\frac2z\right)\frac{\sinh\mu}{\mu}\right], \end{equation*} where the Gamma-function combinations are γ1(α)=Γ(1+α)−1−Γ(1−α)−12α=γE+(γE36−γEζ(2)2+ζ(3)3)α2+O(α4),(8)\begin{equation} \label{jrep:eq:8}\begin{aligned} \gamma_1(\alpha)&=\frac{\Gamma(1+\alpha)^{-1}-\Gamma(1-\alpha)^{-1}}{2\alpha} =\gamma_E+\Bigl(\frac{\gamma_E^3}{6}-\frac{\gamma_E\,\zeta(2)}{2}+\frac{\zeta(3)}{3}\Bigr)\alpha^2+O(\alpha^4),\end{aligned} \end{equation} \qquad(8) γ2(α)=Γ(1+α)−1+Γ(1−α)−12=1+γE2−ζ(2)2α2+O(α4),(9)\begin{equation} \label{eq:temme_taylor}\begin{aligned} \gamma_2(\alpha)&=\frac{\Gamma(1+\alpha)^{-1}+\Gamma(1-\alpha)^{-1}}2 =1+\frac{\gamma_E^2-\zeta(2)}{2}\,\alpha^2+O(\alpha^4), \end{aligned} \end{equation} \qquad(9) where γE=γ1(0)\gamma_E=\gamma_1(0) is the Euler–Mascheroni constant and ζ\zeta denotes the Riemann zeta function. The starting terms for the two auxiliary sequences are p0=h0=12(z2)−αΓ(1+α),q0=12(z2)αΓ(1−α).(10)\begin{equation} \label{eq:temme-p0} p_0=h_0=\frac12\left(\frac z2\right)^{-\alpha}\Gamma(1+\alpha), \qquad q_0=\frac12\left(\frac z2\right)^{\alpha}\Gamma(1-\alpha). \end{equation} \qquad(10) The removable singularities at α=0\alpha=0 in the initialisation are evaluated by their limits. For k≥1k\geq1 these sequences and the Temme coefficients satisfy pk=pk−1k−α,qk=qk−1k+α,\begin{equation*} p_k=\frac{p_{k-1}}{k-\alpha}, \qquad q_k=\frac{q_{k-1}}{k+\alpha}, \end{equation*} fk=kfk−1+pk−1+qk−1k2−α2,hk=−kfk+pk.\begin{equation*} f_k=\frac{kf_{k-1}+p_{k-1}+q_{k-1}}{k^2-\alpha^2}, \qquad h_k=-kf_k+p_k. \end{equation*}

Another representation follows from the Wronskian identity 1z=Iν(z)Kν+1(z)+Iν+1(z)Kν(z).\begin{equation*} \frac1z=I_\nu(z)K_{\nu+1}(z)+I_{\nu+1}(z)K_\nu(z). \end{equation*} With Rν(z)=Kν+1(z)/Kν(z)R_\nu(z)=K_{\nu+1}(z)/K_\nu(z), this gives Kν(z)=1z[Iν(z)Rν(z)+Iν+1(z)].(11)\begin{equation} \label{eq:wronskian} K_\nu(z)=\frac{1}{z[I_\nu(z)R_\nu(z)+I_{\nu+1}(z)]}. \end{equation} \qquad(11) The ratio can be evaluated through the continued-fraction representation (NIST Digital Library of Mathematical Functions, n.d.-d) Rν(z)=2ν+1+2z2z+1zK∞m=1ν2−(2m−1)2/42(z+m),(12)\begin{equation} \label{eq:ratio-cf} R_\nu(z)=\frac{2\nu+1+2z}{2z} +\frac1z\underset{m=1}{\overset{\infty}{\mathrm K}} \frac{\nu^2-(2m-1)^2/4}{2(z+m)}, \end{equation} \qquad(12) where the continued-fraction operator uses the standard nested-fraction notation (Cuyt et al., 2008): KNm=1ambm=a1b1+a2b2+⋯+aNbN.\begin{equation*} \underset{m=1}{\overset{N}{\mathrm K}}\frac{a_m}{b_m} =\dfrac{a_1}{b_1+\dfrac{a_2}{b_2+\cdots+\dfrac{a_N}{b_N}}}. \end{equation*}

For half-integer orders ν=p+12\nu=p+\frac12, p∈ℕ0p\in\mathbb N_0, the Bessel function has the finite representation Kp+1/2(z)=π2ze−z∑j=0p(p+j)!j!(p−j)!(2z)j.(13)\begin{equation} \label{eq:bessel-half} K_{p+1/2}(z)=\sqrt{\frac{\pi}{2z}}e^{-z} \sum_{j=0}^{p}\frac{(p+j)!}{j!(p-j)!(2z)^j}. \end{equation} \qquad(13)

Also, two asymptotic regimes are used. For large argument zz at fixed order ν\nu, the Poincaré expansion (NIST Digital Library of Mathematical Functions, n.d.-a) is Kν(z)∼π2ze−z[1+∑k=1∞∏ℓ=1k(4ν2−(2ℓ−1)2)k!(8z)k].(14)\begin{equation} \label{eq:bessel-large-z} K_\nu(z)\sim\sqrt{\frac{\pi}{2z}}e^{-z} \left[1+\sum_{k=1}^\infty \frac{\prod_{\ell=1}^k\left(4\nu^2-(2\ell-1)^2\right)}{k!(8z)^k}\right]. \end{equation} \qquad(14) The truncated expansion can be accelerated by a factorial Levin–Weniger transformation (NIST Digital Library of Mathematical Functions, n.d.-f). Let t0=1,tk=∏ℓ=1k[4ν2−(2ℓ−1)2]k!(8z)k=tk−14ν2−(2k−1)28kz(15)\begin{equation} \label{eq:large-z-terms} t_0=1,\qquad t_k=\frac{\prod_{\ell=1}^k[4\nu^2-(2\ell-1)^2]}{k!(8z)^k} =t_{k-1}\frac{4\nu^2-(2k-1)^2}{8kz} \end{equation} \qquad(15) and define the partial sums and the exact scaled function by sn=∑j=0ntj,Sν(z)=2zπezKν(z).\begin{equation*} s_n=\sum_{j=0}^nt_j, \qquad S_\nu(z)=\sqrt{\frac{2z}{\pi}}e^zK_\nu(z). \end{equation*} The series is generally divergent for finite zz, and sns_n is therefore interpreted as an asymptotic approximant. Levin-type transformations model the truncation error through a remainder estimate wnw_n. For a fixed remainder estimate wnw_n, the factorial model (Weniger, 1989) assumes sn−Sν(z)=wn∑j=0k−1dj(β+n)j,k≥1,\begin{equation*} s_n-S_\nu(z)=w_n\sum_{j=0}^{k-1}\frac{d_j}{(\beta+n)_j},\qquad k\geq1, \end{equation*} for the k+1k+1 consecutive indices n,…,n+kn,\dots,n+k, where β>0\beta>0 is a fixed parameter and d0,…,dk−1d_0,\dots,d_{k-1} are unknown coefficients that may depend on zz, ν\nu and β\beta but not on nn. These k+1k+1 equations determine the kk coefficients together with Sν(z)S_\nu(z), and the transformation derived below solves them for Sν(z)S_\nu(z) without computing the djd_j. Since the ratio (sn−Sν(z))/wn(s_n-S_\nu(z))/w_n generally has an infinite expansion in the inverse Pochhammer symbols 1/(β+n)j1/(\beta+n)_j, truncating it after kk terms makes the result an approximation; it is exact for sequences whose truncation error has precisely this form. With this remainder estimate, the transformation is Weniger’s δ\delta transformation (Weniger, 1989). Multiplication by (β+n)k−1/wn(\beta+n)_{k-1}/w_n gives (β+n)k−1sn−Sν(z)wn=∑j=0k−1dj(β+n+j)k−1−j.\begin{equation*} (\beta+n)_{k-1}\frac{s_n-S_\nu(z)}{w_n} =\sum_{j=0}^{k-1}d_j(\beta+n+j)_{k-1-j}. \end{equation*} Since the right-hand side is a polynomial in nn of degree at most k−1k-1, its kkth forward difference vanishes. Applying Δf(n)=f(n+1)−f(n)\Delta f(n)=f(n+1)-f(n) yields Δk[(β+n)k−1snwn]−Sν(z)Δk[(β+n)k−1wn]=0.\begin{equation*} \Delta^k\left[(\beta+n)_{k-1}\frac{s_n}{w_n}\right] -S_\nu(z)\Delta^k\left[\frac{(\beta+n)_{k-1}}{w_n}\right]=0. \end{equation*} Since the djd_j do not depend on nn, they enter only as constant coefficients of terms whose kkth forward difference is zero, and therefore do not appear in this equation. Solving the transformed approximation gives Ŝν,k(z)=Δk[(β+n)k−1sn/wn]Δk[(β+n)k−1/wn]|n=0=∑i=0kCisi/wi∑i=0kCi/wi,(16)\begin{equation} \label{eq:levin} \widehat S_{\nu,k}(z)= \left.\frac{\Delta^k[(\beta+n)_{k-1}s_n/w_n]} {\Delta^k[(\beta+n)_{k-1}/w_n]}\right|_{n=0} =\frac{\displaystyle\sum_{i=0}^kC_i\,s_i/w_i} {\displaystyle\sum_{i=0}^kC_i/w_i}, \end{equation} \qquad(16) where Ci=(−1)i(ki)(β+i)k−1(β+k)k−1.(17)\begin{equation} \label{eq:levin-weights} C_i=(-1)^i\binom{k}{i} \frac{(\beta+i)_{k-1}}{(\beta+k)_{k-1}}. \end{equation} \qquad(17) The weights in Equation (17) follow by expanding the forward differences, Δkf(n)=∑i=0k(−1)k−i(ki)f(n+i)\Delta^k f(n)=\sum_{i=0}^k(-1)^{k-i}\binom{k}{i}f(n+i), and cancelling the common sign and normalisation. Thus, the corresponding approximation of the unscaled Bessel function is Kν(z)≈π2ze−zŜν,k(z).(18)\begin{equation} \label{eq:levin-final} K_\nu(z)\approx\sqrt{\frac{\pi}{2z}}\,e^{-z}\widehat S_{\nu,k}(z). \end{equation} \qquad(18) Our implementation uses the weights of Equation (17) for β=2\beta=2 and k=14k=14 as stored constants. For β=2\beta=2, the numerator and denominator can be evaluated by Weniger’s difference-table recurrence. The transformation requires wi≠0w_i\neq0 for 0≤i≤k0\leq i\leq k and a nonzero denominator in Equation (16). Its accuracy depends on the remainder model and the numerical conditioning of the transformed sums. We use wn=tn+1w_n=t_{n+1}. Note that, at half-integer order ν=p+12\nu=p+\frac12, the factor 4ν2−(2k−1)2=4(p+1−k)(p+k)4\nu^2-(2k-1)^2=4(p+1-k)(p+k) in Equation (15) vanishes at k=p+1k=p+1, so tk=0t_k=0 for all k>pk>p and the series terminates. The remaining terms are tj=(p+j)!j!(p−j)!(2z)jt_j=\frac{(p+j)!}{j!\,(p-j)!\,(2z)^j}, so the partial sum sps_p coincides term by term with the finite representation in Equation (13) and is exact. Since the remainder estimates then vanish for i≥pi\ge p, the transformation in Equation (16) is undefined, and the implementation returns sps_p unchanged.

An ansatz for large order ν\nu with fixed ratio r=z/νr=z/\nu is the uniform expansion (NIST Digital Library of Mathematical Functions, n.d.-b), Kν(νr)∼πp2νe−νη(r)∑k=0∞(−1)kUk(p)νk,(19)\begin{equation} \label{eq:bessel-large-order} K_\nu(\nu r)\sim\sqrt{\frac{\pi p}{2\nu}} e^{-\nu\eta(r)} \sum_{k=0}^\infty\frac{(-1)^kU_k(p)}{\nu^k}, \end{equation} \qquad(19) where η(r)=1p+log⁡(r1+1/p),p=(1+r2)−1/2.(20)\begin{equation} \label{eq:debye-eta} \eta(r)=\frac1p+ \log\left(\frac{r}{1+1/p}\right), \qquad p=(1+r^2)^{-1/2}. \end{equation} \qquad(20) The Debye polynomials UkU_k are defined by U0(p)=1U_0(p)=1 and Uk+1(p)=12p2(1−p2)Uk′(p)+18∫0p(1−5q2)Uk(q)dq,k≥0.\begin{equation*} U_{k+1}(p)=\frac12p^2(1-p^2)U_k'(p) +\frac18\int_0^p(1-5q^2)U_k(q)\,dq, \qquad k\geq0. \end{equation*}

2.3 Incorporation of the Matérn prefactor

2.3.1 Large-order formulation

Substituting Equation (19) into Equation (1) gives Mν(z)∼2Γ(ν)(z2)νπp2νe−νη(r)∑k=0∞(−1)kUk(p)νk=2πpνexp⁡{νlog(z2)−logΓ(ν)−νη(r)}∑k=0∞(−1)kUk(p)νk.(21)\begin{equation} \label{eq:debye-step}\begin{aligned} M_\nu(z)\sim{}&\frac{2}{\Gamma(\nu)}\left(\frac z2\right)^\nu \sqrt{\frac{\pi p}{2\nu}}e^{-\nu\eta(r)} \sum_{k=0}^\infty\frac{(-1)^kU_k(p)}{\nu^k}\\ ={}&\sqrt{\frac{2\pi p}{\nu}} \exp\left\{\nu\log\left(\frac z2\right)-\log\Gamma(\nu)-\nu\eta(r)\right\} \sum_{k=0}^\infty\frac{(-1)^kU_k(p)}{\nu^k}. \end{aligned} \end{equation} \qquad(21) Since r=z/νr=z/\nu, the exponent in Equation (21) becomes νlog⁡(z/2)−log⁡Γ(ν)−νη(r)=−νlog⁡2−log⁡Γ(ν)−νp+νlog⁡ν+νlog⁡(1+1/p).(22)\begin{equation} \nu\log(z/2)-\log\Gamma(\nu)-\nu\eta(r) =-\nu\log2-\log\Gamma(\nu)-\frac{\nu}{p} +\nu\log\nu+\nu\log(1+1/p).\label{eq:debye-exponent-before} \end{equation} \qquad(22) The Stirling expansion delivers log⁡Γ(ν)∼(ν−12)log⁡ν−ν+12log⁡(2π)+112ν−1360ν3+11260ν5−⋯.\begin{equation*} \log\Gamma(\nu)\sim \left(\nu-\frac12\right)\log\nu-\nu+\frac12\log(2\pi) +\frac1{12\nu}-\frac1{360\nu^3}+\frac1{1260\nu^5}-\cdots. \end{equation*} Substituting into Equation (22) yields νlog⁡(z/2)−log⁡Γ(ν)−νη(r)∼ν[log(1+1p)−1p+1−log2]+12log⁡ν−12log⁡(2π)−112ν+1360ν3−⋯.(23)\begin{equation} \label{eq:debye-sterling}\begin{aligned} &\nu\log(z/2)-\log\Gamma(\nu)-\nu\eta(r) \\ &\quad\sim\nu\left[\log(1+\frac{1}{p})-\frac{1}{p}+1-\log2\right] +\frac12\log\nu-\frac12\log(2\pi) -\frac1{12\nu}+\frac1{360\nu^3}-\cdots. \end{aligned} \end{equation} \qquad(23) It follows that Mν(z)∼p1/2exp⁡{νΦ(r)−A(ν)}∑k=0∞(−1)kUk(p)νk(24)\begin{equation} \label{eq:debye} M_\nu(z)\sim p^{1/2} \exp\left\{\nu\Phi(r)-A(\nu)\right\} \sum_{k=0}^\infty\frac{(-1)^kU_k(p)}{\nu^k} \end{equation} \qquad(24) with Φ(r)=log⁡(1+1/p2)−(1/p−1),\begin{equation*} \Phi(r)=\log\left(\frac{1+1/p}{2}\right)-(1/p-1), \end{equation*} and A(ν)∼112ν−1360ν3+11260ν5−⋯.\begin{equation*} A(\nu)\sim\frac1{12\nu}-\frac1{360\nu^3} +\frac1{1260\nu^5}-\cdots. \end{equation*}

2.3.2 Continued-fraction formulation

The Wronskian representation in Equation (11) requires Iν(z)I_\nu(z), Iν+1(z)I_{\nu+1}(z) and the ratio Rν(z)R_\nu(z). Let Gν(z)=(z/2)νΓ(ν).\begin{equation*} G_\nu(z)=\frac{(z/2)^\nu}{\Gamma(\nu)}. \end{equation*} Then, Iν(z)=Gν(z)Ĥν(z)withĤν(z)=1ν∑m=0∞(z2/4)mm!(ν+1)m,(25)\begin{equation} \label{continued1}\begin{aligned} I_\nu(z)&=G_\nu(z)\,\widehat H_\nu(z) \qquad \text{with} \qquad \widehat H_\nu(z)=\frac1\nu\sum_{m=0}^\infty \frac{(z^2/4)^m}{m!\,(\nu+1)_m}, \end{aligned} \end{equation} \qquad(25) Iν+1(z)=Gν(z)Ĥν+1(z)withĤν+1(z)=z2ν(ν+1)∑m=0∞(z2/4)mm!(ν+2)m.(26)\begin{equation} \label{continued2}\begin{aligned} I_{\nu+1}(z)&=G_\nu(z)\,\widehat H_{\nu+1}(z) \qquad \text{with} \qquad \widehat H_{\nu+1}(z)=\frac{z}{2\nu(\nu+1)}\sum_{m=0}^\infty \frac{(z^2/4)^m}{m!\,(\nu+2)_m}. \end{aligned} \end{equation} \qquad(26) The normalised series Ĥν=∑m≥0am\widehat H_\nu=\sum_{m\geq0}a_m and Ĥν+1=∑m≥0bm\widehat H_{\nu+1}=\sum_{m\geq0}b_m have the initial terms a0=1ν,b0=z2ν(ν+1),\begin{equation*} a_0=\frac1\nu, \qquad b_0=\frac{z}{2\nu(\nu+1)}, \end{equation*} and recurrences am+1=amz2/4(m+1)(ν+m+1),bm+1=bmz2/4(m+1)(ν+m+2).(27)\begin{equation} \label{eq:cf-terms} a_{m+1}=a_m\frac{z^2/4}{(m+1)(\nu+m+1)}, \qquad b_{m+1}=b_m\frac{z^2/4}{(m+1)(\nu+m+2)}. \end{equation} \qquad(27) Substituting Equation (25) and Equation (26) into Equation (11) gives Mν(z)=2Gν(z)Kν(z)=2z[Rν(z)Ĥν(z)+Ĥν+1(z)],(28)\begin{equation} \label{eq:folded-cf} M_\nu(z)=2G_\nu(z)K_\nu(z)=\frac{2}{z[R_\nu(z)\widehat H_\nu(z)+\widehat H_{\nu+1}(z)]}, \end{equation} \qquad(28) where Rν(z)R_{\nu}(z) is given by Equation (12).

2.3.3 Temme formulation

Let Ti=2(z/2)α+iΓ(α+i)Kα+i(z),i=0,…,m,(29)\begin{equation} \label{eq:Tdef} T_i=\frac{2(z/2)^{\alpha+i}}{\Gamma(\alpha+i)}K_{\alpha+i}(z), \qquad i=0,\ldots,m, \end{equation} \qquad(29) where T0T_0 is defined by continuity at α=0\alpha=0. Equation (6) delivers Ti+1=2(z/2)α+i+1Γ(α+i+1)[Kα+i−1(z)+2(α+i)zKα+i(z)]=Ti+(z/2)2(α+i)(α+i−1)Ti−1,i∈ℕ.(30)\begin{equation} \label{eq:folded-temme}\begin{aligned} T_{i+1}&=\frac{2(z/2)^{\alpha+i+1}}{\Gamma(\alpha+i+1)} \left[K_{\alpha+i-1}(z)+\frac{2(\alpha+i)}zK_{\alpha+i}(z)\right] \\ &=T_i+\frac{(z/2)^2}{(\alpha+i)(\alpha+i-1)}T_{i-1}, \qquad i \in \mathbb{N}. \end{aligned} \end{equation} \qquad(30) Let FT=2(z/2)αΓ(1+α).\begin{equation*} F_T=\frac{2(z/2)^\alpha}{\Gamma(1+\alpha)}. \end{equation*} Using Γ(1+α)=αΓ(α)\Gamma(1+\alpha)=\alpha\Gamma(\alpha) in Equation (7), the initial values are T0=FTα∑k=0∞ckfk,T1=FT∑k=0∞ckhk.(31)\begin{equation} \label{eq:temme-start} T_0=F_T\alpha\sum_{k=0}^\infty c_kf_k, \qquad T_1=F_T\sum_{k=0}^\infty c_kh_k. \end{equation} \qquad(31) The second summand in Equation (30) is written as the product of ri=1/(α+i)r_i=1/(\alpha+i) and ℓi=(z/2)2α+i−1Ti−1,(32)\begin{equation} \label{eq:ell} \ell_i=\frac{(z/2)^2}{\alpha+i-1}T_{i-1}, \end{equation} \qquad(32) so that Ti+1=Ti+ℓiriT_{i+1} =T_i+\ell_i r_i and ℓi+1=Ti(z/2)2ri\ell_{i+1}=T_i(z/2)^2r_i. For i=1i=1 in Equation (32), we have ℓ1=(z/2)2αT0=FT(z/2)2∑k=0∞ckfk,\begin{equation*} \ell_1=\frac{(z/2)^2}{\alpha}T_0=F_T(z/2)^2\sum_{k=0}^{\infty}c_kf_k, \end{equation*} and ℓ1\ell_1 is evaluated by means of the right-hand side. Starting from T1T_1 in Equation (31) and ℓ1\ell_1 above, the recurrences are Ti+1=Ti+ℓiri,i=1,…,m−1,ℓi+1=Ti(z/2)2ri,i=1,…,m−2.\begin{align*} T_{i+1}&=T_i+\ell_i r_i, \qquad &i=1,\ldots,m-1,\\ \ell_{i+1}&=T_i(z/2)^2r_i, \qquad &i=1,\ldots,m-2. \end{align*} The resulting value is Tm=Mν(z)T_m=M_\nu(z) for m≥1m\ge1; for m=0m=0, Mν(z)=T0M_\nu(z)=T_0 is given directly by Equation (31).

2.3.4 Half-integer orders

For ν=p+12\nu=p+\frac12, the identity Γ(p+12)=(2p)!4pp!π\begin{equation*} \Gamma\left(p+\frac12\right)=\frac{(2p)!}{4^pp!}\sqrt\pi \end{equation*} together with Equations (13) and (1) yields Mp+1/2(z)=e−z∑k=0pckzk,ck=2kp!(2p−k)!(p−k)!k!(2p)!,k=0,…,p.(33)\begin{equation} \label{eq:half}\begin{aligned} M_{p+1/2}(z) &=e^{-z}\sum_{k=0}^pc_kz^k,\qquad c_k=\frac{2^kp!(2p-k)!}{(p-k)!\,k!\,(2p)!}, \qquad k=0,\ldots,p. \end{aligned} \end{equation} \qquad(33) We have c0=1c_0=1 and the recurrence formula ck=ck−12(p−k+1)k(2p−k+1),k=1,…,p.\begin{equation*} c_k=c_{k-1}\frac{2(p-k+1)}{k(2p-k+1)}, \qquad k=1,\ldots,p. \end{equation*}

2.3.5 Large-argument formulation

Equations (1), (14) and (15) deliver Mν(z)∼exp⁡{(ν−12)log(z2)+12logπ−logΓ(ν)−z}[1+∑k=1∞tk].(34)\begin{equation} \label{eq:large-z} M_\nu(z)\sim\exp\left\{ \left(\nu-\frac12\right)\log\left(\frac z2\right) +\frac12\log\pi-\log\Gamma(\nu)-z\right\} \left[1+\sum_{k=1}^\infty t_k \right]. \end{equation} \qquad(34)

3 Architecture-dependent implementation

With a few exceptions, all currently produced CPUs support Single Instruction Multiple Data (SIMD) execution alongside scalar processing. SIMD allows a single instruction to operate on multiple data elements simultaneously. In particular, AVX2 and AVX-512 process four and eight double-precision floating-point values per vector, respectively. However, SIMD execution differs among processor families and from scalar execution in instruction throughput, latency and the handling of divergent control flow, so that efficient numerical implementations depend on the target architecture. CUDA GPUs introduce further architectural differences, particularly in their execution model and sensitivity to branch divergence.

The numerical formulations developed in Section 2.3 have different accuracy and computational cost characteristics across the (ν,z)(\nu,z) parameter space. Our objective is to achieve high computational throughput while maintaining competitive numerical accuracy. To this end, we combine all methods presented in Section 2.3. The Temme formulation (30) is used for small arguments. Continued fractions (28) and Levin’s approach (18) cover intermediate regions, while the large-argument (14) and the large-order expansion (24) are employed where their truncated forms provide more favourable accuracy–cost trade-offs. Half-integer orders are evaluated using the finite polynomial representation in Equation (33). The selection boundaries were motivated by the domain decompositions of the Bessels.jl main branch (JuliaMath, n.d.-a) and version v0.2.8 (JuliaMath, n.d.-b), see Figure A1 in the Appendix, and subsequently adapted by comparing accuracy and runtime in regions where multiple formulations were reasonable. The resulting selection regions are shown in Figure 1, while the corresponding algorithm-selection rules are detailed in Table B3. The half-integer order limits restrict the polynomial evaluation to orders for which it is at least as accurate as the general formulations of the respective implementation; for the scalar implementation this holds up to the largest tabulated order p=40p=40. The boundary zmax=708.4z_{\max}=708.4 marks where e−ze^{-z} becomes subnormal; above it, the folded form Equation (34) (and Equation (24) for ν≥30\nu\ge30) combines all factors in one exponent. Below zmaxz_{\max} the large-argument region multiplies Equation (14) by the separately computed prefactor 2(z/2)ν/Γ(ν)2(z/2)^\nu/\Gamma(\nu); for ν≤30\nu\le30 this cannot overflow, and only for 705.3<z≤zmax705.3<z\le z_{\max} is the intermediate KνK_\nu already subnormal. The Levin band of the SIMD router is evaluated in the same way from Equation (18).

Fig 1: Algorithm selection in the (ν,z)(\nu,z) parameter plane for the scalar CPU, SIMD CPU and CUDA implementations of libmatern. Panels (a)–(c) show the corresponding domain decompositions on logarithmic scales. The filled regions identify the Temme, continued-fraction, large-argument and large-order formulations, together with the Levin region used by SIMD. The boundaries represent the empirically selected routing parameters, and the legend identifies additional special cases and implementation-specific boundaries.

Consecutive inputs (z,ν)(z,\nu) from different parameter regions are challenging for SIMD execution: they either require masked execution of several methods per vector, which adds overhead and leaves SIMD lanes idle, or have to be grouped by numerical method beforehand. The CPU implementation takes the second approach and groups the inputs by numerical method before the SIMD kernels are applied; for the tested workloads, the resulting gain exceeded the cost of grouping and permutation for large NN. Within a method, the iterative kernels continue until all lanes of a vector have converged, but each lane keeps the sum at its own convergence, so that it stops at the same term as when evaluated alone. The grouping costs are included in the reported CPU timings.

Every point of half-integer order ν≤29.5\nu\le 29.5 is evaluated by the closed form in Equation (33); in the SIMD implementation, a point reaches the closed form either before the general routing or within it. The batch is scanned from its start in sequences of consecutive points with equal order. A sequence of half-integer order is evaluated directly, without grouping, if it contains at least 256 points or reaches the end of the batch. If it is shorter but begins a sequence of consecutive points with half-integer orders, these points are grouped by order and then evaluated. A sequence of any other order with at least 256 points is passed to the general routing on its own. The first sequence that meets none of these conditions ends the scan, and the remaining points are passed to the general routing as a whole, which groups their half-integer points by order and evaluates them with the same closed form. Since the polynomial coefficients depend only on the order ν\nu, they are computed once for each sequence of one order and once per order within each group. In order to separate the SIMD effect from algorithmic differences, the matched backends compile the SIMD source which includes routing, grouping and folded kernels at vector width 1, using libm’s exp⁡/log⁡/𝚙𝚘𝚠\exp/\log/\texttt{pow} and Gamma function instead of the vectorised engines. Our version matched_fma uses hardware FMA, while matched emulates fused operations where cancellation matters. They are the fallback for CPUs without AVX2.

On CUDA GPUs, threads are executed in groups of 32, called warps, which, like the lanes of a SIMD vector, carry out the same instruction at the same time. Similarly, divergent execution can reduce GPU efficiency when threads within the same warp require different computational paths, since the warp then executes these paths one after another. Reordering the inputs on the host before the transfer is however omitted, because the additional memory operations required for grouping and restoring output order offset the reduction in warp divergence.

An additional challenge is the overhead for transferring input and output data between host and device, which can substantially reduce the performance benefits of GPU acceleration. To address this, the implementation supports four transfer strategies: synchronous copying, pinned-ring staging, temporary page registration and mapped host memory.

The iterative numerical methods require termination criteria that limit computational cost while maintaining numerical accuracy. We combine convergence-based stopping conditions with fixed iteration limits, allowing calculations to terminate once further iterations are no longer expected to improve the result, bounding the cost when convergence is slow. The corresponding criteria and iteration limits are documented in Table B1 and Table B2. For valid ν,s>0\nu,s>0, signed zeros yield Mν(0)=1M_\nu(0)=1, while Mν(h)→0M_{\nu}(h) \rightarrow 0 as h→+∞h \rightarrow +\infty. Returning Mν(0)=1M_\nu(0)=1 preserves the unit diagonal of normalised covariance matrices. A clamp of the results of the general methods to [0,1][0,1], which also returns a non-finite intermediate result as 00, guarantees a finite, admissible value even outside the tested domains, so such inputs do not introduce non-finite or out-of-range values into subsequent computations. Finally, NaN inputs, negative distances, and non-positive smoothness or scale parameters return NaN.

4 Experimental design

4.1 Reference values and accuracy metrics

To assess numerical accuracy, we compute high-precision reference values by means of FLINT/Arb, a high-performance library for exact and arbitrary-precision computation, while its Arb component provides rigorously bounded arbitrary-precision ball arithmetic (Johansson, 2017; The FLINT team, 2026). By enclosing the computed values within certified intervals, Arb allows the accuracy of double-precision implementations to be assessed against reliable numerical references.

Reference values were evaluated from Equation (1) using an initial precision of 512 bits, which was doubled when necessary until the enclosure computed by FLINT/Arb provided at least 110 bits of accuracy. This accuracy substantially exceeds the 53-bit significand precision of binary64, keeping uncertainty in the high-precision reference evaluation small relative to the errors being measured. Each reference value was stored as two binary64 components to support accurate subsequent error evaluation.

Numerical error is quantified in units in the last place (ULP), an established metric for floating-point computations and mathematical function implementations that accounts for the local spacing of representable values across the wide dynamic range of the Matérn covariance (Muller et al., 2018). For a binary64 result xx and a high-precision reference represented by rhi+rlor_{\textrm{hi}}+r_{\textrm{lo}}, the ULP distance is calculated as ULP⁡(x,r)=|(x−rhi)−rlo|𝚗𝚎𝚡𝚝𝚊𝚏𝚝𝚎𝚛(|rhi|,+∞)−|rhi|(35)\begin{equation} \label{eq:ulp} \operatorname{ULP}(x,r)=\frac{|(x-r_{\textrm{hi}})-r_{\textrm{lo}}|}{ \texttt{nextafter}(|r_{\textrm{hi}}|,+\infty)-|r_{\textrm{hi}}|} \end{equation} \qquad(35) where 𝚗𝚎𝚡𝚝𝚊𝚏𝚝𝚎𝚛(a,b)\texttt{nextafter}(a,b) denotes the C standard library function that returns the binary64 number adjacent to aa in the direction of bb, so that the denominator is the gap between |rhi||r_{\textrm{hi}}| and the next larger binary64 number, i.e. one ULP at the reference value. For reference values below 2−9722^{-972}, quantisation of rlor_{\textrm{lo}} can introduce an uncertainty of up to 0.50.5 ULP, see Table B4. We verified that accounting for this uncertainty does not change the reported maximum ULP errors. Non-finite outputs are excluded from the error statistics and reported separately, see Table B6.

4.2 Comparison methods and baseline construction

To assess the numerical accuracy and computational performance of libmatern, we compare it against widely used general-purpose mathematical libraries and specialised implementations developed for efficient Bessel-function evaluation. The CPU baselines include std::cyl_bessel_k from libstdc++ (GCC Development Team, n.d.), GSL (GSL Development Team, n.d.), Boost.Math (Boost Developers, n.d.), three ports of CuBesselK by Geng et al. (2025), labelled kaust-128, kaust-40 and kaust-modified in the tables, and two C ports of Bessels.jl corresponding to its main branch (JuliaMath, n.d.-a) and version v0.2.8 (JuliaMath, n.d.-b); the latter uses the main branch’s cut-off for the large-argument expansion of IνI_\nu. The upstream versions of all baselines are listed in Table B12. The GPU comparisons include the same CuBesselK ports compiled with nvcc and a GPU implementation of Boost.Math (Boost Developers, n.d.). Since all these implementations primarily evaluate Kν(z)K_\nu(z) rather than the normalised Matérn covariance, their outputs must be combined with the Matérn prefactor to obtain comparable results.

Although the covariance assemblies are mathematically equivalent, their numerical accuracy can differ due to intermediate overflow, underflow and floating-point rounding errors. To avoid disadvantaging external implementations through an unsuitable conversion from Kν(z)K_\nu(z) to the Matérn covariance, we evaluate three assembly strategies: direct multiplication according to Equation (1), a logarithmic formulation, Mν(z)=exp⁡{(1−ν)log⁡2−log⁡Γ(ν)+νlog⁡z+log⁡Kν(z)},(36)\begin{equation} \label{eq:baseline-log} M_\nu(z)=\exp\bigl\{(1-\nu)\log 2-\log\Gamma(\nu) +\nu\log z+\log K_\nu(z)\bigr\}, \end{equation} \qquad(36) and, for implementations providing the exponentially scaled Bessel function ezKν(z)e^zK_\nu(z), the representation Mν(z)=eF/2[ezKν(z)]eF/2,(37)\begin{equation} \label{eq:baseline-scaled} M_\nu(z)=e^{F/2}\,[e^zK_\nu(z)]\,e^{F/2}, \end{equation} \qquad(37) where F=(1−ν)log⁡2−log⁡Γ(ν)+νlog⁡z−z.\begin{equation*} F=(1-\nu)\log 2-\log\Gamma(\nu)+\nu\log z-z. \end{equation*} The symmetric splitting of FF can reduce precision loss and premature underflow when combining a small exponential prefactor with a large scaled Bessel value, while matching the internal evaluation strategy of Bessels.jl. For each external implementation, we select the assembly that returns a finite result at every point or, failing that, the highest number of finite results, and among these the one with the lowest maximum ULP error, preferring direct multiplication on an exact tie; this provides a conservative accuracy baseline for comparison with libmatern. On the eight benchmark datasets the selection is made separately for each dataset. On the size ladders, for which the accuracy of the external implementations is not evaluated, each external implementation is used in one assembly per interface, selected by the same rule with the eight benchmark datasets of that interface taken together, that is, with the finite results counted and the maximum ULP error taken over all of them. All timings refer to the selected assembly. Despite these assembly strategies, the conversion from KνK_{\nu} to MνM_{\nu} remains a source of error, see Figures A8 and A9.

Two of the baselines have limitations in their tested releases that are not inherent to their underlying algorithms. To avoid attributing these limitations to the algorithms, we additionally evaluate a modified version of each, prepared by us for this study and labelled kaust-modified and boost-modified; the unmodified releases are always reported alongside them. CuBesselK evaluates KνK_\nu by quadrature of an integral representation, where the number of bins sets the number of quadrature terms. The released code is tested with 40 and 128 bins, labelled kaust-40 and kaust-128, on the CPU (as C ports) and on the GPU; in this form it is usable only on a restricted parameter domain. Our variant kaust-modified, also evaluated on both CPU and GPU, differs from the released code in three respects. It uses 128 bins and the adaptive integration interval described by Geng et al. (2025) instead of the fixed interval t∈[0,9]t\in[0,9], and it applies the decimal exponent that the released code accumulates in its forward recurrence after Temme’s series but does not apply. In addition, it evaluates log⁡(cosh⁡μ)\log(\cosh\mu) as |μ|−log⁡2+𝚕𝚘𝚐𝟷𝚙(exp⁡(−2|μ|))|\mu|-\log 2+\texttt{log1p}(\exp(-2|\mu|)), which is mathematically equivalent and avoids the overflow of cosh⁡μ\cosh\mu. For Boost.Math, the CPU baseline is version 1.75.0, which uses long-double intermediates. GPU execution requires version 1.87 or later; the GPU baseline is version 1.87.0, which evaluates in binary64 and replaces KνK_\nu by a four-term Hankel expansion whenever |4ν2−25|/(8z)<ϵ1/4|4\nu^2-25|/(8z)<\epsilon^{1/4} with ϵ=2−52\epsilon=2^{-52}. This shortcut is exact only at ν=2.5\nu=2.5 and loses accuracy close to it (Figure A2); version 1.75.0 does not contain it. Our GPU variant boost-modified calls the unmodified Boost.Math 1.87.0 functions but, wherever the shortcut could apply, computes KνK_\nu from the recurrence Kν=Kν−2+2(ν−1)zKν−1K_\nu=K_{\nu-2}+\frac{2(\nu-1)}{z}K_{\nu-1} instead. Both modifications are part of the benchmark code in the libmatern repository; the CuBesselK changes are applied by a script to the upstream source at commit 94ec9ca (Geng & Abdulah, n.d.), which is downloaded separately, checked against SHA-256 digests and not redistributed.

scipy.special.kv (Virtanen et al., 2020), which wraps Amos’s routine zbesk (Amos, 1986) and is used by the Matern kernel of scikit-learn for ν∉{12,32,52}\nu\notin\{\tfrac12,\tfrac32,\tfrac52\}, was evaluated in the same way on the AMD host, using the C++ code of SciPy 1.18.1 compiled without floating-point contraction, which reproduces SciPy’s values bit for bit. It returns non-finite values on 12.4%12.4\% of the small-zz and 32.7%32.7\% of the large-ν\nu points, has maximum errors of 186186 to 14581458 ULP on the other datasets and is 1.91.9 to 5.15.1 times slower than the fastest external implementation on each dataset; it is therefore not shown in the tables and figures. On the half-integer set, its maximum error of 907907 ULP is below that of the other external implementations (GSL: 12481248 ULP).

4.3 Benchmark datasets

To evaluate numerical accuracy and computational performance across different parameter regimes, we combine broad benchmark datasets with targeted numerical stress tests. The grid and the random datasets cover general regions of the (ν,z)(\nu,z) parameter space, while the remaining datasets examine numerically challenging configurations, including small and large arguments, integer and half-integer orders, large orders, and algorithm-selection boundaries. This combination allows us to assess both general performance and robustness in regions where numerical difficulties may arise (see Table 1).

Table 1: Benchmark datasets for accuracy and performance evaluation. The grid and random datasets provide broad parameter-space coverage, while the remaining datasets target numerical stress cases and algorithm-selection boundaries. All intervals are sampled uniformly, at random unless a grid is stated, and listed values are used exactly. The value zmax(ν)z_{\max}(\nu) is the limit at which MνM_\nu equals the smallest normal binary64 number; it increases from 708.4 at ν=0.5\nu=0.5 to 840.7 at ν=39.5\nu=39.5.
Set NN Parameter range or sampling
Grid 262,144 (ν,z)∈[0.001,20]×[0.001,140](\nu,z)\in[0.001,20]\times[0.001,140] as 512×512512\times512 grid
Random 250,000 (ν,z)∈[0.001,40]2(\nu,z)\in[0.001,40]^2
Small zz 100,000 ν∈[0.001,40]\nu\in[0.001,40], log⁡10z∈[−12,0]\log_{10}z\in[-12,0]
Near-integer ν\nu 100,200 ν=n,n±10−k\nu=n,\ n\pm10^{-k} with n=1,…,40n=1,\ldots,40, k=2,4,…,14k=2,4,\ldots,14; log⁡10z∈[−3,log⁡1040]\log_{10}z\in[-3,\log_{10}40] as 600×167600\times167 grid
Half-integer ν\nu 100,000 ν∈{0.5,1.5,…,39.5}\nu\in\{0.5,1.5,\ldots,39.5\} with 2,500 points each, log⁡10z∈[−3,log⁡10zmax(ν)]\log_{10}z\in[-3,\log_{10}z_{\max}(\nu)]
Large zz 100,000 ν∈[0.001,100]\nu\in[0.001,100], z∈[20,800]z\in[20,800]
Large ν\nu 150,000 log⁡10ν∈[log⁡1020,3]\log_{10}\nu\in[\log_{10}20,\,3], log⁡10(z/ν)∈[−4,1]\log_{10}(z/\nu)\in[-4,1]
Router seams 100,000 4,000 points on router borders, each shifted along one axis by 0,±2j0,\pm2^j ULP, j=1,…,12j=1,\ldots,12

To assess performance scaling with batch size, we evaluate size ladders with N=2aN=2^a, 8≤a≤258\leq a\leq25, using two complementary workloads, see Figure A4 and Table B11. Each ladder size up to 2212^{21} is timed as a single call on its NN points. The sizes from 2222^{22} upwards, whose arrays exceed the last-level cache, are taken from one pass over the first 2252^{25} points in consecutive blocks of 2222^{22}, 2222^{22}, 2232^{23} and 2242^{24} points, with one call per block and the clock read after each block; the cost at size NN is the time for the first NN points divided by NN. The external implementations are timed with the clock read at the same block boundaries. A balanced random mixture of parameter regimes exercises heterogeneous numerical method selection, whereas a homogeneous workload with fixed half-integer order ν=2.5\nu=2.5 evaluates the dedicated polynomial path without method-grouping overhead. The random sampling mixture is specified in Table B5.

4.4 Performance measurement

CPU execution times are measured with CLOCK_MONOTONIC, which is backed by an invariant time-stamp counter on the test systems, on a single thread with two warm-up calls and 25 measured repetitions; the reported costs are medians over these repetitions. Speedups are ratios of these medians. Their spread is given by speedup bounds, the ratios of the lower quartile of the numerator to the upper quartile of the denominator and vice versa; these bounds describe the spread within a run, and differences between runs are given below. The reported SIMD timings include input grouping and output permutation, while the reported library timings include workspace creation in every call. Figure A3 shows the cost with a reused workspace. To provide comparable performance measurements, we distinguish numerical evaluation costs from additional execution and data-transfer overhead and report them separately, see Table 4. For CUDA, we report both kernel execution times measured using GPU events and end-to-end times measured using the host clock, including staging, host–device transfers and kernel launch overhead, again as medians of 25 repetitions after two warm-up calls.

The primary CPU measurements were performed on an AMD EPYC 9454, with an Intel Xeon Platinum 8358 used for additional comparisons. GPU measurements were performed on an NVIDIA A100 80 GB PCIe GPU. The library and the C drivers are compiled with GCC 11.5.0 (-O2 -ffp-contract=fast and per-backend instruction-set flags), the baselines with -march=native -O2 on the measuring host (GCC 11.5.0 for the C ports, g++ 14.2.0 for the C++ baselines), and the CUDA code with nvcc 12.8 (-O2 -arch=sm_80); the complete configuration is given in Table B7. Accuracy and timings of each implementation are obtained with the same executable on the same points. Measurements were conducted on exclusively allocated cluster nodes. All results were computed with libmatern 0.9.5 at commit e370401; later commits of the release change neither the computational sources nor the compiler flags. Each run records its build configuration, environment and SHA-256 digests of all sources. Every point is evaluated independently, by one SIMD lane or one CUDA thread without reductions across points, so its result does not depend on batch composition, order or thread count; the test suite checks this bit for bit. Accordingly, the outputs of all libmatern CPU backends are byte-identical on both CPUs. A repeat of the nine runs at the same commit, on other nodes of the same types, reproduced every accuracy statistic exactly; the median costs of at least 98%98\% of the timing rows on each machine agreed within ±10%\pm10\% (AMD 99.9%99.9\%, Intel 99.6%99.6\%, GPU 98.4%98.4\%, kernel and end-to-end rows). The larger differences occur for very short GPU kernels, in host–device transfers and at a few individual points.

5 Results

5.1 Effect of the mathematical folding

The effect of prefactor folding was evaluated against direct and log-domain covariance assembly in a common scalar binary64 environment. Figure 2 reports median and maximum ULP distance and per-element runtime. Folding matches or reduces both error statistics on nearly all tested sets; direct assembly has a smaller maximum error on the router-seam set. Folded evaluation is faster on nine of the ten sets (the eight datasets of Table 1 and the two size-ladder sets with N=220N=2^{20}).

Fig 2: Effect of incorporating the Matérn prefactor into the scalar Bessel-function formulations. The top row reports the median (left) and maximum (right) ULP distance, and the lower panel the time per covariance evaluation in nanoseconds. Filled circles indicate folded evaluation; triangles and squares denote the unfolded direct and logarithmic-assembly alternatives. Hollow markers denote results over the finite points of a variant that returned non-finite values on some points. All methods were assessed with scalar binary64 arithmetic on the AMD CPU specified in Table B7.

The effect of the Levin–Weniger acceleration differs between CPU and GPU. For AVX-512, acceleration reduces the maximum error on the grid set, with a small decrease in runtime (Figure A6). For CUDA, it does not improve accuracy and has no net effect on runtime (Figure A7). Accordingly, acceleration is retained in the SIMD router, but omitted from the CUDA router.

5.2 Numerical accuracy and non-finite results

Table 2: Pointwise numerical accuracy of the AVX-512 CPU and CUDA A100 implementations on the eight datasets. Entries are the median and maximum absolute ULP distances relative to FLINT-derived high-precision references, calculated by Equation (35). The median factor is taken against the best median among all external implementations; the maximum factor is against the best competitor without non-finite results as described in Table B6. A factor is the ratio of the external to the libmatern value, so values above 1 indicate that libmatern is more accurate. All observations in these datasets produced finite outputs for the two listed backends. Detailed results for the competing CPU and GPU methods are given in Table B8 and Table B9.
AVX-512 CPU CUDA A100
Set median ULP max ULP Factor median ULP max ULP Factor
Grid 1.10 12.5 0.671/0.495 1.22 13.5 1.06/1.60
Random 1.02 21.8 0.759/0.294 1.04 23.9 1.61/1.24
Small zz 0.483 10.4 1.96/201 0.483 7.13 4.14/290
Near-integer ν\nu 0.864 17.7 1.03/0.352 0.861 16.7 2.28/1.46
Half-integer ν\nu 0.600 10.4 1.68/120 0.567 6.96 2.67/191
Large zz 0.707 14.7 1.28/98.7 0.740 21.3 2.10/85.1
Large ν\nu 0.729 25.1 80.1/1032 0.729 25.1 79.9/1268
Router seams 1.06 22.4 0.729/1.01 1.06 65.4 1.57/1.54

CPU and GPU libmatern backends return finite values on all eight datasets. Median ULP distances range from approximately 0.480.48 to 1.221.22 (Table 2), and the largest reported maximum is 65.4 ULP on the router-seam set. Boost achieves smaller median and maximum errors than the AVX-512 implementation on the grid and random sets, a smaller maximum on the near-integer set and a smaller median on the router-seam set. Figure A10 compares CPU runtime and accuracy, while Figure A12 shows the corresponding ULP distributions.

Some competing implementations return non-finite values on the stress datasets. On the 100,000-point small-zz set, the CPU Bessels.jl port returns 11,913 non-finite values and Boost returns 11,856, about 12% of the points; the corresponding counts on the 150,000-point large-ν\nu set are 48,712 and 47,474, i.e. about 32%. Such values propagate into any covariance matrix assembled from them. In their selected assembly, GSL and the modified CuBesselK port return finite outputs throughout these two sets. Table B6 reports the failure counts; Tables B8 and B9 give the accuracy statistics conditional on finite evaluation.

All datasets were also evaluated with the Matérn parameterisation (h,ν,s)(h,\nu,s), z=2νh/sz=\sqrt{2\nu}h/s, which applications pass, using h=zh=z and s=2νs=\sqrt{2\nu} rounded to binary64. The external implementations accept zz only as a single binary64 number, so the argument is rounded before their evaluation, whereas libmatern derives it internally from (h,ν,s)(h,\nu,s) without this rounding. Since Mν(z)M_\nu(z) decays approximately like e−ze^{-z} for large zz, a relative rounding error δ\delta in zz causes a relative error of about zδz\delta in MνM_\nu, regardless of how MνM_\nu is evaluated. Accordingly, Boost, GSL and std::cyl_bessel_k, whose medians differ on the (z,ν)(z,\nu) grid set (0.7400.740, 1.341.34 and 1.391.39 ULP), reach nearly the same median on the (h,ν,s)(h,\nu,s) grid set (12.712.7 to 12.812.8 ULP; Figures A10 and A11).

With the (h,ν,s)(h,\nu,s) interface, the AVX-512 implementation of libmatern is more accurate, in both median and maximum, and faster than all tested external CPU implementations on all eight datasets (Figures A11 and A13); on the GPU, libmatern-cuda is the most accurate and fastest implementation on all eight datasets (Figure A17). The (z,ν)(z,\nu) results above therefore compare the numerical methods, and the (h,ν,s)(h,\nu,s) results the interface that applications call.

5.3 CPU throughput

Table 3: Per-element CPU execution cost for the random ladder and the fixed half-integer size ladder at N=225≈3.4⋅107N=2^{25}\approx 3.4\cdot10^7. All entries are nanoseconds per covariance evaluation for single-threaded execution on the AMD host, measured over four consecutive blocks as described in Section 4.3 and including SIMD grouping and output permutation. The random ladder uses the mixture in Table B5, whereas the half-integer ladder fixes ν=2.5\nu=2.5; the two workloads are evaluated separately. Lower values indicate greater throughput. Entries are medians over 25 repetitions; IQR is the interquartile range in per cent of the median. The speedup bounds of Section 4.4, which pair opposite quartiles of the two implementations, differ from the speedups at N=225N=2^{25} by less than 0.2%0.2\%.
Random ν=2.5\nu=2.5
Method ns/value IQR (%) ns/value IQR (%)
libmatern, scalar 168 0.12 6.49 0.04
libmatern, matched scalar 211 0.02 15.0 0.03
libmatern, matched+FMA 112 0.03 7.69 0.02
libmatern, AVX2 31.8 0.03 2.02 0.07
libmatern, AVX-512 23.7 0.03 1.31 0.15
Bessels.jl-derived, scaled 180 0.01 94.1 0.02
Bessels.jl-derived v0.2.8, scaled 156 0.03 119 0.01
Boost 1.75 948 <<0.01 536 0.01
GSL 2.6 244 0.01 188 0.03
libstdc++ cyl_bessel_k 304 0.05 193 0.03

On the N=225N=2^{25} random ladder, the AVX-512 implementation is 6.6×6.6\times faster than the fastest external baseline, the Bessels.jl v0.2.8 port, and 7.1×7.1\times faster than the scalar libmatern backend (Table 3). Along the 18 ladder sizes, the former speedup ranges from 2.2×2.2\times at N=256N=256 to 6.8×6.8\times at N=216N=2^{16}, with a median of 6.6×6.6\times (Figure A4); across the eight benchmark datasets, it ranges from 3.9×3.9\times (large zz) to 21×21\times (half-integer ν\nu), with a median of 7.5×7.5\times (Figure A10); their speedup bounds (Section 4.4) differ from these values by less than 1%1\%. These figures refer to single-threaded covariance evaluation on synthetic workloads; as the random mixture was designed to cover the routing regions (Table B5), speedups in applications depend on their parameter distribution and batch sizes. For the fixed order ν=2.5\nu=2.5, evaluated by the finite polynomial in Equation (33), the speedup over the fastest external implementation grows from 3.9×3.9\times at N=256N=256 to 72×72\times at N=225N=2^{25}. Batch-size scaling and workspace overhead are reported in Figures A3, A4 and A15. Figure A14 shows thread scaling on the Intel CPU, while the AMD CPU exhibits near-linear scaling without notable deviations.

5.4 GPU kernel and end-to-end performance

Across all eight datasets, the CUDA implementation achieves kernel-level speedups of 1.66×1.66\times to 6.79×6.79\times over the fastest tested external GPU implementations (Table B10; Figure A16). Including host–device transfers reduces these speedups to 1.00×1.00\times–1.81×1.81\times (Table 4), demonstrating that transfer overhead substantially limits end-to-end performance. The kernel cost–accuracy comparisons demonstrate that these performance gains are accompanied by competitive numerical accuracy across the tested datasets (Figure A16). The GPU becomes faster than the AVX-512 CPU implementation at approximately 7,6007{,}600 elements for the random workload (Figure A5) and only at approximately 1.1×1061.1\times10^6 elements for the fixed order ν=2.5\nu=2.5; at the ladder sizes on either side of both crossovers, the interquartile ranges of the GPU and CPU costs do not overlap, so the change in order is resolved by the data. Synchronous transfers perform better for smaller arrays, whereas mapped asynchronous memory becomes advantageous for sufficiently large arrays.

Table 4: CUDA execution cost and speedup of libmatern-cuda for the eight datasets on the NVIDIA A100. Kernel columns report CUDA-event time divided by the number of evaluations; end-to-end columns include host-side staging and host–device transfers. Times are expressed in nanoseconds per evaluated covariance. For each dataset and timing mode, the speedup is calculated against the fastest tested external GPU implementation in that mode; this competitor differs between datasets and, on the grid set, between the kernel and end-to-end columns. End-to-end values use each implementation’s fastest observed transfer strategy. Entries are medians over 25 repetitions; IQR is the interquartile range of the libmatern-cuda times in per cent of the median. The speedup bounds of Section 4.4, which pair opposite quartiles of both implementations, differ from the speedups by at most 0.120.12 (kernel) and 0.020.02 (end-to-end); only those of the grid end-to-end ratio (0.990.99–1.011.01) include parity.
Kernel End-to-end call
Set ns/value IQR (%) speedup ns/value IQR (%) speedup
Grid 0.273 1.4 1.66×\times 3.91 1.2 1.00×\times
Random 0.778 1.6 1.73×\times 4.02 0.4 1.12×\times
Small zz 0.440 2.3 2.07×\times 5.88 1.0 1.06×\times
Near-integer ν\nu 0.531 <<0.1 2.54×\times 6.18 1.0 1.12×\times
Half-integer ν\nu 0.164 <<0.1 5.12×\times 5.59 0.5 1.09×\times
Large zz 0.594 1.7 2.52×\times 6.31 0.9 1.12×\times
Large ν\nu 0.799 1.7 6.79×\times 5.38 1.0 1.81×\times
Router seams 0.471 2.2 1.83×\times 6.67 1.0 1.03×\times

6 Discussion and limitations

The benchmark datasets cover a broad range of numerical regimes, including challenging parameter configurations and algorithm-selection boundaries. This provides a systematic basis for evaluating numerical accuracy and computational performance across the investigated domain. However, the datasets are not necessarily representative of parameter distributions encountered in practical applications, so the observed advantages may differ for application-specific workloads.

While the experiments establish the numerical accuracy and computational performance of individual Matérn covariance evaluations, they do not establish how these results translate to complete Gaussian-process applications. In particular, pointwise covariance accuracy does not necessarily imply numerical stability in covariance-matrix factorisation or subsequent inference. Evaluating these downstream effects, including their dependence on matrix conditioning, remains an important direction for future work.

The effect on the runtime of a likelihood evaluation can be estimated from Table B11. For a non-stationary covariance on an M×MM\times M image, a dense Gaussian likelihood requires about M4/2M^4/2 covariance calculations, and a Cholesky factorisation of about M6/3M^6/3 floating-point operations. With the random-ladder costs in Table 3 and assumed single-core factorisation rates of 30 to 70 GFLOP/s, covariance evaluation accounts for 6767 to 82%82\% of the time at M=23M=23 and 1111 to 23%23\% at M=91M=91 with libmatern, compared with 9393 to 97%97\% and 4646 to 66%66\% with the fastest external implementation; a likelihood evaluation is thus about 4.74.7 to 5.65.6 and 1.61.6 to 2.32.3 times faster. For stationary covariances, only O(M2)O(M^2) values are required, and their evaluation time is negligible.

7 Conclusion

Our results demonstrate that the numerical formulation of the Matérn covariance is itself an important factor in achieving accurate and efficient evaluation. Incorporating the Matérn prefactor directly into the numerical methods reduces intermediate floating-point range restrictions and improves numerical accuracy on nearly all tested datasets, even without SIMD execution. Mathematical reformulation and architecture-specific optimisation thus provide complementary benefits, enabling substantial additional performance gains on SIMD CPUs and CUDA GPUs. The SIMD and CUDA implementations combine competitive or improved numerical accuracy with higher throughput than the tested external implementations on nearly all reported CPU and GPU benchmarks.

Data and Code Availability

The libmatern implementation and the benchmark suite are available at https://github.com/DanielMann27/libmatern. The fixed benchmark arrays and high-precision reference data are archived as described by Mann and Schlather (2026). The run directories behind all reported results are attached to release v0.9.6 (libmatern-0.9.6-runs.tar.gz); make figures and make tables regenerate the figures and tables from them, and make reproduce repeats the benchmarks (Table B13).

Acknowledgements

The authors acknowledge support by the state of Baden-Württemberg through bwHPC and thank Guido Moerkotte for discussions and suggestions.

Competing interests

The authors develop libmatern. They declare no financial competing interests.

AI Disclosure

Generative AI tools were used to assist with language and copy-editing, literature searches, code development and debugging, data analysis, and the generation and refinement of manuscript text. All AI-assisted content, including code, analyses, scientific statements, and references, was critically reviewed and verified by the authors, who take full responsibility for the accuracy and integrity of the final work.

A Additional figures

Fig A1: Numerical domain decomposition for the Bessels.jl main branch (a) and v0.2.8 (b) with logarithmic axes. Colours and patterns denote the numerical formulations selected by each implementation, and the curves indicate changes of algorithm. The Power series region uses an approach based on Equation (4). Marks on the ν\nu axis show isolated orders with a dedicated path: in (a) the Temme series at integer ν≤25\nu\le25 for z≤1.5z\le1.5 (ticks); in (b) the half-integer closed form for every zz (ticks above the axis) and the up-recurrence from K0,K1K_0,K_1 at integer ν\nu below the large-order and large-argument regions (triangles). The marks are drawn shortened for visual clarity. These partitions are properties of the cited implementations and are not the final routing boundaries used by libmatern.
Fig A2: Effect of the Boost implementation and evaluation strategy on the relative error of Kν(z)K_{\nu}(z) near ν=2.5\nu=2.5. The panels compare the host CPU implementation in long-double precision (boost, version 1.87.0), the GPU implementation in double precision (boost-gpu), and the modified GPU implementation using the recurrence rule (boost-gpu-modified). The curves correspond to different offsets δ\delta from ν=2.5\nu=2.5, including the exact half-integer case δ=0\delta=0. The dashed reference marks 1/21/2 ULP, while the labelled horizontal lines in the first two panels indicate the respective shortcut caps. Both axes are logarithmically scaled. Results were obtained on the A100 GPU using the setup described in Table B7.
Fig A3: Effect of the workspace allocation on the runtime of the library backends as a function of the batch length NN for the random data (Section 4.3). The left panel shows the cost per element for increasing NN. For AVX2 and AVX-512, solid lines include the allocation of a new workspace and dotted lines reuse an existing one; the other backends use no workspace. The right panel shows the workspace-allocation time as a percentage of the total runtime of a first call. The horizontal dashed line marks 1%1\%, and circles indicate the first NN for which the allocation share falls below this threshold. Results were obtained on the AMD CPU using the setup described in Table B7.
Fig A4: CPU evaluation cost as a function of batch length NN for the random size ladder. The random ladder samples the parameter regions according to Table B5. The ordinate reports nanoseconds per covariance evaluation and the abscissa the batch length NN, timed as described in Section 4.3; both axes are logarithmic. The scalar backend (not shown, 116 to 168 ns) lies between or close to the two Bessels.jl curves, and Boost (893 to 952 ns) lies above the plotted range; their costs at N=225N=2^{25} are given in Table 3. SIMD batch grouping and permutation are included in the timed calls. Results were obtained on the AMD CPU described in Table B7.
Fig A5: Effect of GPU transfer strategy on runtime as a function of the set size NN. The panel shows the cost per element for the tested transfer strategies as NN increases, together with the AVX-512 CPU implementation on the same node for reference. The dashed vertical line marks the approximate set size at which the GPU becomes faster than the AVX-512 implementation on the same node. Results were obtained on the A100 GPU using the setup described in Table B7.
Fig A6: Positive effect of Levin routing on the accuracy and runtime of the AVX-512 implementation. The panels show results when (z,ν)(z,\nu) are supplied: the median ULP error (top left), the worst-case ULP error (top right) and the runtime cost per element (bottom left) for the benchmark datasets on which Levin routing can affect the result. Circles denote results with Levin routing and squares results without it. The annotated factors, which give the ratio of the value without Levin routing to that with Levin routing, are all close to or above 1. Measurements were obtained on the AMD CPU using the setup described in Table B7.
Fig A7: Negative effect of Levin routing on the accuracy and runtime of the CUDA implementation. The panels show results when (z,ν)(z,\nu) are supplied: the median ULP error (top left), the worst-case ULP error (top right) and the runtime cost per element (bottom left) for the benchmark datasets on which Levin routing can affect the result. Circles denote results with Levin routing and squares results without it. The annotated factors, which give the ratio of the value without Levin routing to that with Levin routing, are all close to or below 1. Measurements were obtained on the A100 GPU using the setup described in Table B7.
Fig A8: Dependence of the maximum ULP error on the covariance-assembly strategy for the CPU implementations. The four panels correspond to selected (z,ν)(z,\nu) test sets using a logarithmic ULP scale. For each external implementation, the bars represent direct multiplication in Equation (1), log-domain assembly in Equation (36), and the scaled form in Equation (37). The scaled assembly in Equation (37) is shown only for Bessels.jl and GSL, which are the only implementations that provide the exponentially scaled function exp⁡(z)Kν(z)\exp(z)K_{\nu}(z). The dashed vermillion line reports the error of the folded libmatern implementation and a square marks an assembly that returned non-finite values on some points. Measurements use the AMD CPU in Table B7.
Fig A9: Dependence of the maximum ULP error on the covariance-assembly strategy for the CUDA baseline implementations on the NVIDIA A100. The panels correspond to four selected (z,ν)(z,\nu) datasets using a logarithmic ULP scale. Bars distinguish direct evaluation according to Equation (1) from log-domain assembly according to Equation (36), while the dashed vermillion line reports the error of libmatern-cuda. A square marks an assembly that returned non-finite values on some points. Unlike the CPU comparison in Figure A8, only the direct and logarithmic assemblies are evaluated here, for every baseline, since none of the tested CUDA implementations provides the exponentially scaled function ezKν(z)e^zK_\nu(z). Furthermore, GSL and Bessels.jl are only available on the CPU, so these two libraries do not appear in this figure. The experimental environment is listed in Table B7.
Fig A10: Overview of runtime and accuracy for the (z,ν)(z,\nu) datasets. Each panel compares the implementations by runtime, measured in nanoseconds per element, and accuracy, measured by the median and maximum ULP distance. Each implementation is a marker at its median, connected by a vertical line to its maximum; for example, in the grid panel, the AVX-512 implementation (vermillion circle) has a median of 1.101.10 and a maximum of 12.512.5 ULP at 20.120.1 ns per element. Both axes use a logarithmic scale. For implementations producing non-finite results, the median is boxed and the counts are as given by Table B6. Medians and maxima above 10610^6 ULP are drawn in the hatched band. The kaust-40 port is not drawn: its maximum error exceeds 10610^6 ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
Fig A11: Overview of runtime and accuracy for the (h,ν,s)(h,\nu,s) datasets. Cf. Figure A10 for the (z,ν)(z,\nu) interface and Section 5.2. Each panel compares the implementations by runtime, measured in nanoseconds per element, and accuracy, measured by the median and maximum ULP distance. Both axes use a logarithmic scale. For implementations producing non-finite results, the median is boxed and the counts are as given by Table B6. Medians and maxima above 10610^6 ULP are drawn in the hatched band. The kaust-40 port is not drawn: its maximum error exceeds 10610^6 ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
Fig A12: Distribution of ULP errors for the tested implementations across the (z,ν)(z,\nu) datasets. Each panel shows the ULP-distance distribution for one dataset on a logarithmic scale; the median, interquartile range, whiskers, outlier reach, and maximum are identified in the legend. An outlined square around the median indicates that the implementation produced non-finite results for some inputs as given by Table B6; these values are excluded from the ULP summary statistics. Values exceeding the upper plotting limit of 10610^6 ULP are indicated in the hatched region. The kaust-40 port is not drawn: its maximum error exceeds 10610^6 ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
Fig A13: Distribution of ULP errors for the tested implementations across the (h,ν,s)(h,\nu,s) datasets. Cf. Figure A12 for the (z,ν)(z,\nu) interface and Section 5.2. Each panel shows the ULP-distance distribution for one dataset on a logarithmic scale; the median, interquartile range, whiskers, outlier reach, and maximum are identified in the legend. An outlined square around the median indicates that the implementation produced non-finite results for some inputs as given by Table B6; these values are excluded from the ULP summary statistics. Values exceeding the upper plotting limit of 10610^6 ULP are indicated in the hatched region. The kaust-40 port is not drawn: its maximum error exceeds 10610^6 ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
Fig A14: Thread-scaling behaviour of the tested implementations. The top row shows, from left to right, the speedup relative to one thread and the parallel efficiency, while the bottom left illustrates the throughput in covariance values per second as the number of threads increases. The grey dashed line indicates ideal scaling; solid lines denote library backends and dashed lines external implementations. The scalar and matched+FMA backends (not shown) scale like the drawn implementations, with speedups of 61.7 and 59.4 at 64 threads, and their throughput lies between those of the matched and AVX2 backends. Results were obtained on the Intel CPU using the setup described in Table B7.
Fig A15: Runtime scaling with the set size NN for the fixed order ν=2.5\nu=2.5. The plot compares the drawn implementations by runtime cost, measured in nanoseconds per element, as a function of NN. The scalar backend (not shown, 5.9 to 6.5 ns) lies slightly below the matched+FMA curve, and Boost (517 to 538 ns) lies above the plotted range; their costs at N=225N=2^{25} are given in Table 3. Results were obtained on the AMD CPU using the setup described in Table B7.
Fig A16: Overview of GPU kernel cost and accuracy for the (z,ν)(z,\nu) datasets. Each panel compares the tested implementations by kernel cost, measured in nanoseconds per element, and accuracy, summarised by the median and maximum ULP distance. The panels are read as in Figure A10. Both axes are logarithmically scaled. Non-finite points are excluded from the ULP summary statistics, cf. Table B6. Medians and maxima above 10610^6 ULP are drawn in the hatched band. Results were obtained on the A100 GPU using the setup described in Table B7.
Fig A17: Overview of GPU kernel cost and accuracy for the (h,ν,s)(h,\nu,s) datasets. Cf. Figure A16 for the (z,ν)(z,\nu) interface and Section 5.2. Each panel compares the tested implementations by kernel cost, measured in nanoseconds per element, and accuracy, summarised by the median and maximum ULP distance. Both axes are logarithmically scaled. Non-finite points are excluded from the ULP summary statistics, cf. Table B6. Medians and maxima above 10610^6 ULP are drawn in the hatched band. Results were obtained on the A100 GPU using the setup described in Table B7.

B Additional tables

Table B1: Truncation limits of the series, transformations and iterations used by the numerical methods. Each limit is the largest number of terms, coefficients or steps evaluated; the large-zz series, the Temme series and both continued-fraction loops can stop earlier by the conditions in Table B2.
Method Equation Truncated expansion Maximum used
Large-zz series (34) ∑ktk\sum_k t_k 50 terms
Levin–Weniger transform (16) order kk k=14k=14 (s0,…,s14s_0,\dots,s_{14})
Large-ν\nu series (24) ∑k(−1)kUk(p)/νk\sum_k (-1)^kU_k(p)/\nu^k 11 terms
Stirling series of log⁡Γ(ν)\log\Gamma(\nu) (23) 112ν−1360ν3+⋯\frac1{12\nu}-\frac1{360\nu^3}+\cdots 4 terms
Temme series (7) ∑kckfk\sum_k c_kf_k and ∑kckhk\sum_k c_kh_k 20 terms
Series for γ1\gamma_1, γ2\gamma_2 (9) power series in α2\alpha^2 11 terms each
Continued fraction, IνI_\nu series (3) ∑mam\sum_m a_m,∑mbm\sum_m b_m 50 terms
Continued fraction, modified Lentz (12) K⁡m=1k\mathop{\mathrm K}_{m=1}^{k} 50 steps
Table B2: Early exit conditions for the different implementations. Here ϵ=2−52\epsilon=2^{-52}. In the scalar and CUDA implementations each loop ends at the first kk that satisfies its condition, or at the limit in Table B1; in the SIMD implementations the large-zz condition is tested after every eighth term, and a loop ends when the condition has held in all lanes of a vector (for the continued fraction, of four vectors), each lane being frozen at the first kk that satisfies its condition.
Loop Term Partial sum or approximant Exit condition
Large-zz series tkt_k, (15) sk=∑j=0ktjs_k=\sum_{j=0}^{k}t_j |tk|≤ϵ|sk||t_k|\le\epsilon\,|s_k|
Continued fraction, IνI_\nu series ama_m, (27) Bm=∑j=0majB_m=\sum_{j=0}^{m}a_j |am|≤ϵ|Bm||a_m|\le\epsilon\,|B_m|
Continued fraction, modified Lentz step kk of (12) Lk=K⁡m=1kν2−(2m−1)2/42(z+m)L_k=\mathop{\mathrm K}_{m=1}^{k}\frac{\nu^2-(2m-1)^2/4}{2(z+m)} |Lk/Lk−1−1|≤ϵ|L_k/L_{k-1}-1|\le\epsilon
Temme series ckfkc_kf_k, (7) Vk=∑j=0kcjfjV_k=\sum_{j=0}^{k}c_jf_j |ckfk|<ϵ|Vk||c_kf_k|<\epsilon\,|V_k|
Table B3: Per-point branching of the normalised Matérn covariance in the scalar, SIMD and CUDA versions. Shaded cells mark where the versions differ. All versions apply row 1 to every point; they differ in how often they calculate the constants of Equation (33), the coefficients c0,…,cpc_0,\dots,c_p. The scalar version calculates them once for each sequence of consecutive points with equal ν\nu. The SIMD version scans the batch from its start and calculates them once per order ν\nu for each sequence of at least 256 consecutive points with equal ν\nu, or with half-integer ν\nu, or reaching the end of the batch; after the first shorter sequence the remaining points pass through rows 1–9, which compute them once per order in each tile of the routing. At vector width 1 the SIMD version keeps the constants of the last order. CUDA stores the coefficients for all orders in constant memory. Truncation limits and early exit conditions are given by Table B1 and Table B2, respectively.
The sequence of branches (per point, z=2νh/sz=\sqrt{2\nu}\,h/s) scalar SIMD CUDA
1 if ν=p+12,p≤pmax\nu=p+\tfrac12,\ p\le p_{\max} return Half-integer, Eq. (33) pmax=40p_{\max}=40 pmax=29p_{\max}=29 pmax=29p_{\max}=29
2 if z>zmax=708.396z>z_{\max}=708.396 same
3 if ν<30\nu<30 return folded Large zz, Eq. (34)
4 else return Large ν\nu, Eq. (24) same
5 if ν≤30∧z>min⁡(ν2/36+18,22)\nu\le 30\land z>\min(\nu^2/36+18,\,22) return Large zz, Eq. (14) same
6 if z<1∧ν≤νSz<1\land\nu\le\nu_S return Temme, Eq. (29) νS=30\nu_S=30 νS=26\nu_S=26 νS=26\nu_S=26
7 if z<1∨ν≥30z<1\lor\nu\ge 30 return Large ν\nu, Eq. (24) same
8 if ν≤15∧z>ν4/2401+1.5\nu\le 15\land z>\nu^4/2401+1.5 return Levin, Eq. (18) off on off
9 return Fractions, Eq. (28) same
Table B4: Numbers of high-precision reference covariances whose correctly rounded binary64 values are zero or subnormal for the large-argument, large-order and router-seam datasets. A reference is subnormal for 2−1075<M<2−10222^{-1075}<M<2^{-1022}, a band of width 53ln⁡2≈36.753\ln2\approx36.7 in ln⁡M\ln M, and zero only for M≤2−1075M\le2^{-1075}; the ratio of the two counts therefore reflects how far a dataset extends beyond the underflow threshold rather than how rare each case is. The large-zz set ends at z=800z=800, so exact zeros occur only for ν≲12\nu\lesssim12, whereas subnormal references occur up to ν≈23.5\nu\approx23.5. The large-ν\nu set reaches z≈9,600z\approx9{,}600, far beyond the threshold, so exact zeros dominate. All subnormal router-seam references lie on the exponential-range border z=708.396z=708.396 with ν<1/2\nu<1/2, where MM falls just below 2−10222^{-1022}; the seam shifts of at most 4096 ULP of the argument, i.e. at most 5⋅10−105\cdot10^{-10} in zz, are far smaller than the increase of about 37 in zz needed to reach the zero range. The categories are mutually exclusive and refer to reference values rather than evaluated algorithm outputs. No such reference values were recorded for the other primary benchmark sets. The ULP metric is defined in Equation (35).
Dataset Reference exactly zero Subnormal reference
Large zz 432 901
Large ν\nu 6,483 257
Router seams 0 5,875
Table B5: Probability mixture used to generate the random size ladder. The order ν\nu and the argument zz are sampled independently. For each axis, the distribution component in the middle column is chosen using the probability given in the final column, followed by sampling within the specified interval. The mixture increases coverage of the numerical routing regions; it was not fitted to observed spatial covariance parameters.
Axis Distribution component Weight
ν\nu Log-uniform [10−10,15)[10^{-10},15) 0.50
ν\nu Uniform [15,30)[15,30) 0.30
ν\nu Uniform [30,40][30,40] 0.20
zz Log-uniform [10−10,1)[10^{-10},1) 0.25
zz Log-uniform [1,22)[1,22) 0.50
zz Log-uniform [22,40][22,40] 0.25
Table B6: Counts of non-finite outputs returned by the listed CPU and CUDA benchmark implementations. Only sampling schemes with non-zero failure counts for at least one implementation are displayed, namely small zz (N=100,000N=100{,}000), large zz (N=100,000N=100{,}000) and large ν\nu (N=150,000N=150{,}000). Non-finite results do not contribute to the conditional ULP statistics in Table B8 and Table B9.
Implementation Small zz Large zz Large ν\nu
CPU implementations
libmatern AVX-512 0 0 0
bessels.jl 11,913 0 48,712
bessels.jl-old 11,973 0 48,712
Boost 1.75.0 11,856 0 47,474
GSL 2.6 0 0 0
kaust-128 0 21,076 86,860
kaust-40 0 21,076 86,860
kaust-modified 0 0 0
std::cyl_bessel_k 11,856 0 47,474
GPU implementations
libmatern-cuda 0 0 0
Boost GPU 11,856 0 47,474
Boost GPU modified 11,856 0 47,474
kaust-128 0 21,076 86,860
kaust-40 0 21,076 86,860
kaust-modified 0 0 0
Table B7: Reported compute environments and timing configurations.
Aspect CPU measurements GPU measurements
Processors AMD EPYC 9454 (also Intel Xeon Platinum 8358 for comparison) Intel Xeon Platinum 8358 host
GPU — NVIDIA A100 80 GB PCIe, sm_80
Library build GCC 11.5.0 (RHEL gcc-11.5.0-5.el9_5); -O2 -ffp-contract=fast -fno-math-errno; per backend -mavx512f -mavx512dq -mfma (AVX-512), -mavx2 -mfma (AVX2), -march=x86-64 (matched, with -mfma for matched+FMA) nvcc 12.8.61; -O2 -arch=sm_80; default FMA contraction; host g++ 14.2.0
Baseline build -march=native -O2 (GCC’s default floating-point contraction); GCC 11.5.0 (C ports), g++ 14.2.0 (C++) nvcc 12.8.61, as above
CUDA toolkit — CUDA 12.8.0; nvcc 12.8.61, cudart 12.8.57
GPU driver/API — 615.71.09 / 13.4
OS / libc RHEL 9.6, kernel 5.14.0, glibc 2.34 (glibc-2.34-168.el9_6.25) glibc 2.34
Source libmatern 0.9.5, commit e370401 libmatern 0.9.5, commit e370401
Examples of baselines Boost 1.75.0, GSL 2.6 Boost GPU 1.87.0, CuBesselK ports
CPU threading Single thread for primary throughput Single thread for host-side work (except pinned-ring experiment)
Timing 2 warm-ups; 25 measured repetitions; invariant TSC 2 warm-ups; host-clock calls and CUDA-event kernels separately
Table B8: Median and maximum ULP distances for the CPU implementations across the eight (z,ν)(z,\nu) test sets, measured on the AMD host. Each cell reports median / maximum error with regard to the FLINT reference defined in Equation (35); the eight datasets are divided into two blocks for legibility. “Cap” indicates that the reported maximum exceeds the 10610^6 ULP plotting threshold. A dagger identifies a statistic conditioned on finite outputs; corresponding failure counts are given in Table B6. The median factor is taken against the best external median over all implementations; the maximum factor against the best competitor without dagger and Cap, with the name of this best competitor given. A factor is the ratio of the external to the libmatern value, so values below 1 indicate that the external implementation is more accurate.
Implementation Grid Random Small zz Near-int ν\nu
libmatern (AVX-512) 1.10 / 12.5 1.02 / 21.8 0.483 / 10.4 0.864 / 17.7
bessels.jl 22.0 / 6804 2.96 / 886 1.00 / 1740†\dagger 5.09 / 3.77×1043.77\times10^{4}
bessels.jl-old 2.31 / 7209 22.4 / 1.51×1041.51\times10^{4} 57.0 / 1740†\dagger 24.2 / Cap
boost-1.75.0 0.740 / 6.18 0.773 / 6.43 0.947 / 6.72†\dagger 0.893 / 6.22
gsl-2.6 1.34 / 25.8 1.80 / 114 64.0 / 2283 2.35 / 749
kaust-128 30.5 / 3754 7.45 / Cap 5.94 / Cap 4.69 / Cap
kaust-40 2.15×10132.15\times10^{13} / Cap 4.26×10104.26\times10^{10} / Cap 6.34 / Cap 1.05×1041.05\times10^{4} / Cap
kaust-modified 17.1 / 315 8.53 / 277 64.0 / 2090 4.71 / 325
std-cyl_bessel_k 1.39 / 3799 21.1 / 2647 4.28 / 131†\dagger 5.08 / Cap
Lowest external boost boost boost/
kaust-mod.
boost
Factor 0.671/0.495 0.759/0.294 1.96/201 1.03/0.352
Implementation Half-int ν\nu Large zz Large ν\nu Seams
libmatern (AVX-512) 0.600 / 10.4 0.707 / 14.7 0.729 / 25.1 1.06 / 22.4
bessels.jl 40.9 / 1413 125 / 1542 177 / 1.81×1041.81\times10^{4}†\dagger 2.49 / 1.26×1041.26\times10^{4}
bessels.jl-old 44.6 / 1539 165 / 3020 186 / 1.81×1041.81\times10^{4}†\dagger 3.21 / 9218
boost-1.75.0 1.01 / Cap 0.905 / Cap 160 / Cap†\dagger 0.770 / 22.6
gsl-2.6 38.3 / 1248 124 / 1447 392 / Cap 13.5 / 1060
kaust-128 7.71 / Cap 2.75×10112.75\times10^{11} / Cap†\dagger 58.4 / Cap†\dagger 6.15 / Cap
kaust-40 2.06×1082.06\times10^{8} / Cap 2.35×10152.35\times10^{15} / Cap†\dagger 1.04×10131.04\times10^{13} / Cap†\dagger 4.63×1084.63\times10^{8} / Cap
kaust-modified 44.3 / 1398 167 / 2045 342 / 2.59×1042.59\times10^{4} 5.61 / 974
std-cyl_bessel_k 3.17 / Cap 2.13 / Cap 160 / Cap†\dagger 2.53 / 2906
Lowest external boost/
gsl
boost/
gsl
kaust-128/
kaust-mod.
boost
Factor 1.68/120 1.28/98.7 80.1/1032 0.729/1.01
Table B9: Median and maximum ULP distances for the CUDA implementations on the NVIDIA A100 across the eight (z,ν)(z,\nu) benchmark sets. Cells report median / maximum distance. The notation “Cap” denotes a maximum above the 10610^6 ULP display range, and a dagger indicates that non-finite results were excluded from the reported conditional statistics. Finite-result coverage is given separately in Table B6. The median factor is taken against the best external median over all implementations; the maximum factor against the best competitor without dagger and Cap, with the name of this best competitor given.
Kernel Grid Random Small zz Near-int ν\nu
libmatern-cuda 1.22 / 13.5 1.04 / 23.9 0.483 / 7.13 0.861 / 16.7
boost 20.7 / 4.48×1054.48\times10^{5} 19.2 / Cap 2.00 / 21.8†\dagger 1.96 / 24.4
boost-modified 1.29 / 21.6 1.67 / 29.7 2.00 / 21.8†\dagger 1.96 / 24.4
kaust-128 26.0 / 3897 7.43 / Cap 5.83 / Cap 4.70 / Cap
kaust-40 2.15×10132.15\times10^{13} / Cap 4.26×10104.26\times10^{10} / Cap 6.25 / Cap 1.05×1041.05\times10^{4} / Cap
kaust-modified 17.2 / 260 8.47 / 277 59.8 / 2070 4.72 / 321
Lowest external boost-mod. boost-mod. boost/
kaust-mod.
boost
Factor 1.06/1.60 1.61/1.24 4.14/290 2.28/1.46
Kernel Half-int ν\nu Large zz Large ν\nu Seams
libmatern-cuda 0.567 / 6.96 0.740 / 21.3 0.729 / 25.1 1.06 / 65.4
boost 1.52 / Cap 1.55 / Cap 148 / Cap†\dagger 1.66 / 1371
boost-modified 1.52 / Cap 1.55 / Cap 148 / Cap†\dagger 1.66 / 101
kaust-128 7.61 / Cap 2.75×10112.75\times10^{11} / Cap†\dagger 58.2 / Cap†\dagger 6.03 / Cap
kaust-40 2.06×1082.06\times10^{8} / Cap 2.35×10152.35\times10^{15} / Cap†\dagger 1.04×10131.04\times10^{13} / Cap†\dagger 4.63×1084.63\times10^{8} / Cap
kaust-modified 42.1 / 1327 158 / 1812 329 / 3.19×1043.19\times10^{4} 5.55 / 994
Lowest external boost/
kaust-mod.
boost-mod./
kaust-mod.
kaust-128/
kaust-mod.
boost-mod.
Factor 2.67/191 2.10/85.1 79.9/1268 1.57/1.54
Table B10: Kernel-only GPU evaluation time for the (z,ν)(z,\nu) input interface on the eight benchmark datasets. Each cell gives the measured nanoseconds per covariance value for the specified CUDA implementation; this timing excludes CPU staging and host–device transfers. The last row reports the runtime of the fastest external implementation on the same dataset divided by that of libmatern-cuda. Measurements were obtained with the NVIDIA A100 system described in Table B7; end-to-end costs are reported separately in Table 4. Entries are medians over 25 repetitions; the last column gives the largest interquartile range over the eight datasets in per cent of the median. The speedup bounds of Section 4.4 differ from the speedups by at most 0.120.12.
Implementation Grid Random Small zz Near-int ν\nu Half-int ν\nu Large zz Large ν\nu Seams max IQR (%\%)
libmatern-cuda 0.273 0.778 0.440 0.531 0.164 0.594 0.799 0.471 2.3
boost 0.453 1.35 0.911 1.56 0.860 1.58 12.5 0.860 4.6
boost-modified 0.602 1.52 0.963 1.35 0.840 1.50 13.7 0.881 1.4
kaust-128 7.54 7.95 8.83 8.22 8.41 8.16 10.8 8.17 1.1
kaust-40 2.47 2.65 3.47 2.84 2.93 2.69 5.43 2.76 1.5
kaust-modified 11.3 18.8 17.4 13.8 19.1 18.8 22.8 12.5 1.2
Speedup vs. fastest external 1.66×\times 1.73×\times 2.07×\times 2.54×\times 5.12×\times 2.52×\times 6.79×\times 1.83×\times
Table B11: The second column gives the approximate minimal number of Matérn evaluations to calculate the full covariance matrix as a function of the image size MM of an M×MM \times M image for three different geostatistical setups. It also gives MM for typical values of NN that are used in this paper.
Setup Evaluations N=225≈3.4⋅107N=2^{25}\approx3.4\cdot 10^7 N=217≈1.3⋅105N=2^{17}\approx1.3\cdot10^5 N=28=256N=2^8=256
Non-stationary N≈M42N\approx\frac{M^4}{2} M≈91M\approx91 23 5
Anisotropic, stationary N≈2M2N\approx2M^2 M≈4096M\approx4096 256 11
Isotropic, stationary N≈M22N\approx\frac{M^2}{2} M≈8192M\approx8192 512 23
Table B12: Upstream versions of the baselines and of the reference library, and the packages used in the reported runs. Full commit hashes and SHA-256 digests of all downloaded sources and archives are recorded in the references/ directory of the libmatern repository.
Baseline Upstream version Used in the reported runs
CuBesselK commit 94ec9ca (2025-03-17); no tagged release logbesselk.cu, logbesselk.h at this commit, ported by script
Bessels.jl, main branch commit 009b615 (2026-06-30), version 0.3.0-DEV C port
Bessels.jl, v0.2.8 release v0.2.8 (2023-01-28), commit 1475e9e C port
Boost.Math (CPU) 1.75.0; Boost.Math a0a97b7 RHEL boost-devel-1.75.0-11.el9_6
Boost.Math (GPU) 1.87.0; Boost.Math f1b0b95 module lib/boost/1.87.0
GSL 2.6 (2019-08-20), tag release-2-6 (8f0165f) RHEL gsl-2.6-7.el9
libstdc++ GCC 14.2.0 (2024-08-01), 04696df module compiler/gnu/14.2
SciPy 1.18.1 (xsf headers, PyPI source distribution) C++ compiled, -ffp-contract=off
FLINT/Arb 3.1.0 reference data (Mann & Schlather, 2026)
Table B13: Generated files behind the tables and figures. make figures and make tables, run in the libmatern source tree with the run directories of release v0.9.6, write them to plots/paper-final/ and tables/paper/; A and I denote the subdirectories epyc-9454 (AMD CPU) and xeon-platinum-8358 (Intel CPU and A100). The figures and tables of this version are generated by the code of release v0.9.6 from these run directories. The versions in this paper can differ in caption, cropping and styling.
Paper Generated file Command
Fig. 1, A1 routing/fig-paper-domain-backends, routing/fig-paper-domain-bessels make figures
Fig. 2 A/fig-paper-fold-z_nu make figures
Fig. A2 I/fig-paper-gpu-boost-shortcut make figures
Fig. A3 A/fig-paper-workspace-size_random_large-z_nu make figures
Fig. A4, A15 A/fig-paper-ladder-size_{random,half}_large-z_nu make figures
Fig. A5 I/fig-paper-gpu-modes-size_random_large-z_nu (upper panel) make figures
Fig. A6, A7 A/fig-paper-levin-cpu-avx512-z_nu, I/fig-paper-levin-cuda-async-direct-z_nu make figures
Fig. A8, A9 A/fig-paper-assembly-z_nu, I/fig-paper-gpu-assembly-z_nu make figures
Fig. A10, A11 A/fig-paper-cost-accuracy-{z_nu,h_nu_s}-call make figures
Fig. A12, A13 A/fig-paper-accuracy-distribution-{z_nu,h_nu_s} make figures
Fig. A14 I/fig-paper-threads-z_nu make figures
Fig. A16, A17 I/fig-paper-gpu-plane-{z_nu,h_nu_s} make figures
Table 1 tab-datasets make tables
Tables 2, B8, B9 tab-medmax-z_nu, I/tab-gpu-medmax-z_nu make tables
Table 3 A/tab-throughput-z_nu make tables
Table 4 I/tab-gpu-summary-z_nu make tables
Table B4 tab-references make tables
Table B6 tab-exclusions-z_nu, I/tab-gpu-exclusions-z_nu make tables
Table B7 tab-environment make tables
Table B10 I/tab-gpu-cost-z_nu, I/tab-gpu-call-z_nu make tables
Tables B1–B3, B5, B11, B12 — (source code, configuration and references/) —

References

  • Amos, D. E. (1986). Algorithm 644: A portable package for Bessel functions of a complex argument and nonnegative order. ACM Transactions on Mathematical Software, 12(3), 265–273. https://doi.org/10.1145/7921.214331 ↩
  • Bahg, G., Evans, D. G., Galdo, M., & Turner, B. M. (2020). Gaussian process linking functions for mind, brain, and behavior. Proceedings of the National Academy of Sciences, 117(47), 29398–29406. https://doi.org/10.1073/pnas.1912342117 ↩
  • Boost Developers. (n.d.). Boost.Math: Mathematical special functions and numerical algorithms. https://github.com/boostorg/math.
  • Chaudhuri, S., Barceló, M. A., Juan, P., Varga, D., Bolin, D., Rue, H., & Saez, M. (2025). Enhanced spatial modeling on linear networks using Gaussian Whittle-Matérn fields. Stochastic Environmental Research and Risk Assessment, 39(3), 1143–1158. https://doi.org/10.1007/s00477-025-02912-6 ↩
  • Cuyt, A. A. M., Petersen, V. B., Verdonk, B., Waadeland, H., & Jones, W. B. (2008). Handbook of continued fractions for special functions. Springer. https://doi.org/10.1007/978-1-4020-6949-9 ↩
  • GCC Development Team. (n.d.). The GNU C++ library (libstdc++). https://gcc.gnu.org/onlinedocs/libstdc++/.
  • Geng, Z., & Abdulah, S. (n.d.). CuBesselK: GPU-acceleration of modified Bessel function of the second kind. https://github.com/stsds/CuBesselK/tree/94ec9ca4bb9d7524c196f044503519ab30d8eb39.
  • Geng, Z., Abdulah, S., Sun, Y., Ltaief, H., Keyes, D. E., & Genton, M. G. (2025). GPU-Accelerated Modified Bessel Function of the Second Kind for Gaussian Processes. ISC High Performance 2025 Research Paper Proceedings (40th International Conference), 1–12. https://doi.org/10.23919/isc.2025.11018305 ↩
  • GSL Development Team. (n.d.). GNU Scientific Library (GSL): Source code repository. https://savannah.gnu.org/projects/gsl/.
  • Jaquier, N., Borovitskiy, V., Smolensky, A., Terenin, A., Asfour, T., & Rozo, L. (2022). Geometry-aware Bayesian optimization in robotics using Riemannian Matérn kernels. In A. Faust, D. Hsu, & G. Neumann (Eds.), Proceedings of the 5th Conference on Robot Learning (Vol. 164, pp. 794–805). PMLR. https://proceedings.mlr.press/v164/jaquier22a.html ↩
  • Johansson, F. (2017). Arb: Efficient Arbitrary-Precision Midpoint-Radius Interval Arithmetic. IEEE Transactions on Computers, 66(8), 1281–1292. https://doi.org/10.1109/tc.2017.2690633 ↩
  • JuliaMath. (n.d.-a). Bessels.jl: Numerical computation of Bessel functions in julia. https://github.com/JuliaMath/Bessels.jl/tree/009b615347d91d1dd69962641647521901362af3.
  • JuliaMath. (n.d.-b). Bessels.jl: Numerical computation of Bessel functions in julia. https://github.com/JuliaMath/Bessels.jl/tree/v0.2.8.
  • Mann, D., & Schlather, M. (2026). Reference high precision datasets for the Matérn covariance function [Dataset]. Zenodo. https://doi.org/10.5281/ZENODO.23393956 ↩
  • Muller, J.-M., Brunie, N., Dinechin, F. de, Jeannerod, C.-P., Joldes, M., Lefèvre, V., Melquiond, G., Revol, N., & Torres, S. (2018). Handbook of floating-point arithmetic (2nd ed.). Birkhäuser. https://doi.org/10.1007/978-3-319-76526-6 ↩
  • NIST Digital Library of Mathematical Functions. (n.d.-a). Asymptotic Expansions for Large Argument. https://dlmf.nist.gov/10.40.2.
  • NIST Digital Library of Mathematical Functions. (n.d.-b). Asymptotic Expansions for Large Order. https://dlmf.nist.gov/10.41.4.
  • NIST Digital Library of Mathematical Functions. (n.d.-c). Connection Formulas for Modified Bessel Functions. https://dlmf.nist.gov/10.27.E4.
  • NIST Digital Library of Mathematical Functions. (n.d.-d). Continued Fractions for Modified Bessel Functions. https://dlmf.nist.gov/10.33.
  • NIST Digital Library of Mathematical Functions. (n.d.-e). Definitions for Modified Bessel Functions. https://dlmf.nist.gov/10.25.E2.
  • NIST Digital Library of Mathematical Functions. (n.d.-f). Levin-Weniger Transformation. http://dlmf.nist.gov/3.9.E16.
  • NIST Digital Library of Mathematical Functions. (n.d.-g). Recurrence Relations and Derivatives for Modified Bessel Functions. https://dlmf.nist.gov/10.29.i.
  • Stein, M. L. (2005). Nonstationary spatial covariance functions (Technical Report No. 21). Center for Integrating Statistical and Environmental Science, University of Chicago. https://websites.umich.edu/jizhu/jizhu/covar/Stein-Summary.pdf ↩
  • Temme, N. M. (1975). On the numerical evaluation of the modified bessel function of the third kind. Journal of Computational Physics, 19(3), 324–337. https://doi.org/10.1016/0021-9991(75)90082-0 ↩
  • The FLINT team. (2026). FLINT: Fast Library for Number Theory [Version 3.1.0]. https://flintlib.org ↩
  • Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., van der Walt, S. J., Brett, M., Wilson, J., Millman, K. J., Mayorov, N., Nelson, A. R. J., Jones, E., Kern, R., Larson, E., … Vázquez-Baeza, Y. (2020). SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3), 261–272. https://doi.org/10.1038/s41592-019-0686-2 ↩
  • Weniger, E. J. (1989). Nonlinear sequence transformations for the acceleration of convergence and the summation of divergent series. Computer Physics Reports, 10(5-6), 189–371. https://doi.org/10.1016/0167-7977(89)90011-7 ↩ 1 2

Cite this article

Mann, D., Ehrhardt, M., & Schlather, M. (2026). libmatern: Fast and Accurate Matérn Covariance Evaluation on SIMD CPUs and CUDA GPUs. Journal of Reproducible Statistics, 1, 13. https://doi.org/10.68365/jrepstat.2026.13

doi: https://doi.org/10.68365/jrepstat.2026.13

Downloads

PDF ePub JATS XML .bib .ris .csl.json Reproducibility package (.zip) 0fc58c951434214cf49082b56f6efb93c656f249cb20d3aa68d3fdcabc96168a

https://doi.org/10.68365/jrepstat.2026.13 also supports content negotiation, so reference managers can fetch the citation from the DOI directly. The exports above work without it.