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

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

Build:
Build:
LAST BUILD BRANCH: fix/issue-ci-ereal-regression-runtime
DEFAULT BRANCH: master
Ran 26 Apr 2026 02:00PM UTC
Jobs 1
Files 646
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 01:33PM UTC coverage: 84.282% (+0.008%) from 84.274%
24957906871

push

github

web-flow
feat(math): add constexpr exp (natural exponential) to sw::math::constexpr_math (#775)

* feat(math): add constexpr exp (natural exponential) to sw::math::constexpr_math

Adds constexpr<float|double> exp to the constexpr_math facility (#763
Epic). Tier-2 sub-issue: thin wrapper exp(x) = exp2(x * LOG2E) on top of
the merged exp2 machinery (#764 / PR #769).

Implementation: special-value cases (NaN, +/-inf) handled before the
multiply because clang's stricter constexpr evaluator rejects "arithmetic
produces a NaN" -- mirrors the same pattern used in log.hpp.

Verification:
  - 13 static_asserts: exp(0) == 1, exp(1) ~= e, exp(-1) ~= 1/e,
    exp(ln(2)) ~= 2 (cross-check via detail::LN2), log(exp(pi)) ~= pi
    (round-trip with log), all special values (NaN, +/-inf) for both
    float and double, overflow saturation (exp(710) -> +inf),
    underflow (exp(-746) -> 0)
  - Runtime sweep over 17 hand-picked points spanning [-700, 700]
  - Round-trip log(exp(x)) for 10 points
  - Float sweep over 8 points

Out-of-band accuracy stress (100K random samples in [-700, 700]):
  - max relative error 4.92e-14 = 221.57 x double epsilon
  - bounded by the x * LOG2E multiply: at large |x| (e.g. +/-700),
    the magnitude (~1010) amplifies sub-ulp rounding to ~3-5e-14 rel
  - comparable to typical std::exp transcendental accuracy
  - vastly better than lns/takum precision needs

cm_log2, cm_exp2, cm_log, cm_pow, cm_sqrt, cm_exp -- all 6 facility
tests PASS on gcc and clang.

This is the **last** function in Epic #763. The constexpr_math facility
is now complete: log2, exp2, log, exp, pow, sqrt all implemented.

Resolves #768
Closes Epic #763 (functionally complete; admin closure separate)

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

* test(math): add off-by-one guards for exp saturation boundaries (CodeRabbit)

Per CodeRabbit on PR #775: the existing static_asserts only check the
hard saturation points at +/-710 / -746, leaving the "just inside"... (continued)

35 of 40 new or added lines in 2 files covered. (87.5%)

3 existing lines in 1 file now uncovered.

45467 of 53946 relevant lines covered (84.28%)

6349277.67 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
83.33
internal/constexpr_math/api/exp.cpp

Coverage Regressions

Lines Coverage ∆ File
3
81.25
-0.22% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 24957906871.1 26 Apr 2026 02:00PM UTC 646
84.28
GitHub Action Run
Source Files on build 24957906871
  • Tree
  • List 646
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24957906871
  • 53e6867f on github
  • Prev Build on main (#24956707653)
  • Next Build on main (#24963550987)
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