Skip to content

crmvec 0.11.0: the correctly rounded libm on aarch64 too, and ways to turn it on without changing the operating system.

Choose a tag to compare

@anun333 anun333 released this 06 Oct 01:59
· 25 commits to main since this release

libcrpreload.so on aarch64. CORE-MATH's 76 correctly rounded functions under
the C library's names, now on aarch64 Linux as on x86-64:

crmvec-run --libm ./program

Checked against CORE-MATH on a Neoverse N1: every input of the 33 one-argument
float functions in the four rounding modes and under flush-to-zero, and 2^20
inputs of every function in each mode with and without it. A median of 1.36
times glibc's time per call there.

A cheaper underflow. An underflowing exp, exp2, exp10, erfc or tgamma now
sets errno without testing the exception flag: 19 ns a call, from about 230.
Over a whole FreeSurfer recon-all, the preload costs 13% more than glibc, from
27%, with the same outputs.

Without changing the operating system (docs/lab.md):

  • conda install crmvec-libm turns the correctly rounded math on for every
    program run from that conda environment, and conda remove turns it off
    (once the package is on conda-forge);
  • contrib/modules/ has Lmod and Tcl module files for clusters;
  • crmvec-stamp OUTPUT_DIR, or crmvec-run --stamp, records in a run's outputs
    which math it used.
    docs/evidence.md has the cases we measured where the math library changed a
    program's results.

CORE-MATH updated to e072473: sin.c now builds where a 128-bit integer to
double conversion is missing, and pow.c no longer raises a spurious underflow
flag in directed rounding. The results are the same on 2^24 inputs in each
rounding mode.