arXiv:2609.37844math.NASep 2026

Manuscript Offprint

arXiv:2609.37844

Running error bounds in finite element kernels

Michal Habera, Paul T. Kühner, Matteo Croci, Andreas Zilian

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

PREPRINT

Michal HABERA

Department of Engineering

University of Luxembourg

michal.habera@uni.lu

Paul T. KÜHNER

Department of Engineering

University of Luxembourg

paul.kuehner@uni.lu

Matteo CROCI

Basque Center for Applied Mathematics

Ikerbasque

University of the Basque Country

mcroci@bcamath.org

Andreas ZILIAN

Department of Engineering

University of Luxembourg

andreas.zilian@uni.lu

September 2026

ABSTRACT

Rounding errors in finite element computations can lead to a complete loss of accuracy, stalled convergence, and incorrect results. Moreover, the effects of rounding errors accumulated within automatically generated and compiled kernels are difficult to analyze a priori. We present the first software framework for automated rounding error estimation within finite element kernels. The proposed methodology is based on an a posteriori technique called Running Error Analysis (REA), where a forward error estimate is automatically computed concurrently with the value. An open-source implementation is provided for the FEniCS Form Compiler (FFCx), based on a C++ backend for generating type-generic templated kernels over a custom arithmetic type that tracks both the value and its error estimate.

We demonstrate REA on two examples. First, we use it to detect catastrophic cancellation in the assembly of a Neo-Hooke hyperelastic model in the small deformation regime. A series expansion circumvents the cancellation problem and the computed error estimates show this. Second, we study the assembly of the Laplace operator on a near-degenerate mesh. We demonstrate that our REA implementation typically incurs only 2-4x performance overhead. Applications of this work include robust reduced-precision computations in embedded systems, numerical debugging of new, possibly ill-conditioned or unstable PDE formulations, and guiding the design of mixed-precision kernels.

Keywords Catastrophic Cancellation, Finite Element Method, Reduced Precision Computing, Rounding Error, Running Error Analysis

1 Introduction

Rounding errors can limit the accuracy of finite element computations and stall the convergence of iterative solvers. Estimating the magnitude of these errors is crucial when using lower-precision arithmetic, but the effects of rounding errors accumulated within automatically generated and compiled kernels are difficult to analyze a priori. In this work, we present a method for automated rounding error estimation in the assembly of finite element operators. We propose a software framework that combines code generation, i.e., the translation of the mathematical description of Partial Differential Equations (PDEs) to a lower-level programming language (Kirby and Logg, 2006; Alnæs et al., 2014), with running error analysis (REA) for a posteriori rounding error bounds, see Wilkinson (1986, § 3) and Higham (2002, § 3.3). The resulting algorithm automatically computes rounding error bounds alongside the assembled values and reveals accuracy loss due to numerical instability and ill-conditioning, with modest overhead in most of the tested cases.

PREPRINT

Double precision was available from the dawn of the computer Finite Element Method (FEM) in the 1960s, but memory constraints encouraged single precision storage (Melosh and Palacol, 1969). The IEEE single- and double-precision arithmetic became widely supported in hardware during the late 1980s and 1990s (Higham and Mary, 2022, § 2), making the 64-bit arithmetic increasingly practical. As a consequence, double precision became the conservative default in many engineering finite element software packages.

This conservatism can be justified when rounding errors limit the accuracy of constitutive evaluations or the convergence of iterative solvers. In solid mechanics, for example, evaluating finite-strain constitutive models near the undeformed state can involve cancellation, as illustrated by the Neo-Hooke example in Section 4. Contact algorithms (Wriggers, 2006, Ch. 10) and non-smooth, multi-surface plasticity algorithms (Simo, Kennedy, and Govindjee, 1988; Simo and Hughes, 1998) also use contact gaps and yield-function values to determine which constraints are active. Rounding errors near activation thresholds can alter these decisions. In addition, industrial CAD geometries may lead to ill-shaped elements and poorly conditioned element-local operators (Shewchuk, 2002, § 3), increasing sensitivity to rounding errors. Higher working precision can reduce these errors and help keep them below the tolerances required by the simulation.

The development of Artificial Intelligence (AI) and Large Language Models (LLMs) is shaping the landscape of available hardware and the numerical formats it supports (Jouppi et al., 2017; Micikevicius et al., 2022). In particular, double precision is not prioritized by AI hardware manufacturers, and developers and researchers wanting to harness the latest hardware capabilities are forced to adapt their algorithms to lower-precision computations. The result is a wide range of reduced- and mixed-precision algorithms, which leverage the performance gains of low-precision computations while controlling rounding error accumulation. We refer to the review articles of Abdelfattah et al. (2021) and Higham and Mary (2022) for an overview of existing methods. The advantage of using lower precision is that these formats favor not only the applications with high arithmetic intensity (Williams, Waterman, and Patterson, 2009), but also applications that are memory bandwidth bound, due to improved memory traffic utilization.

Overall, the rounding error behaviour in a typical finite element industrial simulation is complex, and we only try to address a small part of it in this work.

Rounding error detection in numerical software This complexity motivates the use of automated tools to assess how rounding errors propagate through numerical software. The estimation of rounding errors in a program is addressed by an extensive list of libraries. Based on the technique that these tools follow, one can distinguish the following approaches.

Dynamic local-error propagation techniques augment each floating-point operation so that it returns a pair (f^,ef)(\hat{f}, e_f) of the computed value and an estimate of its accumulated error, and update efe_f after each operation. The local rounding error can be estimated from a floating-point model or computed using error-free transformations or higher-precision values, see subsections below. Examples include CENA (Braconnier and Langlois, 2002; Hovland and Hückelheim, 2021), Shaman (Demeure et al., 2022), EFTSanitizer (Chowdhary and Nagarakatte, 2022), Accurate Residues (He and Panchekha, 2026), ADAPT (Menon et al., 2018), CHEF_FP (Singh et al., 2023), ATOMU (Zou et al., 2020), and FPCC (Yi et al., 2024). Advantages are that this approach provides error information for intermediate operations, computation happens alongside values in one execution, and error-free transformations can be used to avoid expensive high-precision arithmetic. Disadvantages are the additional arithmetic and storage overhead, potentially overestimated errors for unsigned bounds, and the requirement to implement special rules for every relevant operation.

High-precision shadow execution methods evaluate the floating-point program twice: once for the floating-point value f^\hat{f}, and once for a higher-precision reference value freff_{ref}. The difference f^−fref\hat{f} - f_{ref} is then used as an estimate of the accumulated error. Examples include FPDebug (Benz, Hildebrandt, and Hack, 2012), FPSanitizer and PFPSanitizer (Chowdhary, Lim, and Nagarakatte, 2020; Chowdhary and Nagarakatte, 2021), NSan (Courbet, 2021), Herbgrind (Sanchez-Stern et al., 2018), and SHVAL (Lam and Rountree, 2016). Advantages include a directly interpretable, signed difference between the computed value and reference, and no need for first-order error-propagation approximations. On the other hand, high-precision arithmetic and shadow storage can be expensive, in particular when precision is emulated. The reference still has rounding errors and can itself suffer numerical instability.

Stochastic methods repeatedly evaluate the program while randomly perturbing rounding decisions or mantissas. The outcomes are used to estimate variance, confidence intervals, or numerical instabilities. These methods are implemented in CADNA (Jézéquel and Chesneaux, 2008), Verificarlo (Denis, Oliveira Castro, and Petit, 2016), VERROU (Févotte and Lathuilière, 2016), and SAM (Graillat et al., 2011). These approaches provide additional statistical information such as variability, significant digits, and confidence intervals. Unfortunately, conclusions depend on the perturbation model and statistical assumptions, and multiple samples add cost.

PREPRINT

For a more extensive list of libraries see FPTalks (2026). The same page lists many additional libraries classified as static. These tools perform rounding error analysis prior to the execution of the code, so they are more similar to an a priori error analysis and fall outside the scope of the current work. Their main advantage is the possibility of proving bounds over a specified input domain before execution.

Among tools based on dynamic local-error propagation, Shaman (Demeure et al., 2022) provides debugging features such as attribution of errors to their sources and detection of unstable branches, together with broad integration into C++ software. Instead, our framework specifically focuses on finite element assembly through generated FEniCSx kernels and Python/NumPy, with support for half precision and both approximate worst-case bounds and signed error estimates.

Rounding errors in the finite element method Existing literature on the effects of rounding errors in FE kernels is scarce. The first studies were conducted by Melosh and Palacol (1969), Melosh (1973), and Utku and Melosh (1984). In these studies the focus is on the entire process of obtaining an FE solution, including the conditioning and factorization of the structural system. Moreover, the problems are limited to structural systems with stiffness and mass matrices.

On the other hand, there is a larger amount of literature on rounding errors in the solution of linear systems arising from FEM (Babuška, Szabó, and Katz, 1981; Fried, 1986; Alvarez-Aramberri et al., 2012; Babuška and Söderlind, 2018; Liu, Möller, and Schuttelaars, 2021). Some specific areas that are part of the FE kernel evaluation have also received attention. For example, the stable and efficient way of interpolating polynomials using barycentric interpolation is known, see Higham (2004), Berrut and Trefethen (2004), and Laughton et al. (2022). Stability and interpolation accuracy, especially for high-order polynomials, are also studied in Brubeck et al. (2025).

Perhaps the only reference that studies rounding errors in FE kernels, including reference basis evaluation, geometry evaluation, construction of gradient transformations, quadrature accumulation, and local-to-global assembly, is Croci and Wells (2024). However, Croci and Wells (2024) provide theoretical a priori rounding error bounds while the current work focuses on practical a posteriori rounding error estimates.

Main contributions The main contributions of this paper are as follows.

  1. We present the first software framework for automated a posteriori rounding error estimation of FE computations.

  2. We implement a custom C++ data type, running_error_t, and integrate it with templated kernels generated by the FEniCS Form Compiler (FFCx) and the FEniCSx assemblers. The type computes rounding error estimates alongside the values in two modes: “worst” for running error bounds, and “exact” for tighter signed error estimates based on higher-precision arithmetic and error-free transformations. In the Neo-Hooke benchmarks, the slowdown is at most 3.5×3.5 \times relative to plain assembly in most tested cases, making the estimates practical for diagnosing rounding errors in FE kernels.

  3. We demonstrate that both error modes detect the numerical instability of a naïve Neo-Hooke strain energy evaluation in the small-deformation regime, despite the bounded condition number of the underlying problem. Both modes also capture the improved accuracy obtained with a stable implementation using a series expansion.

  4. We show that the error estimates capture the growth of rounding errors when assembling a Laplace operator on a mesh with near-degenerate, needle-like triangles. The estimates reflect the asymptotic scaling predicted by conditioning arguments: the “worst” mode captures worst-case growth, while the “exact” mode also captures milder growth arising from cancellations between roundoffs.

Paper outline Section 2 introduces the floating-point model and notation and derives running error bounds and alternative signed error estimates. Section 3 describes their implementation in automatically generated FE kernels. Section 4 presents the Neo-Hooke and near-degenerate-mesh examples, including conditioning analyses, comparisons of the error estimates, and performance measurements.

References (63)