Skip to content

test: migrate math/base/special/cotd to ULP-based testing - #13732

Merged
kgryte merged 1 commit into
developfrom
philipp/ulp-cotd
Jul 29, 2026
Merged

kgryte merged 1 commit into
developfrom
philipp/ulp-cotd

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 the tests for @stdlib/math/base/special/cotd (test.js and test.native.js) from relative-tolerance (EPS-scaled delta/tol) comparisons to ULP-based comparisons using @stdlib/assert/is-almost-same-value.
  • Empirically determined the minimum required ULP bound by computing the actual maximum ULP difference between the JS/native implementations and the Julia fixture data (negative.json and positive.json), then confirming the tests fail at maxULP - 1 and pass deterministically (verified over multiple runs) at the chosen bound.
  • Final ULP constant: 3 (used identically in both test.js and test.native.js; the native add-on was built locally and produces the same maximum ULP difference as the JS implementation).

Related Issues

This pull request has the following related issues:

Questions

No.

Other

No.

Checklist


Generated by Claude Code

@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 28, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/cotd $\\color{green}176/176$
$\\color{green}+100.00\\%$
$\\color{green}5/5$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}176/176$
$\\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 Jul 29, 2026
@kgryte
kgryte marked this pull request as ready for review July 29, 2026 00:34
@kgryte
kgryte requested a review from a team July 29, 2026 00:34
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 29, 2026
@kgryte
kgryte merged commit fd92d62 into develop Jul 29, 2026
86 checks passed
@kgryte
kgryte deleted the philipp/ulp-cotd branch July 29, 2026 00:35
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jul 29, 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.

4 participants