-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
refactor: update math/base/special/atanh
according to the FreeBSD implementation
#3128
base: develop
Are you sure you want to change the base?
Changes from all commits
0815ad7
69b7f1f
359ce53
5de86c9
42365be
33efc83
41b9d53
17920a0
a09f5b9
8be5d8f
d10a81e
e6def08
ff0daa1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,15 +82,15 @@ double stdlib_base_atanh( const double x ) { | |
int32_t sgn; | ||
double ax; | ||
double t; | ||
if ( stdlib_base_is_nan( x ) || x < -1.0 || x > 1.0 ) { | ||
return 0.0 / 0.0; // NaN | ||
} | ||
if ( x == 1.0 ) { | ||
return STDLIB_CONSTANT_FLOAT64_PINF; | ||
|
||
if( ax > 1 || stdlib_base_is_nan( x ) ) { // |x|>1 or x is NaN | ||
return 0.0 / 0.0 ; //NaN | ||
} | ||
if ( x == -1.0 ) { | ||
return STDLIB_CONSTANT_FLOAT64_NINF; | ||
|
||
if( ax == 1 ) { // |x| == 1 | ||
return (sgn > 0) ? STDLIB_CONSTANT_FLOAT64_NINF : STDLIB_CONSTANT_FLOAT64_PINF; | ||
} | ||
|
||
Comment on lines
+85
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @RiyaChy072 This isn't what we need to do here. As mentioned previously, we need to use various stdlib utilities here, similar to how they are being used in the FreeBSD reference implementation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gunjjoshi Can i use HIGH_WORD_ABS_MASK here? |
||
if ( x < 0.0 ) { | ||
sgn = 1; | ||
ax = -x; | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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.
@RiyaChy072 I don't think we need to change these fixtures for this. Was there any specific reason to update them?
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.
@gunjjoshi I thought that needed to be done, didn't know we don't need that