Repository navigation
Conversation
Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018j68UsJttt6xJ31FaoqeWi
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This branch has not been deployed
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/frechet/cdffrom relative tolerance testing to ULP difference testing, replacing thedelta/tolcomputations with@stdlib/assert/is-almost-same-value.The affected files are
test/test.cdf.js,test/test.factory.js, andtest/test.native.js. In each file, theabsand@stdlib/constants/float64/epsimports are dropped in favor ofisAlmostSameValue, and eachif ( y === expected[i] ) { ... } else { delta/tol ... }branch is collapsed into a singlet.strictEqual( isAlmostSameValue( y, expected[ i ], <ulp> ), true, 'returns expected value' );assertion.ULP bounds
Each fixture-driven test was tightened to the minimum integer ULP bound which still passes over the full 1000-element fixture set. The bounds below were measured per fixture file and verified to be minimal (each fails at
<ulp> - 1) for both the main export and the function returned byfactory:large_shape.json10.0 * EPS * abs( expected[i] )10large_scale.json10.0 * EPS * abs( expected[i] )1615both_large.json4100.0 * EPS * abs( expected[i] )59505949The larger bound for
both_large.jsonreflects the loss of relative precision inexp( -pow( z, -alpha ) )for large shape and scale parameters, where results are evaluated deep in the subnormal-adjacent range (e.g.,~1.16e-191); it is consistent with the previous4100 * EPSrelative tolerance. 93 of the 1000 fixture values in that set differ by more than 100 ULP.The test suite was run twice at the final bounds with identical results; the implementation relies on stdlib's own
expandpow, so the measured ULP differences are not subject to FMA/architecture variation.Related Issues
This pull request has the following related issues:
math/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352Questions
test/test.native.jsmirrors the JS bounds. The native add-on is not built in the environment used to prepare this pull request, so those tests were skipped and the native bounds could not be measured independently. Please let me know if the native bounds should be relaxed.Other
Verification performed:
make test TESTS_FILTER=".*/stats/base/dists/frechet/cdf/.*"→ 6050 assertions passing (test.cdf.js: 3022,test.factory.js: 3025,test.js: 3);test.native.jsskipped (no native add-on built).make eslint-tests TESTS_FILTER=".*/stats/base/dists/frechet/cdf/.*"→ clean.make FILES=... lint-license-headers-files→ clean.lint-editorconfig-filescould not run because theeditorconfig-checkerrelease binary could not be downloaded in this environment; the changed files were checked manually for tab indentation, LF line endings, no trailing whitespace, and a final newline.Only test files are changed; no source, documentation, or fixture files were touched.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This pull request was authored by Claude Code running as an unattended scheduled task. It studied the prior ULP migrations in this repository, applied the same idiom to this package, and measured the minimum passing ULP bounds empirically against the existing Julia fixtures.
@stdlib-js/reviewers
Generated by Claude Code