Skip to content

feat: add C implementation for stats/base/dists/lognormal/logcdf#10882

Merged
Planeshifter merged 2 commits into
stdlib-js:developfrom
rautelaKamal:feat/stats/base/dists/lognormal/logcdf-c-port
Jul 5, 2026
Merged

feat: add C implementation for stats/base/dists/lognormal/logcdf#10882
Planeshifter merged 2 commits into
stdlib-js:developfrom
rautelaKamal:feat/stats/base/dists/lognormal/logcdf-c-port

Conversation

@rautelaKamal

Copy link
Copy Markdown
Contributor

Description

What is the purpose of this pull request?

This pull request:

  • Adds a C implementation for evaluating the natural logarithm of the cumulative distribution function (CDF) of a lognormal distribution (@stdlib/stats/base/dists/lognormal/logcdf). Following the pattern of the JS version, the C logic log-transforms the input x and elegantly delegates to the existing C implementation of @stdlib/stats/base/dists/normal/logcdf.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

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.

AI Assistance Disclosure

  • Yes
  • No

If yes, how was AI used?
I used an AI coding assistant to help generate the C native addon boilerplate, manifest files, and safely mirror the JS test logic/R fixtures into the native test files. I manually reviewed all outputs and verified compilation.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review. labels Mar 11, 2026
@stdlib-bot

stdlib-bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/lognormal/logcdf $\\color{green}281/281$
$\\color{green}+0.00\\%$
$\\color{green}18/18$
$\\color{green}+0.00\\%$
$\\color{green}4/4$
$\\color{green}+0.00\\%$
$\\color{green}281/281$
$\\color{green}+0.00\\%$

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

@rautelaKamal rautelaKamal marked this pull request as draft March 12, 2026 00:41
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Mar 12, 2026
@rautelaKamal rautelaKamal force-pushed the feat/stats/base/dists/lognormal/logcdf-c-port branch 3 times, most recently from 960fd26 to 36f518d Compare March 12, 2026 15:35
@rautelaKamal rautelaKamal marked this pull request as ready for review March 12, 2026 15:47
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 12, 2026
@rautelaKamal rautelaKamal force-pushed the feat/stats/base/dists/lognormal/logcdf-c-port branch from 36f518d to 6ecc2de Compare April 1, 2026 11:21
@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
@rautelaKamal rautelaKamal force-pushed the feat/stats/base/dists/lognormal/logcdf-c-port branch from 6ecc2de to e454f06 Compare April 4, 2026 07:48
@rautelaKamal rautelaKamal force-pushed the feat/stats/base/dists/lognormal/logcdf-c-port branch from e454f06 to 14489bd Compare April 12, 2026 07:01

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rautelaKamal You need to revert many of the changes made to this file.

} else {
delta = abs( y - expected[ i ] );
tol = 1500.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. sigma: '+sigma[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should go ahead and migrate to using isAlmostSameValue for ULP-based testing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've migrated the tests to use isAlmostSameValue for ULP-based testing in the latest push. This PR should be ready for re-review.

@kgryte kgryte changed the title feat: add C implementation for @stdlib/stats/base/dists/lognormal/logcdf feat: add C implementation for stats/base/dists/lognormal/logcdf Apr 12, 2026
@kgryte kgryte added difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Needs Changes Pull request which needs changes before being merged. review: 3 and removed Needs Review A pull request which needs code review. labels Apr 12, 2026
@rautelaKamal rautelaKamal force-pushed the feat/stats/base/dists/lognormal/logcdf-c-port branch from 14489bd to e705513 Compare April 13, 2026 07:06
@rautelaKamal rautelaKamal changed the title feat: add C implementation for stats/base/dists/lognormal/logcdf feat: add C implementation for stats/base/dists/lognormal/logcdf Apr 13, 2026
@rautelaKamal rautelaKamal force-pushed the feat/stats/base/dists/lognormal/logcdf-c-port branch from e705513 to 635e533 Compare April 13, 2026 08:53
@rautelaKamal rautelaKamal requested a review from a team April 20, 2026 13:14
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 20, 2026
@rautelaKamal rautelaKamal requested a review from kgryte April 20, 2026 13:28
rautelaKamal and others added 2 commits July 5, 2026 00:42
Use the Unicode `µ`/`σ` symbols and the uppercase `ln(F(x;µ,σ))`
notation in the C example, matching the JS example in the same README
and the canonical `normal/logcdf` sibling.

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: passed
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: passed
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@Planeshifter Planeshifter force-pushed the feat/stats/base/dists/lognormal/logcdf-c-port branch from 36f7eaf to c1be4c9 Compare July 5, 2026 05:43

@Planeshifter Planeshifter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's get it in...

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Jul 5, 2026
@Planeshifter Planeshifter changed the title feat: add C implementation for stats/base/dists/lognormal/logcdf feat: add C implementation for stats/base/dists/lognormal/logcdf Jul 5, 2026
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jul 5, 2026
@stdlib-bot

stdlib-bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

PR Commit Message

feat: add C implementation for `stats/base/dists/lognormal/logcdf`

PR-URL: https://github.com/stdlib-js/stdlib/pull/10882
Ref: https://github.com/stdlib-js/stdlib/issues/3750

Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>

Please review the above commit message and make any necessary adjustments.

@stdlib-bot stdlib-bot removed the Needs Changes Pull request which needs changes before being merged. label Jul 5, 2026
@Planeshifter Planeshifter merged commit 48157fa into stdlib-js:develop Jul 5, 2026
36 checks passed
@stdlib-bot stdlib-bot removed the Ready To Merge A pull request which is ready to be merged. label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Good First PR A pull request resolving a Good First Issue. review: 3 Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants