test: migrate stats/base/dists/triangular/logcdf to ULP-based assertions - #14868
Draft
kgryte wants to merge 1 commit into
Draft
test: migrate stats/base/dists/triangular/logcdf to ULP-based assertions#14868kgryte wants to merge 1 commit into
stats/base/dists/triangular/logcdf to ULP-based assertions#14868kgryte wants to merge 1 commit into
Conversation
…tions Ref: #11352 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018QvLfRiV8mNh5Kvr1h3NLF
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/triangular/logcdffrom relative tolerance assertions to ULP-based assertions using@stdlib/assert/is-almost-same-value.if ( y === expected[i] ) { ... } else { delta/tol ... }branches in the fixture-driven test cases witht.strictEqual( isAlmostSameValue( y, expected[ i ], N ), true, 'returns expected value' );.@stdlib/math/base/special/absand@stdlib/constants/float64/epsrequires, along with thedeltaandtoldeclarations.The previous assertions used a
10.0 * EPS * abs( expected[ i ] )relative tolerance. The ULP bounds below are the minimum values which pass over the full set of fixture values (1000 values per fixture) and are applied consistently intest/test.logcdf.js,test/test.factory.js, andtest/test.native.js:small_range.jsonxgiven a small rangeb - amedium_range.jsonxgiven a medium rangeb - alarge_range.jsonxgiven a large rangeb - aMinimality was verified by lowering the bounds by one ULP and confirming test failures (
6→5and11→10both fail; the medium range bound is already exact). The measured maximum ULP differences over each fixture are6,0, and11, respectively, and are identical for the JavaScript and C implementations, so the same bounds are used intest/test.native.js.The suite was run twice at the final bounds, with all assertions passing in both runs (
make test TESTS_FILTER=".*/stats/base/dists/triangular/logcdf/.*"): 3012 (test.logcdf.js), 3022 (test.factory.js), 3 (test.js), and 3012 (test.native.js, run against a locally built add-on). Only test files are changed.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 written by Claude Code, which performed the test migration and empirically determined the minimum ULP bounds.
@stdlib-js/reviewers
Generated by Claude Code