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/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 11, 2025
@nakul-krishnakumar
Copy link
Member Author

I was not able to pass all tests, but I could not figure out what part of the implementation was wrong. It would be really helpful if someone could help me fix it. I have attached the failing test cases below ( v - actual, e - expected ):
image
If I am not wrong, it is failing for this branch of the implementation:

	if ( x < HALF ) {
		t = f32( x + x );
		t = f32( HALF * log1pf( t + f32( t * f32( x / f32( ONE-x ) ) ) ) );

Reference Implementation:
https://svnweb.freebsd.org/base/release/9.3.0/lib/msun/src/e_atanhf.c?view=markup

@nakul-krishnakumar nakul-krishnakumar marked this pull request as draft December 11, 2025 17:11
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Dec 11, 2025
@Neerajpathak07
Copy link
Member

@nakul-krishnakumar normally when the test cases fail for smaller margins between the actual and expected values then there are 2 things to look after.

  1. The package( atanhf ) was not implemented correctly according to the upstream implementation.
  2. The test cases need to be looked after closely, check whether float64ToFloat32 is wrapped properly around elements and gives out value inside the precision limit.

@anandkaranubc correct me if I am missing something!!

@nakul-krishnakumar
Copy link
Member Author

@nakul-krishnakumar normally when the test cases fail for smaller margins between the actual and expected values then there are 2 things to look after.

1. The package( atanhf ) was not implemented correctly according to the upstream implementation.

2. The test cases need to be looked after closely, check whether `float64ToFloat32` is wrapped properly around elements and gives out value inside the precision limit.

@anandkaranubc correct me if I am missing something!!

Okay, I will have a closer look around the above mentioned areas, thank you for the help! ❤️

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.

3 participants