Table of Contents
Fetching ...

Not-Quite-Transcendental Functions For Logarithmic Interpolation of Tabulated Data

Peter C. Hammond, Jacob M. Fields, Jonah M. Miller, Brandon L. Barker

TL;DR

The paper tackles the bottleneck of interpolating tabulated data that spans many orders of magnitude in computational astrophysics by introducing not-quite-transcendental (NQT) transforms as fast, exactly invertible substitutes for logarithms. It develops two families, NQTo1 and the improved NQTo2, where the latter recovers second-order convergence on log-like grids via a $C^1$-continuous form $\lg_{o2}(x)$ and a quadratic-in-mantissa inverse, enabling efficient second-order logarithmic interpolation. Through isolated benchmarks and real EOS lookups, the authors demonstrate that NQTo2 often yields about 2× speedups over true logs on x86 and significant gains on ARM, with smaller improvements on GPUs, while maintaining comparable accuracy except in extreme phase-transition regions. Implemented in open-source packages such as Singularity-EOS and AthenaK, NQT methods provide a practical, portable path to accelerating astrophysical simulations that rely heavily on tabulated microphysics, with the strongest benefits arising from lower-order interpolation schemes.

Abstract

From tabulated nuclear and degenerate equations of state to photon and neutrino opacities, to nuclear reaction rates: tabulated data is ubiquitous in computational astrophysics. The dynamic range that must be covered by these tables typically spans many orders of magnitude. Here we present a novel strategy for accurately and performantly interpolating tabulated data that spans these large dynamic ranges. We demonstrate the efficacy of this strategy in tabulated lookups for nuclear and terrestrial equations of state. We show that this strategy is a faster \textit{drop-in} replacement for linear interpolation of logarithmic grids.

Not-Quite-Transcendental Functions For Logarithmic Interpolation of Tabulated Data

TL;DR

The paper tackles the bottleneck of interpolating tabulated data that spans many orders of magnitude in computational astrophysics by introducing not-quite-transcendental (NQT) transforms as fast, exactly invertible substitutes for logarithms. It develops two families, NQTo1 and the improved NQTo2, where the latter recovers second-order convergence on log-like grids via a -continuous form and a quadratic-in-mantissa inverse, enabling efficient second-order logarithmic interpolation. Through isolated benchmarks and real EOS lookups, the authors demonstrate that NQTo2 often yields about 2× speedups over true logs on x86 and significant gains on ARM, with smaller improvements on GPUs, while maintaining comparable accuracy except in extreme phase-transition regions. Implemented in open-source packages such as Singularity-EOS and AthenaK, NQT methods provide a practical, portable path to accelerating astrophysical simulations that rely heavily on tabulated microphysics, with the strongest benefits arising from lower-order interpolation schemes.

Abstract

From tabulated nuclear and degenerate equations of state to photon and neutrino opacities, to nuclear reaction rates: tabulated data is ubiquitous in computational astrophysics. The dynamic range that must be covered by these tables typically spans many orders of magnitude. Here we present a novel strategy for accurately and performantly interpolating tabulated data that spans these large dynamic ranges. We demonstrate the efficacy of this strategy in tabulated lookups for nuclear and terrestrial equations of state. We show that this strategy is a faster \textit{drop-in} replacement for linear interpolation of logarithmic grids.
Paper Structure (12 sections, 13 equations, 7 figures)

This paper contains 12 sections, 13 equations, 7 figures.

Figures (7)

  • Figure 1: Linear interpolation of a synthetic function $P = 1 + \rho + K_1 \rho^\Gamma_1 + K_2 \rho^\Gamma_2$ on a true log grid (left), first-order NQT grid (center), and second-order NQT grid (right). The x-axis is $\rho$ and the y-axis is the relative error in $P$. On average (in the $L_1$ sense), all interpolants converge at second order, but error spikes near the control points of the NQT gridding converge more slowly. The result is that first-order NQT converges at second order in the $L_1$ norm but slower in the $L_p$ norm for $p>1$. In second-order NQT the spikes also converge at second-order, recovering second-order convergence in higher $p$$L_p$ norms. In all three figures, a dashed horizontal line shows the expected magnitude for second-order convergence.
  • Figure 2: Ratio of performance of standard library provided functions to their NQT counterparts. Bigger is better. Left column is the portable implementation that uses frexp and ldexp and right column is the integer aliased implementation described in Appendix \ref{['sec:integer:aliasing']}. Top row is first-order NQT and bottom row is second-order NQT. In the architecture lists, _intel implies the intel compiler was used. On CPU systems, the gnu compiler was otherwise used and on GPU systems the relevant vendor-provided compiler (here CUDA) was used. spr stands for Sapphire Rapids.
  • Figure 3: Interpolation of the SFHo EOS SFHoEOS as tabulated in the Stellar Collapse database stellarcollapsetables. Left column is the true table, middle is first-order NQT, and right is second-order. Left column shows pressure vs density and temperature at fixed $Y_e=0.1.$ Middle and right columns show relative error compared to the true log interpolant.
  • Figure 4: Interpolation of the tabulated equation of state for Copper in the Sesame database sesamePeterson2012CopperEOS. Left column is the fifth-order rational function interpolant produced by the EOSPAC library PimentelDavidA2021EUMV, which we treat as ground truth. Middle two columns show errors from first- and second-order NQT interpolation respectively, while rightmost column shows error from true log interpolation.
  • Figure 5: Density slice of a three-dimensional neutron star simulated with AthenaK with logarithmic interpolation on the left and second-order NQT on the right.
  • ...and 2 more figures