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

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

Build:
Build:
LAST BUILD BRANCH: fix/issue-1002-ereal-highprec-constants
DEFAULT BRANCH: master
Ran 21 May 2026 05:27PM 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 04:58PM UTC coverage: 84.229% (-0.005%) from 84.234%
26240649255

push

github

web-flow
feat(elreal): Phase E.6 -- forward trig (sin/cos/tan) with derivative refinement (#898)

Phase E.6 of epic #873 (resolves #892). The last math sub-issue of
Phase E and the hardest one in scope, but ships pragmatically: std
library at depth 0 + derivative-based depth-1 correction, with the
Payne-Hanek range-reduction strategy documented in a header block as
the path forward for arbitrary-magnitude inputs.

Per-function derivatives:
  d/dx sin(x)  =  cos(x)             -> cos(a0) * a.at(1)
  d/dx cos(x)  = -sin(x)             -> -sin(a0) * a.at(1)
  d/dx tan(x)  = 1 + tan^2(x)        -> (1 + c0*c0) * a.at(1)

The genuinely hard problem for forward trig is RANGE REDUCTION: for
large-magnitude arguments (|x| > 2^25 ish), the std lib reduces the
argument modulo 2*pi using IEEE-754 M_PI (only 53 bits), so the
reduced argument has essentially no precision. McCleeary 2019 /
Payne-Hanek 1983 solves this by performing the reduction with
arbitrarily many bits of pi pulled lazily from the constant's stream.

This PR ships the std-lib-based depth-0 + derivative-based depth-1
computation. It is correct for arguments of "reasonable magnitude" --
the acceptance criteria of #892 explicitly note that direct
cross-validation against std::sin for huge-magnitude inputs is not
meaningful (lazy real arithmetic is where huge-magnitude trig *wins*
over double). The Payne-Hanek lazy-pi-pull path is documented as a
Phase-F-or-later follow-up requiring (a) elreal_pi extended past the
current 4-component static expansion, (b) integer-mod-pi reduction
with on-demand pi refinement, and (c) Taylor/Chebyshev evaluation of
sin/cos on the reduced argument with lazy refinement.

Tests under elastic/elreal/math/trig.cpp:
  - Anchor values (sin(0)=0, cos(0)=1, tan(0)=0, sin(pi/2)~=1,
    cos(pi)~=-1, tan(pi/4)~=1)
  - Pythagorean identity sin^2(x) + cos^2(x) == 1 at modest x
  - tan(x) ~= sin(x) / cos(x) consistency
  - Cross-validation vs std::sin/cos/tan for |x| < pi
  - **Lazy-pi disti... (continued)

46940 of 55729 relevant lines covered (84.23%)

5212218.55 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
80.58
-0.67% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 26240649255.1 21 May 2026 05:27PM UTC 651
84.23
GitHub Action Run
Source Files on build 26240649255
  • Tree
  • List 651
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26240649255
  • b5575694 on github
  • Prev Build on main (#26238163779)
  • Next Build on main (#26243980512)
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