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

stillwater-sc / universal / 24948080228
84%
master: 84%

Build:
Build:
LAST BUILD BRANCH: fix/issue-ci-ereal-regression-runtime
DEFAULT BRANCH: master
Ran 26 Apr 2026 04:46AM UTC
Jobs 1
Files 640
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

26 Apr 2026 04:19AM UTC coverage: 84.337% (-0.02%) from 84.354%
24948080228

push

github

web-flow
feat(math): add constexpr log (natural logarithm) to sw::math::constexpr_math (#771)

* feat(math): add constexpr log (natural logarithm) to sw::math::constexpr_math

Adds constexpr<float|double> log to the constexpr_math facility (#763
Epic, #423/PR #762 substrate). Tier-2 sub-issue: natural log used by
dbns and useful for general literal construction.

Implementation: log(x) = log2(x) * ln(2) -- thin wrapper over the
existing log2 machinery. Special cases (NaN, x<0, 0, +inf) are handled
explicitly before the multiply rather than relying on log2 to propagate
them; clang's stricter constexpr evaluator rejects "arithmetic produces
a NaN" so log2(NaN) * LN2 would trip the diagnostic even though log2
itself returned NaN cleanly.

Verification:
  - 9 static_asserts: log(1) == 0, log(2) ~= ln(2) (LN2 anchor),
    log(e) ~= 1, log(10) ~= ln(10), log(8) == 3*log(2) cross-check,
    plus NaN / +/-inf / negative-input special values
  - Runtime sweep over 22 hand-picked points spanning 1e-300 to 1e300
  - Float sweep over 10 points

Out-of-band accuracy stress (100K random samples in [1e-100, 1e100]):
  - max relative error 1.29e-16 = 0.58 x double epsilon (sub-ulp)
  - tighter than the standalone log2 because the LN2 multiply often
    rounds favorably for non-pow-2 inputs

cm_log, cm_log2, cm_exp2 all PASS on gcc and clang in build_ci /
build_ci_clang.

Resolves #766
Relates to #763 (Epic)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(math): pin log(-0) and use tolerance for log cross-check (CodeRabbit)

Two Nitpicks from CodeRabbit on PR #771:

1. Pin -0 behavior explicitly: cm::log(-0.0) and cm::log(-0.0f) must
   return -infinity (the IEEE-754 zero branch matches both signed
   zeros). The implementation already handled this correctly via
   x == 0.0 (which compares equal for both +0 and -0), but a regression
   test prevents accidental breakage.

2. Replace exact-equality cross-check (log(8) == 3*log(2)) with a
   toleranc... (continued)

33 of 42 new or added lines in 2 files covered. (78.57%)

8 existing lines in 1 file now uncovered.

45239 of 53641 relevant lines covered (84.34%)

6385310.1 hits per line

Uncovered Changes

Lines Coverage ∆ File
9
70.0
internal/constexpr_math/api/log.cpp

Coverage Regressions

Lines Coverage ∆ File
8
93.48
-0.48% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 24948080228.1 26 Apr 2026 04:46AM UTC 640
84.34
GitHub Action Run
Source Files on build 24948080228
  • Tree
  • List 640
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24948080228
  • 11fbc582 on github
  • Prev Build on main (#24947307128)
  • Next Build on main (#24955899585)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc