Repository navigation
test: migrate math/base/special/bessely1 to ULP-based assertions - #14344
Conversation
Migrates the tests for `math/base/special/bessely1` from relative tolerance testing to ULP difference testing. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016QXf8qgJE6oxk7kYtn5zQZ --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
|
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. |
Resolves a part of #11352.
Description
This pull request:
math/base/special/bessely1from relative tolerance testing to ULP difference testing, per [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.delta/tolcomputation and they === expectedspecial case intest/test.jsandtest/test.native.jswith a singlet.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' );assertion.@stdlib/math/base/special/absrequire and adds@stdlib/assert/is-almost-same-value. The@stdlib/constants/float64/epsrequire is retained, asEPSis still used when generating negative inputs.ULP bounds (per fixture set, identical for
test/test.jsandtest/test.native.js):very_large_positive300.0 * EPS * abs( expected )254large_positive600.0 * EPS * abs( expected )689medium_positive300.0 * EPS * abs( expected )395small_positive1800.0 * EPS * abs( expected )2338smaller4.5 * EPS * abs( expected )5tiny_positive8.0 * EPS * abs( expected )1huge_positive4500.0 * EPS * abs( expected )1200positive_gamut16.0 * EPS * abs( expected )27These are the measured minima. Starting from a high bound and tightening, each value above is the smallest integer for which the corresponding fixture set passes in full: decrementing every bound by one fails 1934 of 41646 assertions (exactly one point per set, except
tiny_positive, where a bound of0degrades to exact equality and fails 1927 points). The JavaScript and native (C) implementations agree exactly on every fixture point, so the same bounds apply to both test files.Only the two test files are changed; no source, documentation, or
package.jsonchanges are included.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
The
small_positive(2338) andhuge_positive(1200) bounds are large in absolute terms, but they are strictly tighter than the relative tolerances they replace and reflect the accuracy of the current implementation near the zeros ofY_1. Happy to instead round these to the nearest convenient value if reviewers prefer some headroom over the measured minimum.Other
Verification performed locally:
make test TESTS_FILTER=".*/math/base/special/bessely1/.*"—test/test.js41646 passing, 0 failing;test/test.native.js41646 passing, 0 failing. Run twice at the final bounds with identical results, so the bounds are not sensitive to FMA/arch variation on this machine.test/test.native.jswas exercised against a locally built addon (make install-node-addons NODE_ADDONS_PATTERN="bessely1"), so the native assertions ran rather than being skipped.make lint-javascript-tests TESTS_FILTER=".*/math/base/special/bessely1/.*"— clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code running as an unattended scheduled task. The test migration and the ULP bound search (start high, tighten to the minimum that still passes, then re-run to confirm determinism) were performed by the agent, following the idiom established in already-migrated packages in
math/base/special.@stdlib-js/reviewers
Generated by Claude Code