Repository navigation
crnumerics 0.3.0
New: crdist (dist/), the inverse error functions and the standard normal quantile in binary32, correctly rounded to nearest on every input: crdist_erfinvf, crdist_erfcinvf and crdist_probitf (probit is R's qnorm and SciPy's ndtri). We know of no other correctly rounded implementation: CORE-MATH and RLIBM have no inverse of erf. With a counter-based random number generator, inverse-CDF sampling through crdist gives the same normal draws on every machine.
Each is computed in binary64 from polynomials and CORE-MATH's correctly rounded log, within 2^-50 of the exact value, and rounded once to binary32 when that cannot go two ways. The 118 inputs where it can come from a table, made with MPFR from all 2^32 inputs of each function. On x86-64 and aarch64, every input of each function was checked against MPFR, with none differing, and the 2^-50 bound was checked on every input as well. A call takes 36 to 54 ns an element on a laptop's Ryzen 5. Every call runs in the default floating-point environment and restores the caller's, so neither the rounding mode nor flush-to-zero can change a result.
make builds build/libcrdist.a and libcrdist.so (the header is dist/crdist.h); like crsum and crnn, crdist is not part of make install yet. make check runs a sampled check; make crdist-check-all checks every input (2.5 hours on 64 threads of an x86-64 server).
ival, crsum, crnn and lowp are unchanged: ival's results and exported functions are 0.2.2's, and its soname is still libival.so.0.