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

stillwater-sc / universal / 39093502751
89%
master: 84%

Build:
Build:
LAST BUILD BRANCH: fix/issue-2128-lns-correct-rounding
DEFAULT BRANCH: master
Ran 18 Oct 2026 03:45AM UTC
Jobs 1
Files 751
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

18 Oct 2026 03:24AM UTC coverage: 87.295% (+0.1%) from 87.149%
39093502751

push

github

web-flow
feat(math): exact (Payne-Hanek) trigonometric argument reduction for dd, qd and the cascades (#1727)

sin, cos, sincos and tan of dd, qd, dd_cascade, td_cascade and qd_cascade
reduced the argument by subtracting nint(x / 2pi) 2pi, with 2pi held to
the type's own 106, 159 or 212 bits. The constant's rounding error is
multiplied by the quotient, so the reduced argument lost about log2|x|
bits. An argument near a multiple of pi/2 also lost the bits of its
distance to it. Compared with libm at double resolution: dd sin(1e22)
was off by 6e-12 relative and sin(1e30) by 10%. td_cascade sin(1e50)
returned 0.10159 for -0.48050 and raised no error. Past ~1e100 every
type returned NaN with ERANGE (#1722).

number/shared/multidouble_reduce_pio2.hpp reduces exactly. Each limb of
the argument is a dyadic sig 2^e and contributes sig 2^e (2/pi) modulo 4
from a 704-bit window of 2/pi, skipping the bits that only produce
multiples of 4. The contributions are summed in a 640-fraction-bit
two's-complement accumulator. The fraction, folded into [-1/2, 1/2),
becomes radians through one multiplication by the type's pi/2. The
table holds 1792 bits of 2/pi (mpmath at two working precisions that
agree), whose first 1280 bits match bposit's independently computed
table; it covers limbs up to DBL_MAX. An argument within pi/4 is its
own reduction. The ERANGE path and the
<type>_trig_argument_too_large exceptions added in #1722 are removed:
no finite argument fails to reduce.

tools/generators/multidouble_trig_gen.py writes 107 vectors from mpmath
at 3200 bits:
- doubles to DBL_MAX, and seeded random ones over every binade;
- 6381956970095103 2^797, the double closest to a multiple of pi/2;
- k pi/2 rounded to 2, 3 and 4 limbs, whose sine or cosine is a few
  ulps of the type.
static/highprecision/<type>/math/trig_reduction.cpp checks sin, cos,
sincos and tan within 2^-(p-4). The worst errors are 2^-104.0 dd,
2^-105.3 dd_cascade, 2^-159.9 td_cascade, 2^-212.7 qd and 2^-213.4
qd_ca... (continued)

204 of 214 new or added lines in 8 files covered. (95.33%)

50788 of 58180 relevant lines covered (87.29%)

10294098.87 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
85.71
include/sw/universal/verification/multidouble_trig.hpp
3
96.67
include/sw/universal/number/shared/multidouble_reduce_pio2.hpp
3
96.25
-3.75% include/sw/universal/verification/multidouble_math_errors.hpp
Jobs
ID Job ID Ran Files Coverage
1 39093502751.1 18 Oct 2026 03:45AM UTC 751
87.29
GitHub Action Run
Source Files on build 39093502751
  • Tree
  • List 751
  • Changed 17
  • Source Changed 11
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39093502751
  • 23c77fdb on github
  • Prev Build on main (#39090880833)
  • Next Build on main (#39098120219)
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