Repository navigation
test: migrate math/base/special/acoversinf to ULP-based testing - #13774
Conversation
|
Hello! 👋 We've noticed that you've been opening a number of PRs addressing good first issues. Thank you for your interest and enthusiasm! Now that you've made a few contributions, we suggest no longer working on good first issues. Instead, we encourage you to prioritize cleaning up any PRs which have yet to be merged and then proceed to work on more involved tasks. Not only does this ensure that other new contributors can work on things and get ramped up on all things stdlib, it also ensures that you can spend your time on more challenging problems. 🚀 For ideas for future PRs, feel free to search the codebase for TODOs and FIXMEs and be sure to check out other open issues on the issue tracker. Cheers! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
When replacing the relative epsilon tolerance with exact ULP bounds for `@stdlib/math/base/special/acoversinf, I calculated the strict mathematical deviation across all the provided JSON test fixtures (data.json and small_positive.json). I found that the maximum deviation between the computed float32 value and the theoretical expected value in the fixtures hits exactly 234 ULPs at its worst point. If we look at the original test suite, the tolerance was previously defined as: tol = 230.0 * EPS * absf( e ); Because the original test already permitted a relative error of ~230 machine epsilons (due to the inherent floating-point precision loss of acoversinf), bounding the exact isAlmostSameValuef assertion strictly to 234 ULPs mathematically aligns with the original tolerance intent while providing a modern, exact empirical upper bound. |
|
Ah, good catch! I used 234 there by mistake because I globally applied the ULP bound from the first test block (which originally used 230.0 * EPS) to both test blocks during the migration. I completely missed that the small positive numbers block originally used a much tighter tolerance of just EPS * absf( e ). I have just pushed a commit that decreases the ULP bound back down to 1 for the small positive numbers block in both test.js and test.native.js to match its original strictness. Thanks for catching that oversight! |
Resolves part of #11352.
Description
This pull request:
@stdlib/math/base/special/acoversinfto use precise ULP-based bounds for floating-point comparisons rather than relative epsilon tolerances.@stdlib/number/float32/base/assert/is-almost-same-valueacross the JavaScript and C++ native add-on test suites.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers