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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 21 Oct 2026 08:43PM 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 08:23PM UTC coverage: 87.875% (+0.02%) from 87.853%
39669920200

push

github

web-flow
feat(efloat): correctly rounded erf and erfc at any precision (#1781)

erf and erfc converted their argument to double and called std::erf and
std::erfc. So they returned at most 53 correct bits at any precision,
erfc(x) = 0 from x = 27.23 on (erfc(1000.5) was 0), and every rounding mode
got the same result.

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

- erf x = 2/sqrt(pi) exp(-x^2) sum t_n, with t_n = t_(n-1) 2 x^2 / (2n+1).
  All of its terms are positive, so it has no cancellation, unlike the
  alternating Taylor series; MPFR's mpfr_erf_0 uses the same series. Once the
  terms fall, they are carried at a precision that falls with them, as log's
  series is. x^2 is formed exactly, so exp(-x^2) carries no rounding of its
  argument.
- erfc x for a large x uses the asymptotic series (DLMF 7.12.1). Its
  remainder is below the first omitted term, and it is used only where its
  smallest term lies below the working precision.
- Elsewhere erfc x = 1 - erf x, carried with the bits it cancels. Those are
  bounded by log2(1 / erfc x) < x^2 log2(e) + log2(sqrt(pi) (x + sqrt(x^2 + 2)) / 2)
  (Abramowitz and Stegun 7.1.13). For x < 0, erfc x = 1 + erf |x|.
- erf x rounds as +/-1, and erfc of a negative x as 2, by round_near once
  erfc |x| < 2^-(P + 5). erfc x is +0 with Underflow past exp's range.
- erf(+/-0) = +/-0, erf(+/-inf) = +/-1, erfc(0) = 1, erfc(+inf) = +0 and
  erfc(-inf) = 2, exactly, at the argument's precision.

Checked against MPFR's mpfr_erf and mpfr_erfc: 0 wrong out of 19,338 random
and special arguments from 32 to 8192 bits, in all four rounding modes. The
special arguments include values around both switches, tiny ones and large
ones. Measured, the unrounded values lie at least 17 bits inside the error
bound Ziv's test assumes. With warm caches, erf takes 1.0-1.4x MPFR's time
and erfc is faster than MPFR (0.75x at 64 bits, 0.62x at 512).

The regression test checks erf and erfc against the ... (continued)

119 of 119 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

53109 of 60437 relevant lines covered (87.87%)

9192493.08 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
97.04
-0.06% include/sw/universal/number/cfloat/cfloat_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 39669920200.1 21 Oct 2026 08:43PM UTC 760
87.87
GitHub Action Run
Source Files on build 39669920200
  • Tree
  • List 760
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39669920200
  • 2076edb7 on github
  • Prev Build on main (#39654630386)
  • Next Build on main (#39688034097)
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