Skip to content

test: migrate math/base/special/gamma-lanczos-sum-expg-scaledf to ULP-based testing - #13801

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-gamma-lanczos-sum-expg-scaledf
Draft

test: migrate math/base/special/gamma-lanczos-sum-expg-scaledf to ULP-based testing#13801
Planeshifter wants to merge 1 commit into
developfrom
philipp/ulp-gamma-lanczos-sum-expg-scaledf

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Migrates math/base/special/gamma-lanczos-sum-expg-scaledf from relative-tolerance testing to ULP-difference testing, per the guidance in #11352.

  • test/test.js and test/test.native.js: replaced the tol = 2.0 * EPS * absf( expected ) / delta <= tol check with isAlmostSameValue( y, expected, 2 ) from @stdlib/number/float32/base/assert/is-almost-same-value (the float32-specific variant, appropriate since this package operates on single-precision values).
  • Final ULP bound: 2 (same value used in both test.js and test.native.js, matching the identical tolerance formula the original tests used for both).
  • Measured minimum: ran the 500-point fixture set (linspace( 1.0, 100.0, 500 )) directly against @stdlib/number/float32/base/ulp-difference; the maximum observed ULP difference across all points was exactly 2 (confirmed deterministic over two runs). A bound of 1 fails 45/500 assertions, confirming 2 is the tightest integer bound.
  • test.native.js could not be executed in this environment (native addon not prebuilt), so its ULP bound is set to match test.js based on the original identical tolerance formula rather than an independent empirical measurement.
  • Only the two test files were changed; no package.json changes were needed (test-only requires aren't tracked as package dependencies in this repo).

Resolves a part of #11352.


Generated by Claude Code

…LP-based testing

Replace the relative-tolerance comparison in test.js and test.native.js
with `isAlmostSameValue` from `@stdlib/number/float32/base/assert/is-almost-same-value`,
using a measured minimum ULP bound of 2.

Resolves a part of #11352.
@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jul 31, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label Jul 31, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/gamma-lanczos-sum-expg-scaledf $\\color{red}266/269$
$\\color{green}+98.88\\%$
$\\color{red}9/11$
$\\color{green}+81.82\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{red}266/269$
$\\color{green}+98.88\\%$

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants