feat: add math/base/special/exp2f - #3366
Conversation
|
/stdlib update-copyright-years |
Coverage Report
The above coverage report was generated for the changes in this PR. |
There was a problem hiding this comment.
Thanks for your work on this PR! Looks great overall, but some changes will be needed for the JavaScript implementation.
In main.js, we need to use the helper function
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );in order to ensure that all operations are done in a manner consistent with single-precision arithmetic. Recall that in JavaScript, all numbers are double-precision by default, so to emulate single-precision we must, in addition to using the single-precision variants of math functions, explicitly cast intermediate results and constants to single-precision floats.
|
good morning @Planeshifter! I've wrapped the intermediate results and final answers in |
|
Also, as mentioned in the questions section of the PR, what should i do about |
|
/stdlib update-copyright-years |
|
good morning @gunjjoshi! sorry for the delay, I've linked to all the references for your ease, kindly let me know if i have to make any other changes |
|
@anandkaranubc Would you mind taking over this PR? |
|
/stdlib merge |
|
|
||
| 'use strict'; | ||
|
|
||
| // TODO: replace with TOMS (Openlibm) algo (updating license header and long comment) |
There was a problem hiding this comment.
@kgryte Does this comment (originally present in exp2) mean following https://github.com/freebsd/freebsd-src/blob/main/lib/msun/src/s_exp2f.c implementation instead?
There was a problem hiding this comment.
Yes, I believe so. The original implementation looks to be based on Cephes, and, generally, we have preferred to use libm over Cephes given that libm is more actively maintained.
---
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_pkg_readmes
status: passed
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: na
- task: lint_package_json
status: passed
- task: lint_repl_help
status: na
- 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: na
- task: lint_license_headers
status: passed
---
|
/stdlib help |
|
@anandkaranubc, available slash commands include:
|
|
/stdlib update-copyright-years |
---
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_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- 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
---
Progresses #649
Description
This pull request:
math/base/special/exp2fRelated Issues
This pull request:
Questions
What should i do about
benchmark/c/cephes? that doesn't seem to compile locally and on the CI tests as well.Other
No.
Checklist
@stdlib-js/reviewers