Portable Extended-Precision Floating-Point Arithmetic for Scientific Computing Kernels
Abstract
Many scientific computations need more accuracy than IEEE double precision, but arbitrary precision is often too costly on CPUs and GPUs. Multi-float arithmetic fills this gap by representing each value as an unevaluated sum of IEEE numbers. Existing implementations are generally confined to a CPU, CUDA, or language-specific programming model. We present MultiFloats.cpp, a header-only C++17 library that uses Kokkos to compile the same extended-precision kernels for Serial, OpenMP, CUDA, and HIP. The library supports Float64x2 through Float64x4 (106--212 bits) and the corresponding Float32-based types. We evaluate it using seven SHOC-style kernels and compare against QD, CAMPARY, MPFR, and Julia MultiFloats.jl on A100, GH200, and AMD RX 780M systems. On A100, Float64x4 addition sustains 15,700 MOps/s, or 1.5 times CAMPARY; on CPU, vectorized Float64x4 operations are 4.2--6.6 times faster than QD's qdreal. Addition and multiplication produce 0 ULP error over 10,000 inputs, while Float64x4 division and square root remain within 1.71 and 17.9 ULP, respectively. Thus, extended precision can remain practical and portable without separate backend implementations.
Create a lesson
Related papers
Construction and Performance Evaluation of an Arbitrary-Precision Floating-Point Arithmetic Environment on CUDA
Shared title terminology · Tomonori Kouya
Simulation of Custom-Precision OCP MX Block Floating-Point Formats and Arithmetic
Shared title terminology · Maliha Islam, Mantas Mikaitis
Low Precision Fortran -- Enabling Low Precision Floating Point Arithmetic in Modern Fortran
Shared title terminology · Martin Köhler, Peter Benner
Floating-point autotuning with customized precisions
Shared title terminology · Xinye Chen, Fabienne Jézéquel, Thibault Hilaire
Lord of the Precision, the Two Floats: Double-Word Arithmetic for Complex Numbers
Shared title terminology · František Stloukal, Fabienne Jézéquel
The Rise of Low Precision Floating Point
Shared title terminology · Guy Lemieux, Michael L. Overton