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

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

Build:
Build:
LAST BUILD BRANCH: docs/takum-linear-vs-logarithmic-assessment
DEFAULT BRANCH: master
Ran 18 Jul 2026 12:52PM UTC
Jobs 1
Files 694
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 Jul 2026 12:11PM UTC coverage: 84.68% (+0.06%) from 84.621%
29643890345

push

github

web-flow
feat(efloat): implement math/trigonometry.hpp (sin, cos, tan, asin, acos, atan, atan2) (#1137)

* feat(efloat): implement math/trigonometry.hpp (sin, cos, tan, asin, acos, atan, atan2)

Adds the trigonometry header for the arbitrary-precision efloat template,
completing the last missing piece of the efloat mathematical library (parent
#1092). Native arbitrary-precision implementations, not double-delegating shims:

- sin/cos: argument reduction to [-pi, pi] via r = x - round(x/2pi)*2pi, then
  Taylor series with the precision-aware term.scale()/get_precision() terminator
  used by expm1/log1p.
- tan = sin/cos, with a signed-infinity result at the pole (cos == 0).
- atan: |x|==1 -> pi/4; |x|>1 -> pi/2 - atan(1/|x|); 0.5<|x|<=1 -> addition
  formula atan(1/2) + atan((|x|-1/2)/(1+|x|/2)); else Taylor. Keeps the reduced
  argument small so the series converges quickly (no slow Leibniz tail near 1).
- asin: domain |x|>1 -> NaN; |x|>0.8 -> pi/2 - asin(sqrt(1-x^2)); else Taylor.
- acos = pi/2 - asin.
- atan2: full-quadrant, using the efloat pi constants (NOT bare double literals,
  avoiding the double-contamination bug present in ereal's atan2).

High-precision pi seeded via parse() of a ~62-digit literal (same idiom exp/log
use for ln2); pi/2 and pi/4 derived by exact multiplication. Constants are
capped at ~62 digits like the existing ln2/ln10 -- adequate for the standard
efloat configs; a longer literal or native pi computation can lift that later.

Note: the free abs()/fabs() function is a pre-existing stub that returns its
argument unchanged, so this code takes absolute values via the setsign(false)
idiom the other efloat math headers already use.

Wired into mathlib.hpp after truncate.hpp (trig needs round()). New regression
test elastic/efloat/math/trigonometry.cpp (auto-globbed as target
efloat_trigonometry) covers values, identities (sin^2+cos^2==1), argument
reduction, inverse round-trips, all four atan2 quadrants, domain errors, and
NaN/Inf specia... (continued)

175 of 188 new or added lines in 1 file covered. (93.09%)

14 existing lines in 3 files now uncovered.

49414 of 58354 relevant lines covered (84.68%)

6662754.54 hits per line

Uncovered Changes

Lines Coverage ∆ File
13
93.09
include/sw/universal/number/efloat/math/trigonometry.hpp

Coverage Regressions

Lines Coverage ∆ File
11
87.1
0.39% include/sw/universal/number/efloat/efloat_impl.hpp
2
89.78
-0.55% include/sw/universal/number/posito/posito_impl.hpp
1
80.8
0.0% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
Jobs
ID Job ID Ran Files Coverage
1 29643890345.1 18 Jul 2026 12:52PM UTC 694
84.68
GitHub Action Run
Source Files on build 29643890345
  • Tree
  • List 694
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29643890345
  • faeca922 on github
  • Prev Build on main (#29621270080)
  • Next Build on main (#29643883548)
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