-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add math/base/special/fast/atanhf
#9046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add math/base/special/fast/atanhf
#9046
Conversation
---
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 update-copyright-years |
Coverage Report
The above coverage report was generated for the changes in this PR. |
|
|
||
| ```c | ||
| float out = stdlib_base_fast_atanhf( 0.0f ); | ||
| // returns 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // returns 0.0 | |
| // returns 0.0f |
| // returns 0.0 | ||
|
|
||
| out = stdlib_base_fast_atanhf( -0.0f ); | ||
| // returns -0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // returns -0.0 | |
| // returns -0.0f |
| int i; | ||
|
|
||
| for ( i = 0; i < 100; i++ ) { | ||
| x = ( (float)rand() / (float)RAND_MAX ) * 100.0f; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 ); |
There was a problem hiding this comment.
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' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "description": "Compute the hyperbolic arctangent of single-precision floating-point number.", | |
| "description": "Compute the hyperbolic arctangent of a single-precision floating-point number.", |
---
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
---
|
@gunjjoshi Thank you for the review! I have made all the requested changes. |
|
/stdlib update-copyright-years |
lib/node_modules/@stdlib/math/base/special/fast/atanhf/benchmark/c/native/benchmark.c
Outdated
Show resolved
Hide resolved
Signed-off-by: Nakul Krishnakumar <[email protected]>
|
/stdlib merge |
lib/node_modules/@stdlib/math/base/special/fast/atanhf/benchmark/benchmark.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/fast/atanhf/benchmark/benchmark.native.js
Show resolved
Hide resolved
Signed-off-by: Philipp Burckhardt <[email protected]>
There was a problem hiding this 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!
PR Commit MessagePlease review the above commit message and make any necessary adjustments. |
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves a part of #649 .
Description
This pull request:
math/base/special/fast/atanhf.Related Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
None.
@stdlib-js/reviewers