Skip to content

Conversation

@nakul-krishnakumar
Copy link
Member


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: passed
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: passed
  • task: lint_c_examples status: passed
  • task: lint_c_benchmarks status: passed
  • 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 a part of #649 .

Description

What is the purpose of this pull request?

This pull request:

  • Adds math/base/special/fast/atanhf.

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.

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

None.


@stdlib-js/reviewers

---
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: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: passed
  - task: lint_c_benchmarks
    status: passed
  - 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
---
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Dec 14, 2025
@nakul-krishnakumar
Copy link
Member Author

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Dec 14, 2025
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 14, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 14, 2025

Coverage Report

Package Statements Branches Functions Lines
math/base/special/fast/atanhf $\color{green}188/188$
$\color{green}+0.00%$
$\color{green}10/10$
$\color{green}+0.00%$
$\color{green}2/2$
$\color{green}+0.00%$
$\color{green}188/188$
$\color{green}+0.00%$

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


```c
float out = stdlib_base_fast_atanhf( 0.0f );
// returns 0.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// returns 0.0
// returns 0.0f

// returns 0.0

out = stdlib_base_fast_atanhf( -0.0f );
// returns -0.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// returns -0.0
// returns -0.0f

int i;

for ( i = 0; i < 100; i++ ) {
x = ( (float)rand() / (float)RAND_MAX ) * 100.0f;
Copy link
Member

@gunjjoshi gunjjoshi Dec 31, 2025

Choose a reason for hiding this comment

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

@nakul-krishnakumar The domain of atanhf is restricted to [-1.0, 1.0]. But here, you are generating example values in the [0, 100) domain. We'll need to change this. You can do something like this: https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/math/base/special/fast/atanh/examples/c/example.c

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for the review, I will update as suggested! @gunjjoshi

int i;

for ( i = 0; i < 100; i++ ) {
x = ( (float)rand() / (float)RAND_MAX ) * 100.0f;
Copy link
Member

Choose a reason for hiding this comment

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

Same comment regarding the domain of atanhf.

int i;

for ( i = 0; i < 100; i++ ) {
x[ i ] = random_uniform( 0.0f, 100.0f );
Copy link
Member

Choose a reason for hiding this comment

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

Same thing here. We must generate values between [-1.0, 1.0].

var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var randu = require( '@stdlib/random/base/randu' );
var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' );
var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zero' );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zero' );
var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );

{
"name": "@stdlib/math/base/special/fast/atanhf",
"version": "0.0.0",
"description": "Compute the hyperbolic arctangent of single-precision floating-point number.",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"description": "Compute the hyperbolic arctangent of single-precision floating-point number.",
"description": "Compute the hyperbolic arctangent of a single-precision floating-point number.",

@gunjjoshi gunjjoshi added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Dec 31, 2025
---
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: passed
  - 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
---
---
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: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - 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
---
@nakul-krishnakumar
Copy link
Member Author

@gunjjoshi Thank you for the review! I have made all the requested changes.

@nakul-krishnakumar
Copy link
Member Author

/stdlib update-copyright-years

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jan 1, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jan 1, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jan 1, 2026
@kgryte kgryte removed the Needs Changes Pull request which needs changes before being merged. label Jan 2, 2026
@kgryte
Copy link
Member

kgryte commented Jan 5, 2026

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Jan 5, 2026
@kgryte kgryte requested a review from anandkaranubc January 5, 2026 23:31
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Jan 5, 2026
Signed-off-by: Philipp Burckhardt <[email protected]>
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.

PR is in great shape now, thank you @nakul-krishnakumar and @gunjjoshi for reviews!

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Jan 7, 2026
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Jan 7, 2026

PR Commit Message

feat: add `math/base/special/fast/atanhf`

PR-URL: https://github.com/stdlib-js/stdlib/pull/9046
Ref: https://github.com/stdlib-js/stdlib/issues/649

Co-authored-by: Philipp Burckhardt <[email protected]>
Co-authored-by: stdlib-bot <[email protected]>
Reviewed-by: Philipp Burckhardt <[email protected]>
Reviewed-by: Gunj Joshi <[email protected]>
Signed-off-by: Nakul Krishnakumar <[email protected]>
Signed-off-by: Philipp Burckhardt <[email protected]>

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

⚠️ Action Required: This PR references tracking issues. Please update the PR description to replace any "Closes", "Fixes", or "Resolves" keywords with "Ref" when referencing these issues.

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jan 7, 2026
@Planeshifter Planeshifter merged commit cb09f58 into stdlib-js:develop Jan 7, 2026
31 checks passed
@stdlib-bot stdlib-bot removed the Ready To Merge A pull request which is ready to be merged. label Jan 7, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants