Repository navigation
test: migrate stats/base/dists/logistic/median to ULP-based assertions - #15999
Merged
Merged
Conversation
Replace relative tolerance assertions with ULP difference assertions using `@stdlib/assert/is-almost-same-value`. All one hundred fixture values match bitwise, so the minimum required ULP bound is `0`. Ref: #11352 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Nh3iDy9gFehtejnTZ9Gg1
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
marked this pull request as ready for review
October 11, 2026 12:44
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/logistic/medianfrom relative tolerance testing to ULP difference testing.delta/tolcomputation and thet.ok( delta <= tol, ... )assertion witht.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );.@stdlib/assert/is-almost-same-valueimport and removes the now unused@stdlib/math/base/special/absand@stdlib/constants/float64/epsimports.The final ULP constant is
0, which is the measured minimum. Starting from a high bound and tightening, every one of the 100 non-nullfixture values intest/fixtures/julia/data.jsonmatches the returned value bitwise, so no ULP slack is required. This matches the bound used in the sibling packagestats/base/dists/logistic/mode(#15597). The test suite was run twice at the final bound to confirm determinism (110 passing, 0 failing on both runs).Only
test/test.jsis changed.test/test.native.jscontains no relative tolerance assertions (it compares the returned value againstmu[i]exactly), so it is left untouched, consistent with the siblinglogistic/modemigration.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
Verification performed locally:
make test TESTS_FILTER=".*/stats/base/dists/logistic/median/.*"→ 110 passing, 0 failing (run twice).eslint -c etc/eslint/.eslintrc.tests.json the changed file → clean.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored by Claude Code. The migration mirrors the idiom established in the already-merged sibling migration (#15597), and the minimum ULP bound was measured empirically over the full fixture set rather than assumed.
@stdlib-js/reviewers
Generated by Claude Code