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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 21 Oct 2026 06:50PM UTC
Jobs 1
Files 760
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

21 Oct 2026 06:39PM UTC coverage: 87.853% (+0.04%) from 87.818%
39654630386

push

github

web-flow
feat(efloat): correctly rounded tgamma and lgamma at any precision (#1779)

tgamma and lgamma converted their argument to double and called std::tgamma
and std::lgamma, so they returned at most 53 correct bits at any precision,
inf past x = 171.6 (tgamma(100001.5) = inf), 0 below about x = -178, and
lgamma(1 + 2^-100) = 0.

Both now evaluate Stirling's series, at the result's precision plus guard
bits, and round once by Ziv's strategy:

- x > 0 is shifted up to z >= 0.3 W, where Stirling's smallest term lies
  2.7 W bits down, and lgamma x = lgamma(x + N) - log(x (x+1) ... (x+N-1)).
  The remainder is bounded by the first omitted term for any real z > 0, and
  the number of terms comes from a double estimate of it.
- The Bernoulli coefficients B_2k / (2k (2k-1)) come from the Brent-Harvey
  tangent-number recurrence, all positive additions and small-integer
  products, and are cached per thread at the widest precision used.
- x < 0 uses the reflection formula, with sin(pi x) = (-1)^n sin(pi f),
  n = round(x), and f = x - n exact, so results near the poles keep their
  relative precision.
- Near the zeros of lgamma at 1 and 2, and below 0, the working precision is
  raised by the cancellation the value shows.
- tgamma = sign exp(lgamma), with lgamma carried to the absolute accuracy that
  exp's relative error needs. (n-1)! is computed exactly while it has at most
  twice the result's bits. Results past 2^(2^62) are inf or 0 with Overflow or
  Underflow, as exp's are.
- Special values follow C: tgamma(+/-0) = +/-inf and lgamma(0) = +inf with
  DivisionByZero; tgamma at the negative integers and at -inf is NaN with
  InvalidOperation; lgamma there is +inf; lgamma(1) = lgamma(2) = +0.

Checked against MPFR's mpfr_gamma and mpfr_lgamma: 0 wrong out of 19,338
random and special arguments from 32 to 8192 bits, in all four rounding
modes. Measured, lgamma's unrounded value is within 2^(E - W + 2) of
lgamma x, against the 2^(E - W + 22) the code assumes.

The... (continued)

191 of 192 new or added lines in 1 file covered. (99.48%)

2 existing lines in 1 file now uncovered.

52993 of 60320 relevant lines covered (87.85%)

9206421.71 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
99.51
-0.49% include/sw/universal/number/efloat/math/error_and_gamma.hpp

Coverage Regressions

Lines Coverage ∆ File
2
82.83
-0.3% include/sw/universal/number/qd/qd_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 39654630386.1 21 Oct 2026 06:50PM UTC 760
87.85
GitHub Action Run
Source Files on build 39654630386
  • Tree
  • List 760
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39654630386
  • b4808eac on github
  • Prev Build on main (#39646982344)
  • Next Build on main (#39669920200)
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