Skip to content

Commit eac4d5d

Browse files
chore: minor clean up
1 parent 52b85a0 commit eac4d5d

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

lib/node_modules/@stdlib/math/base/special/atanh/manifest.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
"@stdlib/math/base/napi/unary",
4040
"@stdlib/math/base/special/log1p",
4141
"@stdlib/math/base/assert/is-nan",
42+
"@stdlib/constants/float64/high-word-abs-mask",
43+
"@stdlib/number/float64/base/set-high-word",
44+
"@stdlib/number/float64/base/to-words",
4245
"@stdlib/constants/float64/pinf",
4346
"@stdlib/constants/float64/ninf"
4447
]
@@ -56,6 +59,9 @@
5659
"dependencies": [
5760
"@stdlib/math/base/special/log1p",
5861
"@stdlib/math/base/assert/is-nan",
62+
"@stdlib/constants/float64/high-word-abs-mask",
63+
"@stdlib/number/float64/base/set-high-word",
64+
"@stdlib/number/float64/base/to-words",
5965
"@stdlib/constants/float64/pinf",
6066
"@stdlib/constants/float64/ninf"
6167
]
@@ -73,6 +79,9 @@
7379
"dependencies": [
7480
"@stdlib/math/base/special/log1p",
7581
"@stdlib/math/base/assert/is-nan",
82+
"@stdlib/constants/float64/high-word-abs-mask",
83+
"@stdlib/number/float64/base/set-high-word",
84+
"@stdlib/number/float64/base/to-words",
7685
"@stdlib/constants/float64/pinf",
7786
"@stdlib/constants/float64/ninf"
7887
]

lib/node_modules/@stdlib/math/base/special/atanh/src/main.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ static const int32_t HIGH_BIASED_EXP_NEG_1 = 0x3fe00000;
9595
* // returns ~1.472
9696
*/
9797
double stdlib_base_atanh( const double x ) {
98-
u_int32_t lx;
99-
double hx;
100-
double ahx;
98+
uint32_t lx;
99+
uint32_t hx;
100+
uint32_t ahx;
101+
double ax;
101102
double t;
102103
if ( stdlib_base_is_nan( x ) || x < -1.0 || x > 1.0 ) {
103104
return 0.0 / 0.0; // NaN
@@ -116,13 +117,15 @@ double stdlib_base_atanh( const double x ) {
116117
if( ahx < HIGH_BIASED_EXP_NEG_7 && ( huge+x ) > zero) {
117118
return x; // x<2**-28
118119
}
119-
stdlib_base_float64_set_high_word( x, &ahx );
120-
if( ahx < HIGH_BIASED_EXP_NEG_1 ) {
121-
t = x + x;
122-
t = 0.5 * stdlib_base_log1p( t + ( t * x / ( one - x ) ) );
123120

121+
ax = (double *)&x;
122+
stdlib_base_float64_set_high_word( ahx, &ax );
123+
124+
if( ahx < HIGH_BIASED_EXP_NEG_1 ) {
125+
t = ax + ax;
126+
t = 0.5 * stdlib_base_log1p( t + ( t * ax / ( one - ax ) ) );
124127
} else {
125-
t = 0.5 * stdlib_base_log1p( ( x + x ) / ( one - x ) );
128+
t = 0.5 * stdlib_base_log1p( ( ax + ax ) / ( one - ax ) );
126129
}
127130
return ( hx >= 0 ) ? -t : t;
128131
}

0 commit comments

Comments
 (0)