• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stillwater-sc / universal / 39065550828
89%
master: 84%

Build:
Build:
LAST BUILD BRANCH: fix/issue-2132-rational-exact-saturating
DEFAULT BRANCH: master
Ran 17 Oct 2026 08:28PM UTC
Jobs 1
Files 741
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Oct 2026 08:09PM UTC coverage: 86.827% (+0.05%) from 86.781%
39065550828

push

github

web-flow
feat(lindex): correctly rounded math library with exact exp/log (#1349 part 5) (#1716)

include/sw/universal/number/lindex/mathlib.hpp and math/:

- exp and log of a value >= 1 are exact steps of one level on the
  encoded l + f (e^phi(x) = phi(x + 1), ln phi(x) = phi(x - 1))
- sqrt, cbrt, pow, exp2, exp10, log2, log10, expm1, log1p and hypot
  compose level-index operations on unrounded psi points and round once:
  a root is 1 + psi(phi(x - 1) / n), pow is e^(y ln x), hypot squares,
  sums and roots in the psi domain, so no intermediate is ever formed
- classify, min/max/fmin/fmax, nextafter, floor/ceil/trunc/round
- domain errors (log 0, log of a negative, sqrt of a negative, log1p of
  -1 and below, pow of a negative base) are NaR

The arithmetic helpers become public psi-domain building blocks:
add/sub/mul/div_points, up/down_a_level, and round_psi, which rounds a
composed result once with the working-precision retry.

That retry gains a last stage: a dd_cascade result within 2^-90 of a
midpoint is evaluated again in qd_cascade. Operands one ulp from 1/2,
1 or a level boundary have results with exact rational leading terms
(e^(2^-60) = 1 + 2^-60 + 2^-121) that land within ~2^-122 of a
midpoint, past dd_cascade's resolution. Without the stage, 3 of 196
such lindex<64,3> arithmetic pairs misround, e.g.
(1/2 - 2^-60) * (1 + 2^-60) gave 1/2, and so do sqrt(1 - 2^-60) and
sqrt of the encoding one ulp above level 2. #1695's arithmetic shipped
with that gap; the 196 pairs are now oracle vectors and the design doc
is corrected.

qd_cascade/math/functions/logarithm.hpp reports its domain errors as
std::log does (errno = EDOM and a NaN) instead of through std::cerr,
as dd_cascade's does since #1694, so the lindex core stays I/O-free.

Tests: static/logarithmic/lindex/math/correct_rounding.cpp compares
encodings for equality against tools/generators/lindex_math_gen.py
(mpmath, 600 bits, level-down identities cross-checked against direct
evaluation): every li... (continued)

239 of 242 new or added lines in 11 files covered. (98.76%)

1 existing line in 1 file now uncovered.

50079 of 57677 relevant lines covered (86.83%)

10382770.91 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
83.33
include/sw/universal/number/lindex/math/constants.hpp
1
90.0
include/sw/universal/number/lindex/math/minmax.hpp

Coverage Regressions

Lines Coverage ∆ File
1
96.31
-0.06% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 39065550828.1 17 Oct 2026 08:28PM UTC 741
86.83
GitHub Action Run
Source Files on build 39065550828
  • Tree
  • List 741
  • Changed 5
  • Source Changed 2
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39065550828
  • 98b4e138 on github
  • Prev Build on main (#39061751147)
  • Next Build on main (#39071690840)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc