Skip to content
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

feat: add C implementation for math/base/special/gammaln #2636

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

gunjjoshi
Copy link
Member

@gunjjoshi gunjjoshi commented Jul 20, 2024

Resolves #1988.

Description

What is the purpose of this pull request?

This pull request:

double stdlib_base_gammaln( const double x );

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

Shall I change both test.js and test.native.js to use tolerance of the form 1.0 * EPS here? We have a high amount of tolerance required here as well, just like math/base/special/gamma.

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.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jul 20, 2024
@kgryte
Copy link
Member

kgryte commented Jul 20, 2024

Shall I change both test.js and test.native.js to use tolerance of the form 1.0 * EPS here?

Yes, I think that would be good.

@Planeshifter Planeshifter self-requested a review July 20, 2024 17:01
@Planeshifter Planeshifter added the Needs Review A pull request which needs code review. label Jul 26, 2024
@gunjjoshi
Copy link
Member Author

I've made changes in both C and javascript implementations, according to the latest version, and have updated the links.

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

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

Let's land this PR.

I investigated and found that Julia is way closer to our implementation (8.5 * EPS to get tests to pass), so that the large tolerances are due to R using a different algorithm. We should add Julia test fixtures and use them in the unit tests, but that can be done in a follow-up PR.

@Planeshifter Planeshifter merged commit d745814 into stdlib-js:develop Aug 2, 2024
8 checks passed
@gunjjoshi
Copy link
Member Author

Thanks for checking this @Planeshifter! I'll make the changes in a follow-up PR.

@Planeshifter
Copy link
Member

@gunjjoshi Thank you!

It may also be useful to add Julia fixtures to gamma, as well. I propose we leave the r fixtures directory intact and just add another one for Julia, and update the test files to use the Julia ones.

@gunjjoshi gunjjoshi deleted the gammaln branch August 3, 2024 00:41
gunjjoshi added a commit to gunjjoshi/stdlib that referenced this pull request Aug 21, 2024
PR-URL: stdlib-js#2636
Ref: stdlib-js#649

Reviewed-by: Philipp Burckhardt <[email protected]> 
Reviewed-by: Athan Reines <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: add C implementation for math/base/special/gammaln
4 participants