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

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

Build:
Build:
LAST BUILD BRANCH: fix/issue-1002-ereal-highprec-constants
DEFAULT BRANCH: master
Ran 22 May 2026 12:02AM UTC
Jobs 1
Files 651
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

21 May 2026 11:35PM UTC coverage: 84.234% (-0.004%) from 84.238%
26259402148

push

github

web-flow
feat(constants): high-precision (~320-digit) reference string constants (#915)

* feat(constants): high-precision (~320-digit) reference string constants

Resolves #911. Adds decimal-string reference constants at ~320 digits
of precision -- the natural ceiling for any multi-component type
built on double components (floor(1023/53)=19 components for values
near 1, ~ 1023/3.32=308 decimal digits, with margin).

What landed
-----------

- tools/scripts/generate_reference_constants.py -- mpmath-based
  generation script at 350 internal digits / 320 emitted. Pure-Python
  reproducibility recipe; the script is the canonical source of
  truth for the strings in the header.

- include/sw/math/constants/reference_constants.hpp -- 24 string
  constants as `inline constexpr std::string_view`, each 320 decimal
  digits, plus template factory helpers `make_pi<T>()`,
  `make_e<T>()`, etc. that materialise any type T satisfying
  `T(std::string)` (covers `ereal<N>` and `elreal`).

- elastic/ereal/math/constants/reference_constants.cpp -- cross-
  validation test against the precomputed 4-component qd expansions
  in qd_constants.hpp. The leading components of each parsed
  ereal<19> match the qd reference within ~ 1e-30 relative tolerance.
  Test target: er_const_reference_constants.

Constants set
-------------

- pi family: pi, pi/2, pi/3, pi/4, 2*pi, 3*pi, 1/pi, 2/pi
- e family: e, 1/e
- phi family: phi, 1/phi
- square roots: sqrt(2), sqrt(3), sqrt(5), 1/sqrt(2)
- logarithms: ln(2), ln(10), log2(e), log2(10), log10(e), log10(2)
- erf scaling: 2/sqrt(pi)
- Euler-Mascheroni gamma

Known limitations
-----------------

Two issues filed during this PR for follow-up:

- #913: ereal::parse() has quadratic-or-worse complexity on long
  strings. The full 320-digit reference strings exist in the header
  and are correct, but the cross-validation test uses 80-character
  truncations to stay under the parse-perf cliff. The full strings
  will become practically usable once #... (continued)

46943 of 55729 relevant lines covered (84.23%)

5288723.9 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
81.25
0.0% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
2
89.78
-0.55% include/sw/universal/number/posito/posito_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 26259402148.1 22 May 2026 12:02AM UTC 651
84.23
GitHub Action Run
Source Files on build 26259402148
  • Tree
  • List 651
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26259402148
  • 1c7ea425 on github
  • Prev Build on main (#26258532897)
  • Next Build on main (#26265518834)
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