Skip to content

Lower the cos test tolerance and fix the asin test seed - #1484

Open
ibmibmibm wants to merge 1 commit into
boostorg:developfrom
ibmibmibm:sincos-tol-fixed-seed
Open

ibmibmibm wants to merge 1 commit into
boostorg:developfrom
ibmibmibm:sincos-tol-fixed-seed

Conversation

@ibmibmibm

Copy link
Copy Markdown
Contributor

This PR follows the review of #1479.

test_cos() in test/test_sin_cos.cpp now uses a tolerance of 16 float eps, the same value that #1479 uses for test_sin(). The old value was 35 eps. Over 200000 random points in [-2π, 2π], the largest cos error for all decimal types is 5 eps.

test_asin_edge() in test/test_asin.cpp now seeds its generator with a fixed value. The old code seeded it from the clock, so a failure was not reproducible. This change also removes the unused time_point() helper, std::random_device, and <chrono>.

This PR does not change test/test_tan.cpp because #1479 already changes the seed there.

Both tests pass with GCC and Clang.

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.7%. Comparing base (c4e5174) to head (ca990cd).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #1484     +/-   ##
=========================================
- Coverage     98.7%   98.7%   -0.0%     
=========================================
  Files          315     315             
  Lines        26449   26441      -8     
  Branches      2253    2253             
=========================================
- Hits         26104   26096      -8     
  Misses         345     345             
Files with missing lines Coverage Δ
test/test_asin.cpp 100.0% <100.0%> (ø)
test/test_sin_cos.cpp 100.0% <100.0%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4e5174...ca990cd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ibmibmibm
ibmibmibm force-pushed the sincos-tol-fixed-seed branch from f7a42ae to 0908a68 Compare October 1, 2026 13:34
The random cos test now uses 16 float eps, the same as the sin test
in boostorg#1479. Over 200000 random points the largest cos error is 5 eps.

The asin edge test now seeds its generator with a fixed value
instead of the clock, so a failure is reproducible.
@ibmibmibm
ibmibmibm force-pushed the sincos-tol-fixed-seed branch from 0908a68 to ca990cd Compare October 1, 2026 16:11
@ibmibmibm
ibmibmibm marked this pull request as ready for review October 2, 2026 01:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant