feat: add constants/float16/fourth-root-eps#9610
feat: add constants/float16/fourth-root-eps#9610aryan7071 wants to merge 7 commits intostdlib-js:developfrom
constants/float16/fourth-root-eps#9610Conversation
---
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
---
---
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: 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: na
- task: lint_license_headers
status: passed
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
constants/float16/fourth-root-eps
lib/node_modules/@stdlib/constants/float16/fourth-root-eps/README.md
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/constants/float16/fourth-root-eps/test/test.js
Outdated
Show resolved
Hide resolved
...@stdlib/constants/float16/fourth-root-eps/include/stdlib/constants/float16/fourth-root-eps.h
Outdated
Show resolved
Hide resolved
|
@aryan7071 Left a few comments. Also, do double check if the return value fits the half-precision limit. |
|
Ohh turns out this package has been worked on in #9250. |
|
Oh okay, @Neerajpathak07. In that case, I’ll close this for now. That PR is already 20 days old if it doesn’t move forward, I’d be happy to make the changes and commit them. Your call. |
|
@Neerajpathak07 It seems that the related PR isn’t moving forward. Should I take this up? |
---
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: 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: 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: 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: na
- 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: 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
---
|
@Neerajpathak07 Whenever you have the time, I’d really appreciate it if you could review this PR. |
Neerajpathak07
left a comment
There was a problem hiding this comment.
@aryan7071 Overall looks in good shape, Just a few comments more to the finish line.
| t.end(); | ||
| }); | ||
|
|
||
| tape( 'the exported value equals the fourth root of half-precision floating-point epsilon', function test( t ) { |
There was a problem hiding this comment.
| tape( 'the exported value equals the fourth root of half-precision floating-point epsilon', function test( t ) { | |
| tape( 'the exported value equals the fourth root of the difference between one and the smallest value greater than one which is representable as a stdlib_float16_t (2**-10)', function test( t ) { |
| }); | ||
|
|
||
| tape( 'the exported value equals the fourth root of half-precision floating-point epsilon', function test( t ) { | ||
| var expected = float64ToFloat16(sqrt(sqrt(pow( 2.0, -10.0 )))); |
There was a problem hiding this comment.
| var expected = float64ToFloat16(sqrt(sqrt(pow( 2.0, -10.0 )))); | |
| var expected = float64ToFloat16( sqrt( sqrt( pow( 2.0, -10.0 ) ) ) ); |
| #include "stdlib/constants/float16/fourth_root_eps.h" | ||
| ``` | ||
|
|
||
| #### STDLIB_CONSTANT_FLOAT16_FOURTH_ROOT_EPS |
There was a problem hiding this comment.
Better to add the C header file for this given that we now have extended support for H_H macro?
cc:- @kgryte
---
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: 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
---
---
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
---
|
@Neerajpathak07 could you please review this PR when you have time? I would appreciate your feedback. Thank you. |
Neerajpathak07
left a comment
There was a problem hiding this comment.
Thanks for working on this, Just the comment on the header file rest looks good!!!
| /** | ||
| * Macro for the fourth root of half-precision floating-point epsilon. | ||
| */ | ||
| #define STDLIB_CONSTANT_FLOAT16_FOURTH_ROOT_EPS 0.1767578125f |
There was a problem hiding this comment.
Here we cannot represent half-precision values as float dtype. The reason being JS currently does not provide support for standalone half-precision numbers. Hence, we represent these in double dtype.
If you want to know how this was implemented in stdlib you can refer:-
https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/math/base/napi/unary/src/h_h.c
---
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
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Description
This pull request:
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
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers