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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 23 Aug 2026 04:43AM UTC
Jobs 1
Files 620
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

23 Aug 2026 04:04AM UTC coverage: 85.418% (+0.05%) from 85.372%
32616940134

push

github

web-flow
perf(elreal): memoize the transcendental constants (#1384)

pi and ln2 were recomputed from scratch on every call. That -- not the series each
one wraps -- was essentially the entire cost of sin, cos, tan and log. Measured at
depth 8 on a double host, all reaching ~130 digits:

    pi_zbcl(8)   ALONE   371.90 ms        sin(0.5,8)  TOTAL   371.82 ms
    ln2_zbcl(8)  ALONE   373.17 ms        log(2,8)    TOTAL   375.61 ms
                                          exp(1,8)    TOTAL     9.57 ms
                                          sqrt(2,8)   TOTAL     4.04 ms

sin cost what pi_zbcl cost, to within noise. exp and sqrt need no constant, which is
exactly why they were two orders of magnitude cheaper. pi_zbcl ran two full
odd_power_series evaluations (Machin) per call, with nothing retained.

Cached per (FpType, depth), thread_local. In steady state:

    function     before     after
    sin / cos    ~372 ms    ~5.8 ms
    tan           374 ms    ~9.1 ms
    log           374 ms    ~0.01 ms
    exp, sqrt    unchanged  unchanged

The first call at a given depth still pays for the constant. Memoized: e, ln2, ln10,
log2_10, pi, sqrt2/3/5, phi, euler_gamma.

KEYED ON THE EXACT DEPTH, and that is the constraint worth recording. Caching the
deepest value and truncating it for shallower requests is cheaper, and it is what I
proposed on the issue before measuring. It is wrong: these constants are NOT
prefix-stable. pi at depth 2 differs from take(2) of pi at depth 8 after ~32 digits,
because the deeper evaluation refines the last block rather than merely extending it.
Under that scheme pi_zbcl(2) would return one value or another depending on whether
some unrelated earlier call had asked for more -- results that depend on call
history, which a numeric library cannot do.

Values are unchanged: the first call at a depth computes exactly what it computed
before, and later calls return that same object.

Regression constant_memoization.cpp guards both properties, c... (continued)

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

43182 of 50554 relevant lines covered (85.42%)

7151229.37 hits per line

Jobs
ID Job ID Ran Files Coverage
1 32616940134.1 23 Aug 2026 04:43AM UTC 620
85.42
GitHub Action Run
Source Files on build 32616940134
  • Tree
  • List 620
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32616940134
  • b538994a on github
  • Prev Build on main (#32610739250)
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