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

stillwater-sc / universal / 31677190651
85%
master: 84%

Build:
Build:
LAST BUILD BRANCH: refactor/1334-phase-n-integer-core
DEFAULT BRANCH: master
Ran 13 Aug 2026 07:55AM UTC
Jobs 1
Files 614
Run time 2min
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

13 Aug 2026 07:17AM UTC coverage: 85.37% (+0.04%) from 85.335%
31677190651

push

github

web-flow
feat(takum): add the takum_log elementary function library (#1305)

takum_log had no math functions at all: every template in mathlib.hpp binds to
takum<>, so the logarithmic type could not be used with generic numerical code.
This adds the surface, and implements in the logarithmic domain the operations
that are exact there.

|value| == sqrt(e)^l, so any function scaling l by a rational factor is exact
before rounding: sqrt (l/2), sqr (2l), rsqrt (-l/2), pow (n*l for integer n) and
the reciprocal (-l, exact with no rounding at all, Prop. 7).  The alternative --
decode, call libm, re-encode -- rounds three times and cannot carry more than a
double's 53 significand bits.  That ceiling is not hypothetical: takum_log<64,3>
reaches p = 59, so the logarithmic value is carried as an exact integer pair
(N, q) meaning N/2^q.  Halving l produces a fraction one bit WIDER than the
source layout holds, which a double would discard before any rounding decision.

takum_codec gains encode_fraction(c, N, q) for that pair.  Purely additive: an
exhaustive dump of 18 configurations (530,786 observations) is bit-for-bit
identical to main for both variants.

Against an oracle built from exact integer arithmetic, sqrt is correctly rounded
for 100% of inputs at 16, 24, 32, 48 and 64 bits, with ties resolved to even.
The double round trip is also correct up to 48 bits and collapses to 0.95% at
64.  So below 48 bits this buys speed; above it, correctness.

Two claims are deliberately NOT made.  exp and log are not free in a logarithmic
format: extracting ln|x| == l/2 costs nothing, but expressing the answer back as
a takum_log needs l' == 2*ln(l/2), another logarithm -- each saves one
transcendental, not two.  And addition remains the operation this representation
is worst at, so hyperbolic functions, log1p, expm1, fmod and fma have no
shortcut and are evaluated as reals.  fma's double bridge is scoped to operands
and product-sums representable in binary64, which is not the w... (continued)

167 of 186 new or added lines in 14 files covered. (89.78%)

42097 of 49311 relevant lines covered (85.37%)

7218256.41 hits per line

Uncovered Changes

Lines Coverage ∆ File
17
88.03
-11.97% include/sw/universal/number/takum/takum_codec.hpp
2
91.67
include/sw/universal/number/takum/math/pow.hpp
Jobs
ID Job ID Ran Files Coverage
1 31677190651.1 13 Aug 2026 07:55AM UTC 614
85.37
GitHub Action Run
Source Files on build 31677190651
  • Tree
  • List 614
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #31677190651
  • 91a80988 on github
  • Prev Build on main (#31654383598)
  • Next Build on main (#31709365949)
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