test: migrate stats/base/dists/cauchy/logcdf to ULP-based assertions - #15367
Planeshifter wants to merge 1 commit into
Conversation
Replaces relative-tolerance (EPS-based) comparisons in the fixture-driven test cases with `@stdlib/assert/is-almost-same-value` ULP-difference assertions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012tvj9d3aJCYgSsmTcKwDZ5 --- 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 ---
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
An automated check found potentially unrelated issue/PR references in this PR:
Why this matters: GitHub automatically closes issues referenced with What to do:
This assessment was generated by an AI model and is informational only. Generated by Claude Code |
|
Thank you for working on this pull request. However, we cannot accept your contribution as the issue this pull request seeks to resolve has already been addressed in a different pull request or commit. Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. |
Resolves a part of #11352.
Description
This pull request:
Migrates the test suite for
stats/base/dists/cauchy/logcdffrom relative-tolerance (EPS-based) assertions to ULP-difference assertions, per the guidance in [RFC]: Migratemath/base/specialpackages from relative tolerance testing to ULP difference testing (tracking issue) #11352.Replaces the
var delta = abs( y - expected[ i ] ); var tol = <N> * EPS * abs( expected[ i ] ); t.ok( delta <= tol, ... )pattern intest/test.logcdf.js,test/test.factory.js, andtest/test.native.jswitht.strictEqual( isAlmostSameValue( y, expected[ i ], <ulp> ), true, 'returns expected value' ), adding the@stdlib/assert/is-almost-same-valueimport to each file.Uses the minimum required ULP value for each fixture block, determined by measuring the actual ULP difference between computed and expected values using
@stdlib/number/float64/base/ulp-difference(verified by building and running the native addon locally, and running the full suite twice to confirm determinism):large_gammafixture:9ULPnegative_medianfixture:12ULPpositive_medianfixture:6ULPThese bounds are identical across
test.logcdf.js,test.factory.js, andtest.native.js, since the JS and native (C) implementations produced identical outputs in local testing.test/test.jswas left unchanged, as it contains no tolerance-based assertions.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, run as an autonomous scheduled task on my account to work through the ULP migration tracking issue (#11352) one package at a time. It selected this package by scanning for the relative-tolerance idiom, studied prior converted packages (e.g.,
stats/base/dists/levy/logcdf,stats/base/dists/gumbel/cdf,stats/base/dists/negative-binomial/cdf) to mirror the established idiom, and empirically measured the tightest ULP bound for each fixture block rather than guessing.@stdlib-js/reviewers
🤖 Generated with Claude Code
https://claude.ai/code/session_012tvj9d3aJCYgSsmTcKwDZ5
Generated by Claude Code