Repository navigation
test: migrate stats/base/dists/chisquare/median to ULP-based assertions - #14545
Merged
Merged
Conversation
…ions Replace the relative tolerance assertions in the fixture loop with `@stdlib/assert/is-almost-same-value` ULP difference assertions. The ULP bound was tightened to the measured minimum which passes over the full fixture set (39 ULP; 38 ULP fails). Resolves a part of #11352. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MAEBRF5LEKrKy5oLKGLSHB
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #11352.
Description
This pull request:
stats/base/dists/chisquare/mediantests from relative tolerance testing to ULP difference testing.var delta/var toltolerance math (previouslytol = 25.0 * EPS * abs( expected[ i ] )) and the associatedt.ok( delta <= tol, ... )assertion witht.strictEqual( isAlmostSameValue( y, expected[ i ], 39 ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valuerequire and drops the now-unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires.Only
test/test.jsis modified; the package has notest/test.native.js.Final ULP constant:
39for thetest/test.jsfixture loop (test/fixtures/julia/data.json, 50 values).Measured minimum:
39is the tightest bound. Running the package test suite at38fails one assertion (worst case:k = 0.20785020415982736, returned0.0015467191018913129vs. expected0.0015467191018913044);39passes all 55 assertions. The suite was run twice at39to confirm the result is deterministic on this machine.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
This PR was authored by Claude Code running as an unattended scheduled task: it selected the package, studied already-migrated packages to mirror the project's idiom, applied the test changes, and searched for the minimum passing ULP bound by running the package test suite.
@stdlib-js/reviewers
Generated by Claude Code