Changelog
Source:NEWS.md
zuexact 0.1.0
First release.
Vendors Radford Neal’s ‘xsum’ (stable version 3), patched so that no standard I/O reaches the compiled code; upstream’s checker and fuzzer run against the vendored copy in CI.
A vignette,
vignette("exact-summation"), explains why basesum()differs between platforms and how to sum in pieces and from C.xsum()returns the exactly rounded sum of double, integer, logical and complex vectors, withna.rm, applying the same special-value rules on every platform. ALTREP vectors are read in blocks, never materialised.zuexact_info()reports the vendored ‘xsum’ version, the accumulator threshold, SIMD and FMA support, and whether R has long doubles.xsum_mean()divides the exact sum by the count with one rounding;xsum_weighted_mean()divides two exact sums.xsum_dot(),xsum_sqnorm()andxsum_norm()include each product’s rounding error (TwoProduct withfma()), so dot products are exactly rounded too.xsum_cumsum()rounds every prefix sum exactly.Accumulators as R values:
xsum_acc(),xsum_add(),xsum_merge(),xsum_negate(),xsum_value()andxsum_mean_value()build exact sums in pieces, in any order, and across processes (they serialise).xsum_rowsums(),xsum_colsums()andxsum_by()are exact versions ofrowSums(),colSums()androwsum(). Row sums work a block of rows at a time, so their extra memory does not grow with the number of rows.A registered C interface,
zuexact_api_v1ininst/include/zuexact.h, gives other packages’ C code the same exact accumulators, sums, dot products, merges and means, throughLinkingTo: zuexact.Every result is tested against exact rational arithmetic (‘gmp’),
PreciseSums::fsum(), the test262Math.sumPrecisevectors and ill-conditioned inputs up to condition number 1e40, and must be bit-identical on every CI platform.