Skip to content

Use EPS instead of 0.1 in C benchmark files#10194

Closed
HWKDS wants to merge 1 commit intostdlib-js:developfrom
HWKDS:feature/use-eps-in-benchmark-files
Closed

Use EPS instead of 0.1 in C benchmark files#10194
HWKDS wants to merge 1 commit intostdlib-js:developfrom
HWKDS:feature/use-eps-in-benchmark-files

Conversation

@HWKDS
Copy link
Copy Markdown

@HWKDS HWKDS commented Feb 10, 2026

Replace hardcoded 0.1 constant with STDLIB_CONSTANT_FLOAT64_EPS in statistical distribution benchmark files for non-zero positive lower bounds.

Ref: #10174


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 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: na
  • task: lint_c_benchmarks status: missing_dependencies
  • 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

Resolves #10174.

Description

What is the purpose of this pull request?

This pull request:

  • Replaces hardcoded 0.1 constant with STDLIB_CONSTANT_FLOAT64_EPS in C benchmark files for statistical distributions
  • Adds #include "stdlib/constants/float64/eps.h" to affected benchmark files
  • Updates 47 benchmark files across 13 statistical distributions (Chi, Chi-square, Inverse Gamma, Kumaraswamy, Levy, Lognormal, Negative Binomial, Normal, Pareto Type 1, Planck, Poisson, Student's t, and Weibull)

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.

The changes follow a consistent pattern across all files:

  • Added the EPS header include after other stdlib includes
  • Replaced random_uniform(0.1, max) with random_uniform(STDLIB_CONSTANT_FLOAT64_EPS, max) for distribution parameters that must be strictly positive
  • Did not modify parameters that can legitimately be zero (e.g., location parameters)

Checklist

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

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • [] Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

I consulted GitHub Copilot to understand the issue requirements, contributing guidelines, and Git workflow. The code changes were implemented manually by me following the RFC specifications. Copilot assisted with documentation and PR formatting.


@stdlib-js/reviewers

Replace hardcoded 0.1 constant with STDLIB_CONSTANT_FLOAT64_EPS
in statistical distribution benchmark files for non-zero positive
lower bounds.

Ref: stdlib-js#10174

---
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
    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: na
  - task: lint_c_benchmarks
    status: missing_dependencies
  - 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
---
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Feb 10, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"

# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"

If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR.

If you have any further questions while waiting for a response, please join our Zulip community to chat with project maintainers and other community members.

We appreciate your contribution!

Documentation Links

@HWKDS
Copy link
Copy Markdown
Author

HWKDS commented Feb 10, 2026

/stdlib help

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Feb 10, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

@HWKDS, available slash commands include:

  • /stdlib check-files - Check for required files.
  • /stdlib make-commands - Print make commands for package changed in PR.
  • /stdlib update-copyright-years - Update copyright header years.
  • /stdlib lint-autofix - Auto-fix lint errors.
  • /stdlib merge - Merge changes from develop branch into this PR.
  • /stdlib rebase - Rebase this PR on top of develop branch.

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Feb 10, 2026
@HWKDS
Copy link
Copy Markdown
Author

HWKDS commented Feb 10, 2026

/stdlib lint-autofix

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Feb 10, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

/stdlib lint-autofix

@HWKDS, the slash command failed to complete. Please check the workflow logs for details.

View workflow run

@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Feb 10, 2026
@kgryte kgryte added wont-fix Unable and/or unwilling to resolve concern due to inapplicability or lack of problem definition. and removed Needs Review A pull request which needs code review. labels Feb 10, 2026
@kgryte
Copy link
Copy Markdown
Member

kgryte commented Feb 10, 2026

See comment in #10174 (comment).

@kgryte kgryte closed this Feb 10, 2026
@HWKDS
Copy link
Copy Markdown
Author

HWKDS commented Feb 10, 2026

Sure, my bad> See comment in #10174 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Statistics Issue or pull request related to statistical functionality. wont-fix Unable and/or unwilling to resolve concern due to inapplicability or lack of problem definition.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Use EPS instead of 0.1 as lower limit in non-zero positive constants present in C benchmark files

3 participants