Skip to content

Conversation

@Amansingh0807
Copy link
Contributor

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: passed
  • task: lint_package_json status: passed
  • task: lint_repl_help status: passed
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: passed
  • task: lint_javascript_tests status: passed
  • 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: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: passed
  • task: lint_license_headers status: passed ---

Resolves none

Description

What is the purpose of this pull request?

This pull request:

  • add constants/float16/gamma-lanczos-g

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • Resolves None

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.

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.".


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 13, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 13, 2025

Coverage Report

Package Statements Branches Functions Lines
constants/float16/gamma-lanczos-g $\color{green}47/47$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}0/0$
$\color{green}+0.00%$
$\color{green}47/47$
$\color{green}+0.00%$

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

Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
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.

Thanks!

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Dec 13, 2025
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Dec 13, 2025
@stdlib-bot
Copy link
Contributor

PR Commit Message

feat: add `constants/float16/gamma-lanczos-g`

PR-URL: https://github.com/stdlib-js/stdlib/pull/9022

Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>

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

@Planeshifter Planeshifter merged commit 8269957 into stdlib-js:develop Dec 13, 2025
30 checks passed
@stdlib-bot stdlib-bot removed the Ready To Merge A pull request which is ready to be merged. label Dec 13, 2025
@kgryte
Copy link
Member

kgryte commented Dec 15, 2025

@Amansingh0807 How did you derive the value of this constant? Do you have any sources you can share?

@kgryte
Copy link
Member

kgryte commented Dec 15, 2025

cc @Planeshifter

kgryte added a commit that referenced this pull request Dec 15, 2025
The value added in #9022 is not appropriate for half-precision
numerical approximation. As observed for the equivalent `float64`
and `float32` constants, the value we use for `g` depends on what
approximation we use in our gamma function implementations. In
general, we should only add this constant if and when we add a
half-precision gamma approximation. Something we are not likely
to do anytime soon.

BREAKING CHANGE: remove `constants/float16/lanczos-gamma-g`

This feature was only recently added and has not been published.
As such, the impact of removing this constant should be negligible
for downstream users.

Ref: #9022

---
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: 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
---
@kgryte
Copy link
Member

kgryte commented Dec 15, 2025

@Amansingh0807 After a bit of sanity checking, what you chose for the constant in this PR is a common value for approximating the gamma function in double-precision. That is not appropriate for half-precision. As observed for constants/float64/gamma-lanczos-g and constants/float32/gamma-lanczos-g, what value we use for g depends on what approximation we use in our gamma function implementations. What you provided here would not be what we used.

So, unfortunately, this PR should not have been merged, and I've reverted the addition in e2902df. For future reference, for some of these constants, they only make sense within the context of actual implementations, and, as we will not be adding a half-precision approximation of the gamma function anytime soon, this constant is not needed. Accordingly, it can be useful to first sanity check with maintainers to determine which constants, if any, we are interested in adding to the project.

Hope this clarifies things, and sorry for the miscommunication.

@Amansingh0807
Copy link
Contributor Author

Thanks for the clarification @kgryte.

This context helps a lot. From my side, I treated this similar to other constants that already exist across precisions and followed commonly used Lanczos parameters as a reference, assuming consistency would be acceptable.

I understand that gamma-lanczos-g is tightly coupled to the specific Gamma implementation and its chosen approximation, and since there’s no planned float16 Gamma implementation, adding this constant independently doesn’t really fit.

Thanks for explaining the rationale and reverting the change, the reasoning is clear now. I will make sure to check in advance for constants that are implementation-dependent rather than intrinsic.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants