Skip to content

test: migrate math/base/special/coth to ULP-based testing#13635

Merged
kgryte merged 1 commit into
developfrom
philipp/ulp-coth
Jul 24, 2026
Merged

test: migrate math/base/special/coth to ULP-based testing#13635
kgryte merged 1 commit into
developfrom
philipp/ulp-coth

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 test/test.js and test/test.native.js in math/base/special/coth from relative-tolerance (EPS-based) assertions to ULP-difference assertions via @stdlib/assert/is-almost-same-value, using the minimum required ULP values verified by direct ULP-difference computation over all test fixtures: the data fixture requires a maximum ULP of 2; the tiny_negative, tiny_positive, large_negative, and large_positive fixtures match exactly and thus use plain t.strictEqual.
  • 2 was confirmed to be the tightest bound (an ULP of 1 produces failures across the data fixture); the test suite was run twice at the final bound to confirm no flakiness.

The native (C) addon could not be built/exercised in this environment (no prebuilt addon present and native module builds are unavailable here), so test.native.js was updated to mirror the same tolerances as test.js, consistent with the precedent set by prior conversions of the closely-related sinh/csch packages, which found no JS-vs-C divergence for this class of function.

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.

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 written primarily by Claude Code (running as an unattended scheduled task), including the test migration and the computation/verification of minimum ULP tolerances directly against the fixtures.


@stdlib-js/reviewers


Generated by Claude Code

Replaces the EPS-based relative-tolerance comparisons in test.js and
test.native.js with @stdlib/assert/is-almost-same-value, using the
minimum required ULP values verified against the fixtures.

Resolves a part of #11352.
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Good First PR A pull request resolving a Good First Issue. labels Jul 24, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/coth $\\color{green}164/164$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}164/164$
$\\color{green}+100.00\\%$

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

@Planeshifter
Planeshifter marked this pull request as ready for review July 24, 2026 05:17
@Planeshifter
Planeshifter requested a review from a team July 24, 2026 05:17
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 24, 2026
@Planeshifter
Planeshifter requested a review from kgryte July 24, 2026 05:17
@kgryte kgryte added Tests Pull requests specifically adding tests. and removed Needs Review A pull request which needs code review. labels Jul 24, 2026
@kgryte
kgryte merged commit dadb5e1 into develop Jul 24, 2026
88 checks passed
@kgryte
kgryte deleted the philipp/ulp-coth branch July 24, 2026 21:41
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.

4 participants