arXiv Science⌕ Search

arXiv · 2611.28959

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 qd_real. 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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Manas Vishal. 2026-11-21. Portable Extended-Precision Floating-Point Arithmetic for Scientific Computing Kernels. https://arxiv.science/abs/2611.28959

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Fast matrix multiplication: mixing fast, accurate schemes over a vendor GEMM, chosen by a calibrated planner

Fast matrix multiplication is in practice a few levels of a Strassen-like scheme over a vendor's General Matrix Multiplication (GEMM) routine. We treat each scheme as an operator that takes a problem one level down, and let every level of a plan use a different one. On Apple's M4 Pro, over Accelerate's GEMM, a calibrated planner chooses among accurate forms of the $\langle 2\times2\times2:7\rangle$, $\langle 4\times4\times4:48\rangle$ and $\langle 3\times3\times6:40\rangle$ schemes. A level runs as three fused passes over memory, so its cost is the blocks it moves, not its arithmetic. At $n=13824$ the plans run $1.71\times$ (f32) and $1.88\times$ (f64) faster than Accelerate's GEMM with 0.38 and 0.50 of its error on well-scaled inputs. At 6912 and 13824 they are 5-16% faster than the best plans built from the $\langle 4\times4\times4:48\rangle$ scheme alone, with 0.57-0.75 of their error. The planner's error model predicts a plan's error from where its levels sit (a level's own rounding is multiplied by the levels above it), and the planner uses it to choose between plans of equal speed. A conventional implementation of Strassen-Winograd (one block operation at a time), the algorithm of IBM ESSL's _GEMMS, over the same GEMM is 1.21-1.54 times slower than the plans and has 1.9-9.7 times their error; fused $2\times2$ levels, which the library also has, are level with the $4\times4$ scheme at half the depth. On badly scaled inputs the plans need exact power-of-two prescaling, at up to 4% of the time, and inputs whose magnitudes cross between blocks defeat them. In f32, sharing a level's products with the GPU brings the speedup over Accelerate to $3.1\times$.

cs.MS↗

The involute function and its inverse in IEEE 754 double precision: measured and proved accuracy, and its effect on gear inspection

Almost every spur and helical gear calculation uses the involute function inv(a) = tan(a) - a or its inverse. Near a = 0 the two terms almost cancel: at a = 10^-3 the textbook formula in binary64 keeps about 9 correct digits, and far fewer in binary32, binary16 or fixed point, and the result can depend on the platform's tan. We report the accuracy of a proprietary implementation that avoids these problems. On 50,000 committed test angles the forward function's largest error against an 80-digit reference is 0.4999681 ulp, so every tested result is correctly rounded (measured, not proved). The inverse is proved faithfully rounded, with error at most 0.6 ulp, for 10^-200 <= y < 2, using interval arithmetic and the SMT solvers z3 and cvc5 with a short, named list of trusted inputs; its largest measured error on 50,000 points is 0.5555115 ulp. A separate bracket around the root is proved to contain it for 0 < y <= 10^6, and did so at all 47,083 test points. Both functions return identical bits on x86-64 and aarch64 Linux, Apple-silicon macOS, AWS Lambda and an NVIDIA DGX Spark, in Python and NodeJS, on every finite test input. Against public inverse methods on nine runtimes, our inverse returned the same bits on all of them and stayed within 0.54 ulp on 12,017 targets from 0.5 to 60 degrees, while textbook Newton iterations differed between runtimes on up to about 10% of inputs and kept only 12 correct digits. For external and internal spur gears with 5 to 500 teeth and pressure angles from 14.5 to 30 degrees, all inputs fall inside the tested and proved ranges. Against ISO 1328-1 tolerance classes, we give in micrometres the errors that shortcut inverses cause in pin measurement and centre distance, and how far circular-arc CAD teeth (SolidWorks Toolbox) depart from the involute. Drawing an involute is easy; accuracy matters in inspection.

cs.MS↗

Networktools: A Header-only C++ Library for Network Optimization Problems

Networktools is an open source, header-only C++20 library for graph-based modeling and optimization, with dedicated algorithms and data structures for modeling and solving telecommunications network optimization problems. More precisely, the library provides general purpose graph data structures and algorithms for tasks such as efficient graph traversal, flow computation, matching and connectivity analysis, together with a generic API to linear and mixed integer linear programming solvers. Additionally, a dedicated traffic engineering module provides further specialized data structures and algorithms that can be used to simulate routing, assess how router or IP/optical link failures affect traffic loads, and optimize routing configurations such as link weights and/or segment routing paths.

cs.MS↗