Skip to content

test: migrate math/base/special/fast/atanh to ULP-based assertions - #14457

Merged
kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-4ro8c3
Aug 21, 2026
Merged

kgryte merged 1 commit into
developfrom
claude/great-brahmagupta-4ro8c3

Conversation

@kgryte

@kgryte kgryte commented Aug 21, 2026

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

What is the purpose of this pull request?

This pull request:

  • migrates the tests for math/base/special/fast/atanh from relative tolerance testing (delta <= EPS * abs( expected )) to ULP difference testing using @stdlib/assert/is-almost-same-value.

Changes are confined to test/test.js and test/test.native.js. No source, documentation, benchmark, or fixture files were touched, and no test cases were added, removed, or reordered.

The measured minimum ULP bounds (the maximum observed ULP difference across the full fixture set, i.e. the smallest integer for which every case passes) are:

Test case Previous tolerance ULP bound Fixture size
negative values (fixtures/julia/negative.json) 500.0 * EPS * abs( expected ) 468 2003
positive values (fixtures/julia/positive.json) 650.0 * EPS * abs( expected ) 655 2003

Each bound was tightened to the minimum: 468 and 655 pass for every fixture value, while 467 and 654 do not.

The same bounds apply to both test.js and test.native.js. The native add-on was built locally, and the C implementation was verified to produce bit-identical results to the JavaScript implementation across both fixture files (max ULP difference of 468 and 655, respectively), so no JS/C divergence adjustment was required.

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.

Verification performed:

  • make test TESTS_FILTER=".*/math/base/special/fast/atanh/.*" — 6015 passing / 0 failing in test.js and 6015 passing / 0 failing in test.native.js. The suite was run twice at the final ULP values with identical results (no FMA/architecture-dependent variation observed).
  • ESLint with etc/eslint/.eslintrc.tests.js — clean for both changed files.

Checklist

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

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 by Claude Code running as an unattended scheduled task. It studied the migration guidance in #11352 and the already-migrated sibling packages (math/base/special/fast/asinh, math/base/special/fast/acosh) to mirror the established idiom, measured the ULP bounds empirically against the fixtures, and ran the test suite and linter locally.


@stdlib-js/reviewers


Generated by Claude Code

@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. and removed Good First PR A pull request resolving a Good First Issue. labels Aug 21, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/fast/atanh $\\color{green}186/186$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}186/186$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Aug 21, 2026
@kgryte
kgryte marked this pull request as ready for review August 21, 2026 05:50
@kgryte
kgryte requested a review from a team August 21, 2026 05:50
@kgryte
kgryte merged commit 1a14048 into develop Aug 21, 2026
67 checks passed
@kgryte
kgryte deleted the claude/great-brahmagupta-4ro8c3 branch August 21, 2026 05:51
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. and removed Needs Review A pull request which needs code review. labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants