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 observation sites of a non-stationary process requires covariance evaluations. Although matrix factorisation may entail 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 by a Gamma-normalised power. General-purpose special-function implementations usually evaluate 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 . 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 and as where denotes the Gamma function and the modified Bessel function of the second kind. The dimensionless argument separates the statistical parameterisation from the evaluation of the numerical kernel. For marginal variance , spatial scale and smoothness , the Whittle–Matérn parameterisation is where is the Euclidean distance between two observation sites. The Matérn parameterisation sets and the Handcock–Wallis parameterisation defines .
At , the normalised covariance is defined by continuity. For , the small-argument behaviour is Thus and is a correlation function. For sufficiently small or large , the factor may underflow while becomes very large, even though the product in Equation (1) is within . 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 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) and For integer , we have since for . Hence, both the numerator and the sine in Equation (2) vanish as . For non-integer , substitution of Equation (3) gives Euler’s reflection formula and the Gamma-function recurrence formula imply where is the so-called rising factorial. Consequently, This representation separates the dominant powers of , but direct evaluation becomes poorly conditioned near integer orders because one of the separate terms contains a factor proportional to .
Temme’s series avoids this near-integer cancellation (Temme, 1975). For general positive order, write The modified Bessel recurrence (NIST Digital Library of Mathematical Functions, n.d.-g) recovers the required order from and . The latter can be represented by the coupled Temme series with Let . Then, the first coefficient is where the Gamma-function combinations are where is the Euler–Mascheroni constant and denotes the Riemann zeta function. The starting terms for the two auxiliary sequences are The removable singularities at in the initialisation are evaluated by their limits. For these sequences and the Temme coefficients satisfy
Another representation follows from the Wronskian identity With , this gives The ratio can be evaluated through the continued-fraction representation (NIST Digital Library of Mathematical Functions, n.d.-d) where the continued-fraction operator uses the standard nested-fraction notation (Cuyt et al., 2008):
For half-integer orders , , the Bessel function has the finite representation
Also, two asymptotic regimes are used. For large argument at fixed order , the Poincaré expansion (NIST Digital Library of Mathematical Functions, n.d.-a) is The truncated expansion can be accelerated by a factorial Levin–Weniger transformation (NIST Digital Library of Mathematical Functions, n.d.-f). Let and define the partial sums and the exact scaled function by The series is generally divergent for finite , and is therefore interpreted as an asymptotic approximant. Levin-type transformations model the truncation error through a remainder estimate . For a fixed remainder estimate , the factorial model (Weniger, 1989) assumes for the consecutive indices , where is a fixed parameter and are unknown coefficients that may depend on , and but not on . These equations determine the coefficients together with , and the transformation derived below solves them for without computing the . Since the ratio generally has an infinite expansion in the inverse Pochhammer symbols , truncating it after 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 transformation (Weniger, 1989). Multiplication by gives Since the right-hand side is a polynomial in of degree at most , its th forward difference vanishes. Applying yields Since the do not depend on , they enter only as constant coefficients of terms whose th forward difference is zero, and therefore do not appear in this equation. Solving the transformed approximation gives where The weights in Equation (17) follow by expanding the forward differences, , and cancelling the common sign and normalisation. Thus, the corresponding approximation of the unscaled Bessel function is Our implementation uses the weights of Equation (17) for and as stored constants. For , the numerator and denominator can be evaluated by Weniger’s difference-table recurrence. The transformation requires for and a nonzero denominator in Equation (16). Its accuracy depends on the remainder model and the numerical conditioning of the transformed sums. We use . Note that, at half-integer order , the factor in Equation (15) vanishes at , so for all and the series terminates. The remaining terms are , so the partial sum coincides term by term with the finite representation in Equation (13) and is exact. Since the remainder estimates then vanish for , the transformation in Equation (16) is undefined, and the implementation returns unchanged.
An ansatz for large order with fixed ratio is the uniform expansion (NIST Digital Library of Mathematical Functions, n.d.-b), where The Debye polynomials are defined by and
2.3 Incorporation of the Matérn prefactor
2.3.1 Large-order formulation
Substituting Equation (19) into Equation (1) gives Since , the exponent in Equation (21) becomes The Stirling expansion delivers Substituting into Equation (22) yields It follows that with and
2.3.2 Continued-fraction formulation
The Wronskian representation in Equation (11) requires , and the ratio . Let Then, The normalised series and have the initial terms and recurrences Substituting Equation (25) and Equation (26) into Equation (11) gives where is given by Equation (12).
2.3.3 Temme formulation
Let where is defined by continuity at . Equation (6) delivers Let Using in Equation (7), the initial values are The second summand in Equation (30) is written as the product of and so that and . For in Equation (32), we have and is evaluated by means of the right-hand side. Starting from in Equation (31) and above, the recurrences are The resulting value is for ; for , is given directly by Equation (31).
2.3.4 Half-integer orders
For , the identity together with Equations (13) and (1) yields We have and the recurrence formula
2.3.5 Large-argument formulation
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 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 . The boundary marks where becomes subnormal; above it, the folded form Equation (34) (and Equation (24) for ) combines all factors in one exponent. Below the large-argument region multiplies Equation (14) by the separately computed prefactor ; for this cannot overflow, and only for is the intermediate already subnormal. The Levin band of the SIMD router is evaluated in the same way from Equation (18).
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 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 . 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 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 , 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 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 , signed zeros yield , while as . Returning preserves the unit diagonal of normalised covariance matrices. A clamp of the results of the general methods to , which also returns a non-finite intermediate result as , 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 and a high-precision reference represented by , the ULP distance is calculated as where denotes the C standard library function that returns the binary64 number adjacent to in the direction of , so that the denominator is the gap between and the next larger binary64 number, i.e. one ULP at the reference value. For reference values below , quantisation of can introduce an uncertainty of up to 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 . 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 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 to the Matérn covariance, we evaluate three assembly strategies: direct multiplication according to Equation (1), a logarithmic formulation, and, for implementations providing the exponentially scaled Bessel function , the representation where The symmetric splitting of 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 to 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 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 , 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 as , which is mathematically equivalent and avoids the overflow of . 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 by a four-term Hankel expansion whenever with . This shortcut is exact only at 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 from the recurrence 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 , 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 of the small- and of the large- points, has maximum errors of to ULP on the other datasets and is to 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 ULP is below that of the other external implementations (GSL: 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 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).
| Set | Parameter range or sampling | |
|---|---|---|
| Grid | 262,144 | as grid |
| Random | 250,000 | |
| Small | 100,000 | , |
| Near-integer | 100,200 | with , ; as grid |
| Half-integer | 100,000 | with 2,500 points each, |
| Large | 100,000 | , |
| Large | 150,000 | , |
| Router seams | 100,000 | 4,000 points on router borders, each shifted along one axis by ULP, |
To assess performance scaling with batch size, we evaluate size ladders with , , using two complementary workloads, see Figure A4 and Table B11. Each ladder size up to is timed as a single call on its points. The sizes from upwards, whose arrays exceed the last-level cache, are taken from one pass over the first points in consecutive blocks of , , and points, with one call per block and the clock read after each block; the cost at size is the time for the first points divided by . 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 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 of the timing rows on each machine agreed within (AMD , Intel , GPU , 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 ).
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
| 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 | 0.483 | 10.4 | 1.96/201 | 0.483 | 7.13 | 4.14/290 |
| Near-integer | 0.864 | 17.7 | 1.03/0.352 | 0.861 | 16.7 | 2.28/1.46 |
| Half-integer | 0.600 | 10.4 | 1.68/120 | 0.567 | 6.96 | 2.67/191 |
| Large | 0.707 | 14.7 | 1.28/98.7 | 0.740 | 21.3 | 2.10/85.1 |
| Large | 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 to (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- 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- 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 , , which applications pass, using and rounded to binary64. The external implementations accept only as a single binary64 number, so the argument is rounded before their evaluation, whereas libmatern derives it internally from without this rounding. Since decays approximately like for large , a relative rounding error in causes a relative error of about in , regardless of how is evaluated. Accordingly, Boost, GSL and std::cyl_bessel_k, whose medians differ on the grid set (, and ULP), reach nearly the same median on the grid set ( to ULP; Figures A10 and A11).
With the 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 results above therefore compare the numerical methods, and the results the interface that applications call.
5.3 CPU throughput
| Random | ||||
|---|---|---|---|---|
| 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 random ladder, the AVX-512 implementation is faster than the fastest external baseline, the Bessels.jl v0.2.8 port, and faster than the scalar libmatern backend (Table 3). Along the 18 ladder sizes, the former speedup ranges from at to at , with a median of (Figure A4); across the eight benchmark datasets, it ranges from (large ) to (half-integer ), with a median of (Figure A10); their speedup bounds (Section 4.4) differ from these values by less than . 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 , evaluated by the finite polynomial in Equation (33), the speedup over the fastest external implementation grows from at to at . 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 to over the fastest tested external GPU implementations (Table B10; Figure A16). Including host–device transfers reduces these speedups to – (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 elements for the random workload (Figure A5) and only at approximately elements for the fixed order ; 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.
| Kernel | End-to-end call | |||||
|---|---|---|---|---|---|---|
| Set | ns/value | IQR (%) | speedup | ns/value | IQR (%) | speedup |
| Grid | 0.273 | 1.4 | 1.66 | 3.91 | 1.2 | 1.00 |
| Random | 0.778 | 1.6 | 1.73 | 4.02 | 0.4 | 1.12 |
| Small | 0.440 | 2.3 | 2.07 | 5.88 | 1.0 | 1.06 |
| Near-integer | 0.531 | 0.1 | 2.54 | 6.18 | 1.0 | 1.12 |
| Half-integer | 0.164 | 0.1 | 5.12 | 5.59 | 0.5 | 1.09 |
| Large | 0.594 | 1.7 | 2.52 | 6.31 | 0.9 | 1.12 |
| Large | 0.799 | 1.7 | 6.79 | 5.38 | 1.0 | 1.81 |
| Router seams | 0.471 | 2.2 | 1.83 | 6.67 | 1.0 | 1.03 |
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 image, a dense Gaussian likelihood requires about covariance calculations, and a Cholesky factorisation of about 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 to of the time at and to at with libmatern, compared with to and to with the fastest external implementation; a likelihood evaluation is thus about to and to times faster. For stationary covariances, only 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
libmatern.
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 from , including the exact half-integer case . The dashed reference marks 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.
Bessels.jl and GSL, which are the only implementations that provide the exponentially scaled function . 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.
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 . 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.
kaust-40 port is not drawn: its maximum error exceeds ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
kaust-40 port is not drawn: its maximum error exceeds ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
kaust-40 port is not drawn: its maximum error exceeds ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
kaust-40 port is not drawn: its maximum error exceeds ULP on every dataset. Results were obtained on the AMD CPU using the setup described in Table B7.
B Additional tables
| Method | Equation | Truncated expansion | Maximum used |
|---|---|---|---|
| Large- series | (34) | 50 terms | |
| Levin–Weniger transform | (16) | order | () |
| Large- series | (24) | 11 terms | |
| Stirling series of | (23) | 4 terms | |
| Temme series | (7) | and | 20 terms |
| Series for , | (9) | power series in | 11 terms each |
| Continued fraction, series | (3) | , | 50 terms |
| Continued fraction, modified Lentz | (12) | 50 steps |
| Loop | Term | Partial sum or approximant | Exit condition |
|---|---|---|---|
| Large- series | , (15) | ||
| Continued fraction, series | , (27) | ||
| Continued fraction, modified Lentz | step of (12) | ||
| Temme series | , (7) |
| The sequence of branches (per point, ) | scalar | SIMD | CUDA | |
|---|---|---|---|---|
| 1 | if return Half-integer, Eq. (33) |
|||
| 2 | if |
same | ||
| 3 | if return folded Large , Eq. (34) |
|||
| 4 | else return Large , Eq. (24) |
same | ||
| 5 | if return Large , Eq. (14) |
same | ||
| 6 | if return Temme, Eq. (29) |
|||
| 7 | if return Large , Eq. (24) |
same | ||
| 8 | if return Levin, Eq. (18) |
off | on | off |
| 9 | return Fractions, Eq. (28) |
same | ||
| Dataset | Reference exactly zero | Subnormal reference |
|---|---|---|
| Large | 432 | 901 |
| Large | 6,483 | 257 |
| Router seams | 0 | 5,875 |
| Axis | Distribution component | Weight |
|---|---|---|
| Log-uniform | 0.50 | |
| Uniform | 0.30 | |
| Uniform | 0.20 | |
| Log-uniform | 0.25 | |
| Log-uniform | 0.50 | |
| Log-uniform | 0.25 |
| Implementation | Small | Large | Large |
|---|---|---|---|
| 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 |
| 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 |
| Implementation | Grid | Random | Small | Near-int |
|---|---|---|---|---|
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 | 5.09 / |
bessels.jl-old |
2.31 / 7209 | 22.4 / | 57.0 / 1740 | 24.2 / Cap |
boost-1.75.0 |
0.740 / 6.18 | 0.773 / 6.43 | 0.947 / 6.72 | 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 |
/ Cap | / Cap | 6.34 / Cap | / 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 | 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 | Large | Large | 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 / | 2.49 / |
bessels.jl-old |
44.6 / 1539 | 165 / 3020 | 186 / | 3.21 / 9218 |
boost-1.75.0 |
1.01 / Cap | 0.905 / Cap | 160 / Cap | 0.770 / 22.6 |
gsl-2.6 |
38.3 / 1248 | 124 / 1447 | 392 / Cap | 13.5 / 1060 |
kaust-128 |
7.71 / Cap | / Cap | 58.4 / Cap | 6.15 / Cap |
kaust-40 |
/ Cap | / Cap | / Cap | / Cap |
kaust-modified |
44.3 / 1398 | 167 / 2045 | 342 / | 5.61 / 974 |
std-cyl_bessel_k |
3.17 / Cap | 2.13 / Cap | 160 / Cap | 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 |
| Kernel | Grid | Random | Small | Near-int |
|---|---|---|---|---|
libmatern-cuda |
1.22 / 13.5 | 1.04 / 23.9 | 0.483 / 7.13 | 0.861 / 16.7 |
boost |
20.7 / | 19.2 / Cap | 2.00 / 21.8 | 1.96 / 24.4 |
boost-modified |
1.29 / 21.6 | 1.67 / 29.7 | 2.00 / 21.8 | 1.96 / 24.4 |
kaust-128 |
26.0 / 3897 | 7.43 / Cap | 5.83 / Cap | 4.70 / Cap |
kaust-40 |
/ Cap | / Cap | 6.25 / Cap | / 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 | Large | Large | 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 | 1.66 / 1371 |
boost-modified |
1.52 / Cap | 1.55 / Cap | 148 / Cap | 1.66 / 101 |
kaust-128 |
7.61 / Cap | / Cap | 58.2 / Cap | 6.03 / Cap |
kaust-40 |
/ Cap | / Cap | / Cap | / Cap |
kaust-modified |
42.1 / 1327 | 158 / 1812 | 329 / | 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 |
| Implementation | Grid | Random | Small | Near-int | Half-int | Large | Large | 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 | 1.73 | 2.07 | 2.54 | 5.12 | 2.52 | 6.79 | 1.83 |
| Setup | Evaluations | |||
|---|---|---|---|---|
| Non-stationary | 23 | 5 | ||
| Anisotropic, stationary | 256 | 11 | ||
| Isotropic, stationary | 512 | 23 |
| 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) |
| 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
Mann, Daniel, Matthis Ehrhardt, and Martin Schlather. 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.
Mann D, Ehrhardt M, Schlather M. libmatern: Fast and Accurate Matérn Covariance Evaluation on SIMD CPUs and CUDA GPUs. Journal of Reproducible Statistics. 2026;1:13. doi:10.68365/jrepstat.2026.13
Mann, D., Ehrhardt, M. and Schlather, M. (2026) “libmatern: Fast and Accurate Matérn Covariance Evaluation on SIMD CPUs and CUDA GPUs,” Journal of Reproducible Statistics, 1, p. 13. Available at: https://doi.org/10.68365/jrepstat.2026.13.
doi: https://doi.org/10.68365/jrepstat.2026.13
Downloads
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.