Skip to content

test: migrate math/base/special/besselj1 to ULP-based testing - #13991

Open
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-besselj1
Open

test: migrate math/base/special/besselj1 to ULP-based testing#13991
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-besselj1

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates math/base/special/besselj1 test cases from relative-tolerance testing (delta <= EPS * multiplier * abs(expected)) to ULP-difference testing using @stdlib/assert/is-almost-same-value, per the conventions established in [RFC]: Migrate math/base/special packages from relative tolerance testing to ULP difference testing (tracking issue) #11352 (mirroring the already-converted sibling package math/base/special/besselj0).
  • applies the same conversion to both test/test.js and test/test.native.js.
  • for each fixture set, the minimum required ULP bound was determined empirically using @stdlib/number/float64/base/ulp-difference to compute the exact maximum ULP distance between actual and expected values across the full fixture, for both the JavaScript and native (C addon) implementations (which produced identical bounds):
    • veryLargePositive: 885
    • largePositive: 302
    • mediumPositive: 2870
    • smallPositive / smallNegative: 8
    • smaller: 5
    • tinyPositive / subnormal: 1
    • hugePositive: 4054
    • positiveGamut / negativeGamut: 31
  • the full test suite (test.js and test.native.js, 46,666 assertions each) was run twice at these bounds to confirm deterministic behavior (no FMA/arch-related flakiness).

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

  • Read, understood, and followed the [contributing guidelines][contributing].

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was authored autonomously by Claude Code (running as a scheduled task on behalf of the repository account owner), including package discovery, studying prior-art conversions, computing the minimum ULP bounds via @stdlib/number/float64/base/ulp-difference, and rewriting the test files. Opened as a draft for maintainer review given issue #11352 requests this task be done manually by first-time contributors where possible.


@stdlib-js/reviewers


Generated by Claude Code

Replaces relative-tolerance comparisons (delta <= EPS * multiplier) with
isAlmostSameValue ULP-difference assertions, using the minimum ULP bound
required to pass each fixture set.

Resolves a part of #11352

---
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
---
@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 6, 2026
@kgryte
kgryte marked this pull request as ready for review August 6, 2026 23:16
@kgryte
kgryte requested a review from a team August 6, 2026 23:16
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants