Skip to content

feat: add C implementation for stats/base/dists/binomial/cdf #3897

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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

AadishJ
Copy link
Contributor

@AadishJ AadishJ commented Dec 13, 2024

Resolves #3448.

Description

What is the purpose of this pull request?

This pull request:

  • Adds a C implementation of the binomial cumulative distribution function (CDF).
  • Includes benchmarks for the C implementation.
  • Provides examples demonstrating the usage of the binomial CDF in C.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

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 Needs Review A pull request which needs code review. label Dec 13, 2024
@stdlib-bot
Copy link
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
Copy link
Contributor

stdlib-bot commented Dec 13, 2024

Coverage Report

Package Statements Branches Functions Lines
math/base/napi/ternary $\color{green}155/155$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}155/155$
$\color{green}+100.00\%$
stats/base/dists/binomial/cdf $\color{green}327/327$
$\color{green}+100.00\%$
$\color{green}33/33$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}327/327$
$\color{green}+100.00\%$

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

@AadishJ AadishJ closed this Dec 13, 2024
@AadishJ AadishJ reopened this Dec 13, 2024
@AadishJ AadishJ changed the title feat: add C implementation for binomial CDF feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf Dec 14, 2024
@Planeshifter Planeshifter changed the title feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf Dec 14, 2024
@Planeshifter Planeshifter changed the title feat: add C implementation for @stdlib/stats/base/dists/binomial/cdf feat: add C implementation for stats/base/dists/binomial/cdf Dec 15, 2024
@AadishJ AadishJ marked this pull request as draft December 15, 2024 06:08
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Dec 15, 2024
@AadishJ AadishJ marked this pull request as ready for review December 15, 2024 06:15
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 15, 2024
@Neerajpathak07
Copy link
Member

@AadishJ adding include ternary.h file in your commit it is not necessary for this issue as you might have seen it reflects the code coverage for that file as well.
Same for the main.c file as well.

@AadishJ
Copy link
Contributor Author

AadishJ commented Dec 19, 2024

Hey @Neerajpathak07 , I included the ternary as there was nothing made for a long long double previously so I made it for myself , is it incorrect and if so how should I do it correctly?

@Neerajpathak07
Copy link
Member

image
Once you remove these two files from your commit the unnecessary code coverage for ternary should also be removed.

@AadishJ
Copy link
Contributor Author

AadishJ commented Dec 20, 2024

Hey, @Neerajpathak07 I totally understand what you are saying but there are some important changes in those files as I have created the long long double version in them which did not exist before so removing those files would break my code, please let me know if I am thinking wrong or is there another way to do this. Thanks.

@Neerajpathak07
Copy link
Member

@AadishJ Ok then,

return betainc( p, x + 1.0, n - x, true, true );
return stdlib_base_betainc( p, x + 1.0, n - x, true, true );

but also you will be requiring stdlib_base_betainc for main.c but there are No C implementations for betainc so this PR might have to wait until we have that merged.
Refer:- #3986

@AadishJ
Copy link
Contributor Author

AadishJ commented Dec 20, 2024

That's completely fine. Thanks for the review

@Planeshifter
Copy link
Member

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jun 18, 2025
@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. and removed bot: In Progress Pull request is currently awaiting automation. labels Jun 18, 2025
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. 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 @stdlib/stats/base/dists/binomial/cdf
4 participants