Skip to content
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/exp2f #3366

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

aayush0325
Copy link
Member

@aayush0325 aayush0325 commented Dec 7, 2024

Resolves #649

Description

What is the purpose of this pull request?

This pull request:

  • adds math/base/special/exp2f

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

What should i do about benchmark/c/cephes ? that doesn't seem to compile locally and on the CI tests as well.

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.


@stdlib-js/reviewers

@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 7, 2024
@aayush0325
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 7, 2024
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Dec 7, 2024
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Dec 7, 2024

Coverage Report

Package Statements Branches Functions Lines
math/base/special/exp2f $\color{green}328/328$
$\color{green}+100.00\%$
$\color{green}19/19$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}328/328$
$\color{green}+100.00\%$

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

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.

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.

@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Dec 15, 2024
@aayush0325
Copy link
Member Author

good morning @Planeshifter! I've wrapped the intermediate results and final answers in float64ToFloat32(). If there's anything else that needs to be changed here please let me know.

@aayush0325
Copy link
Member Author

aayush0325 commented Dec 15, 2024

Also, as mentioned in the questions section of the PR, what should i do about benchmark/c/cephes since it doesn't seem to compile locally and it fails on CI as well. Is there something that I'm missing from my side? (see this commit)

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Dec 16, 2024
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. Needs Changes Pull request which needs changes before being merged. Needs Review A pull request which needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: Add C implementations to base special math functions (tracking issue)
3 participants