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/log1pf #3361

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

gunjjoshi
Copy link
Member

Progresses #649.

Description

What is the purpose of this pull request?

This pull request:

float stdlib_base_log1pf( const float x )

Related Issues

Does this pull request have any related issues?

This pull request:

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.


@stdlib-js/reviewers

@gunjjoshi gunjjoshi marked this pull request as draft December 7, 2024 07:49
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels Dec 7, 2024
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/log1pf $\color{red}358/370$
$\color{green}+96.76\%$
$\color{red}31/35$
$\color{green}+88.57\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{red}358/370$
$\color{green}+96.76\%$

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

v = log1pf( x[ i ] );
e = float64ToFloat32( expected[ i ] );
delta = absf( v - e );
tol = 1.0e07 * EPS * absf( e );
Copy link
Member Author

@gunjjoshi gunjjoshi Dec 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tol = 1.0e07 * EPS * absf( e );
tol = 1.0e07 * EPS * absf( e );

@kgryte @Planeshifter The JS implementation requires a very large tolerance for numbers in the range -0.9999 to -0.41422. But, for the C implementation, the required tolerance equals EPS * absf( e ) only. I checked the implementation from the FreeBSD source, but couldn't find the reason.

FreeBSD reference: https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/s_log1pf.c?revision=367086&view=markup

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.

2 participants