Skip to content

feat: add C implementation for math/base/special/gammainc #7408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
var largeXSmallS = require( './fixtures/cpp/large_x_small_s.json' );
var largeXMediumS = require( './fixtures/cpp/large_x_medium_s.json' );

// TODO: Add this to `test.js` once the JS implementation matches the latest Boost C++ implementation.

Check warning on line 46 in lib/node_modules/@stdlib/math/base/special/gammainc/test/test.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'todo' comment: 'TODO: Add this to `test.js` once the JS...'
var largeXLargeS = require( './fixtures/cpp/large_x_large_s.json' );


Expand Down Expand Up @@ -447,8 +447,8 @@
t.strictEqual( isSameValue( actual, PINF ), true, 'returns expected value' );
continue;
}
// NOTE: The difference is high because some of the expected values are very large.
t.strictEqual( ulpdiff( actual, expected[ i ] ) <= 534, true, 'returns expected value within 534 ulp' );
// NOTE: The difference is high because some of the expected values are very large and the compiler optimizations have been disabled.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a note for future reference: this was done because the workflows build the native addons with the CFLAGS="-ffp-contract=off" flag. If this flag is not set, the tests pass with the ULP difference observed in the previous commit.

t.strictEqual( ulpdiff( actual, expected[ i ] ) <= 947, true, 'returns expected value within 947 ulp' );
}
t.end();
});
Expand All @@ -470,8 +470,8 @@
t.strictEqual( isSameValue( actual, PINF ), true, 'returns expected value' );
continue;
}
// NOTE: The difference is high because some of the expected values are very large.
t.strictEqual( ulpdiff( actual, expected[ i ] ) <= 969, true, 'returns expected value within 969 ulp' );
// NOTE: The difference is high because some of the expected values are very large and the compiler optimizations have been disabled.
t.strictEqual( ulpdiff( actual, expected[ i ] ) <= 1544, true, 'returns expected value within 1544 ulp' );
}
t.end();
});