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

stillwater-sc / universal / 37160643253
87%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 03 Oct 2026 11:49PM UTC
Jobs 1
Files 679
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

03 Oct 2026 11:05PM UTC coverage: 86.097% (+0.03%) from 86.069%
37160643253

push

github

web-flow
fix(takum): elementary functions past double's range for rbits 4-5 (#1629)

* fix(takum): elementary functions past double's range for rbits 4-5

At rbits = 4 and 5 a takum spans 2^+/-65535 or 2^+/-2^32 against double's
2^+/-1024, and the math functions evaluate in a double. Three things went
wrong:
- the result leaves double's range: exp(800) is an ordinary takum<32,4>,
  but std::exp overflowed and the takum was NaR;
- the argument leaves double's range: double(2^2000) is infinity, so
  log(2^2000), whose true value is ~1386, came back NaR;
- the argument is tiny: double(2^-2000) is 0, so sin(2^-2000) was 0 and
  floor(-2^-2000) was 0 instead of -1.

New header math/wide_range.hpp builds on two primitives that never leave
double's range. ln_abs(x) is ln|x| as a double-double, taken from the
decoded fields: c ln2 + log1p(f) linear, l/2 logarithmic. from_ln(L) is
the takum whose magnitude is e^L: an integer power of two (or integer
characteristic) plus a bounded remainder a double evaluates, assembled by
the codec from an int64_t characteristic, saturating where the true value
is past the takum's own range.

Covered, for takum and takum_log (71 call sites):
  exp exp2 exp10 expm1, sinh cosh asinh acosh, pow (all overloads)
  log log2 log10 log1p, erf erfc (asymptotic series past x = 26.5),
  hypot and atan2 (common power-of-two scaling; atan2 falls back to y/x
  or +/-pi when the ratio is below 2^-30), trunc round floor ceil frac,
  tiny-argument identities (sin tan asin atan tanh atanh -> x,
  cos sec cosh -> 1, cot csc -> 1/x),
  fmod and remainder, exactly for the linear takum: its values are
  dyadic, so x mod y is reduced with modular exponentiation and
  2^65535 mod 3 costs ~16 squarings.

Each wrapper checks range_fits_double at compile time, so rbits <= 3 is
untouched, and the new code returns nullopt whenever the plain double
evaluation is sound, so results inside double's range do not change.

Deliberately left as NaR: sin/cos/tan/sec/csc/co... (continued)

307 of 321 new or added lines in 10 files covered. (95.64%)

33 existing lines in 9 files now uncovered.

46106 of 53551 relevant lines covered (86.1%)

9734940.32 hits per line

Uncovered Changes

Lines Coverage ∆ File
14
94.57
include/sw/universal/number/takum/math/wide_range.hpp

Coverage Regressions

Lines Coverage ∆ File
10
82.14
-17.86% include/sw/universal/number/takum/math/trigonometry.hpp
6
83.33
-16.67% include/sw/universal/number/takum/math/hyperbolic.hpp
4
75.0
-25.0% include/sw/universal/number/takum/math/fractional.hpp
4
84.0
-16.0% include/sw/universal/number/takum/math/logarithm.hpp
4
83.33
-16.67% include/sw/universal/number/takum/math/truncate.hpp
2
94.87
0.28% include/sw/universal/number/takum/math/pow.hpp
1
95.86
-0.06% include/sw/universal/number/cfloat/cfloat_impl.hpp
1
91.67
-8.33% include/sw/universal/number/takum/math/error_and_gamma.hpp
1
83.33
-16.67% include/sw/universal/number/takum/math/hypot.hpp
Jobs
ID Job ID Ran Files Coverage
1 37160643253.1 03 Oct 2026 11:49PM UTC 679
86.1
GitHub Action Run
Source Files on build 37160643253
  • Tree
  • List 679
  • Changed 14
  • Source Changed 9
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #37160643253
  • 62eab9aa on github
  • Prev Build on main (#37153423190)
  • Next Build on main (#37328409057)
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