-
-
Notifications
You must be signed in to change notification settings - Fork 444
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 C implementation for math/base/special/riemann-zeta
#2737
base: develop
Are you sure you want to change the base?
Conversation
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.
LGTM!
lib/node_modules/@stdlib/math/base/special/riemann-zeta/include/stdlib/math/base/special/zeta.h
Outdated
Show resolved
Hide resolved
Signed-off-by: Gunj Joshi <[email protected]>
lib/node_modules/@stdlib/math/base/special/riemann-zeta/src/main.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/riemann-zeta/src/main.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/math/base/special/riemann-zeta/src/main.c
Outdated
Show resolved
Hide resolved
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.
@Planeshifter This PR needs changes before it can be merged.
@@ -163,7 +163,7 @@ tape( 'the function handles negative integer values which are larger in magnitud | |||
s = -259; | |||
v = zeta( s ); | |||
delta = abs( v - expected ); | |||
tol = 352.0 * EPS * abs( expected ); | |||
tol = 656.0 * EPS * abs( expected ); |
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.
Why did this tolerance change?
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.
Reverted the change; tests still pass.
s = -259; | ||
v = zeta( s ); | ||
delta = abs( v - expected ); | ||
tol = 656.0 * EPS * abs( expected ); |
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.
Are you able to confirm the source of why the C implementation requires double the tolerance as the JS implementation?
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.
@kgryte This happens when s = -259
, which is near to the overflowing value. There is a minor difference in the results for this, where the c
implementation yields 8.760156344624196e+306
while the js
implementation gives 8.760156344623199e+306
. I've tried logging intermediate values, checking other functions involved, but couldn't find anything. I'll look more into this.
Description
This pull request:
C
implementation formath/base/special/riemann-zeta
.Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers