Skip to content

Portable Extended-Precision Floating-Point Arithmetic for Scientific Computing Kernels

Manas Vishal

cs.MS

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