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

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

Build:
Build:
LAST BUILD BRANCH: losborn_bugfix_elreal_subnormal_blocks_aug26
DEFAULT BRANCH: master
Ran 21 Jul 2026 04:21PM UTC
Jobs 1
Files 701
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 Jul 2026 03:38PM UTC coverage: 84.767% (-0.04%) from 84.809%
29844909844

push

github

web-flow
feat(elreal): Payne-Hanek range reduction for sin/cos/tan at large |x| (#1050) (#1178)

detail::sincos reduced x = n*(pi/2) + t using a host-double estimate
nd = round(to_double_approx(x)/(pi/2)). For |x| >= ~2^53 that double loses all
the fractional bits of x/(pi/2), so nd (and the octant n mod 4) were wrong and
the cancellation x - nd*(pi/2) left a garbage reduced argument -- sin/cos/tan
were unusable past ~1e15.

For |x| >= 2^50 sincos now uses a Payne-Hanek reduction that works entirely in
ZBCL space:
- reddepth blocks of pi/(2) chosen to cover |x|'s binade (from x.head().exponent(),
  the idiom log() already uses) plus the output precision;
- q = div_online(|x|, pi/2) -- the quotient at full precision;
- N = zbcl_round_to_int(q) -- the nearest integer, accumulated into a wide
  integer<256> by scaling each block's exact m*2^p contribution (frexp gives the
  signed k-bit significand), so N is exact even past 2^53 (n ~ 6.4e19 for 1e20);
- t = (q - N)*(pi/2), a well-conditioned multiply of the small fraction q - N
  (pooled + priestRenorm to keep 0-overlap, #1044), never a subtraction of
  near-equal large quantities.
The octant recombination and the Maclaurin series are unchanged; the reduction
works on |x| and folds the sign back (sin odd, cos even). |x| < 2^50 keeps the
fast host-double path (exact there).

Validated on the double host: sin/cos(1e3, 1e6, 1e12, 1e20) agree with mpmath
320-digit references to 180-194 digits, sin^2+cos^2 == 1 holds to ~193 digits at
1e20, tan == sin/cos, and the reduced argument stays 0-overlap. Large-|x| on a
narrow host (float, which cannot represent integers past 2^24) is out of scope,
noted alongside the existing asin/acos double-host caveat.

- trigonometry.hpp: zbcl_round_to_int + int_to_zbcl helpers, sincos rewrite,
  online_multiply/online_divide includes, header notes.
- reference_constants.hpp + generate_reference_constants.py: sin/cos(1e3..1e20)
  mpmath references (arguments are exact doubles).
- elastic... (continued)

61 of 62 new or added lines in 1 file covered. (98.39%)

33 existing lines in 4 files now uncovered.

49893 of 58859 relevant lines covered (84.77%)

7019651.64 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
99.28
-0.72% include/sw/universal/number/elreal/math/trigonometry.hpp

Coverage Regressions

Lines Coverage ∆ File
10
31.43
-3.57% include/sw/universal/verification/test_suite_randoms.hpp
9
50.45
-8.11% include/sw/universal/verification/posit_test_suite_randoms.hpp
8
93.95
-0.47% include/sw/universal/number/cfloat/cfloat_impl.hpp
6
80.58
-1.34% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 29844909844.1 21 Jul 2026 04:21PM UTC 701
84.77
GitHub Action Run
Source Files on build 29844909844
  • Tree
  • List 701
  • Changed 6
  • Source Changed 1
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29844909844
  • 2e322ed8 on github
  • Prev Build on main (#29830039050)
  • Next Build on main (#29875024018)
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