Skip to content

test: migrate math/base/special/erfcinv to ULP-based testing - #13761

Merged
kgryte merged 1 commit into
developfrom
philipp/ulp-erfcinv
Jul 30, 2026
Merged

kgryte merged 1 commit into
developfrom
philipp/ulp-erfcinv

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Resolves a part of #11352.

Description

This pull request migrates the tests for @stdlib/math/base/special/erfcinv (test/test.js and test/test.native.js) from relative-tolerance (EPS-scaled delta/tol) comparisons to ULP-difference assertions using @stdlib/assert/is-almost-same-value.

The seven fixture blocks each had a distinct tolerance multiplier in the original tests (3.0, 3.0, 3.0, 13.0, 14.0, 9.0, and 1.0 times EPS). Final ULP constants were determined empirically by computing the actual maximum ULP distance between the JS implementation's output and the Julia fixture data for each block, then confirming that the tests fail at N - 1 and pass deterministically (verified across two consecutive runs) at the chosen N:

Fixture interval Final ULP constant
[0.5, 1.5] 5
[0.25, 0.5] 3
[1.5, 1.75] 4
[1.75, 1.9998] 20
[0.0002, 0.25] 19
[1.9998, 1.9999..8] 11
[1.9999..8, 2] 1

The native add-on could not be built in this environment, so test.native.js assertions are skipped, but the file was updated identically to test.js (native add-on is expected to produce the same output 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 Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. labels Jul 29, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/erfcinv $\\color{red}630/659$
$\\color{green}+95.60\\%$
$\\color{red}43/56$
$\\color{green}+76.79\\%$
$\\color{green}7/7$
$\\color{green}+100.00\\%$
$\\color{red}630/659$
$\\color{green}+95.60\\%$

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

@kgryte kgryte added the Tests Pull requests specifically adding tests. label Jul 30, 2026
@kgryte
kgryte marked this pull request as ready for review July 30, 2026 02:25
@kgryte
kgryte requested a review from a team July 30, 2026 02:25
@kgryte
kgryte merged commit 8adbe79 into develop Jul 30, 2026
69 checks passed
@kgryte
kgryte deleted the philipp/ulp-erfcinv branch July 30, 2026 02:25
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Jul 30, 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