Skip to content

Commit 54fe31f

Browse files
chore: update modules & var
1 parent 13ee9a8 commit 54fe31f

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

lib/node_modules/@stdlib/math/base/special/powf/lib/log2ax.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@
3737
var fromWordf = require( '@stdlib/number/float32/base/from-word' );
3838
var toWordf = require( '@stdlib/number/float32/base/to-word' );
3939
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
40-
var BIAS = require( '@stdlib/constants/float32/exponent-bias' );
40+
var FLOAT32_EXPONENT_BIAS = require( '@stdlib/constants/float32/exponent-bias' );
41+
var FLOAT32_SIGNIFICAND_MASK = require( '@stdlib/constants/float32/significand-mask' );
4142
var polyvalL = require( './polyval_l.js' );
4243

4344

4445
// VARIABLES //
4546

46-
// 0x007fffff = 8388607 => 0 00000000000 11111111111111111111
47-
var HIGH_EXP_2 = 0x007fffff; // asm type annotation
48-
49-
// 0x00080000 = 524288 => 0 00000000000 10000000000000000000
47+
// 0x0080000 = 524288 => 0 00000000000 10000000000000000000
5048
var HIGH_MIN_NORMAL_EXP = 0x00800000; // asm type annotation
5149

5250
// 0x3f800000 = 1065353216 => 0 01111111000 00000000000000000000
@@ -136,10 +134,10 @@ function log2ax( out, ax, ahx ) {
136134
ahx = fromWordf( ax );
137135
}
138136
// Extract the unbiased exponent of `x`:
139-
n += ((ahx >> HIGH_NUM_SIGNIFICAND_BITS) - BIAS); // asm type annotation
137+
n += ((ahx >> HIGH_NUM_SIGNIFICAND_BITS) - FLOAT32_EXPONENT_BIAS); // asm type annotation
140138

141139
// Isolate the significand bits of `x`:
142-
j = (ahx & HIGH_EXP_2); // asm type annotation
140+
j = (ahx & FLOAT32_SIGNIFICAND_MASK); // asm type annotation
143141

144142
// Normalize `ahx` by setting the (biased) exponent to `127`:
145143
ahx = (j | HIGH_BIASED_EXP_0); // asm type annotation

lib/node_modules/@stdlib/math/base/special/powf/lib/main.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
// MODULES //
3636

37-
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
3837
var isOddf = require( '@stdlib/math/base/assert/is-oddf' );
3938
var isInfinitef = require( '@stdlib/math/base/assert/is-infinitef' );
4039
var isIntegerf = require( '@stdlib/math/base/assert/is-integerf' );
@@ -45,7 +44,7 @@ var toWordf = require( '@stdlib/number/float32/base/to-word' );
4544
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
4645
var NINF = require( '@stdlib/constants/float32/ninf' );
4746
var PINF = require( '@stdlib/constants/float32/pinf' );
48-
var ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );
47+
var FLOAT32_ABS_MASK = require( '@stdlib/constants/float32/abs-mask' );
4948
var xIsZero = require( './x_is_zero.js' );
5049
var yIsInfinite = require( './y_is_infinite.js' );
5150
var log2ax = require( './log2ax.js' );
@@ -203,7 +202,6 @@ function powf( x, y ) {
203202
var hp;
204203
var lp;
205204
var z; // y prime
206-
var s;
207205
var j;
208206

209207
hx = fromWordf( x );
@@ -274,8 +272,8 @@ function powf( x, y ) {
274272
ax = absf( x );
275273

276274
// Remove the sign bits (i.e., get absolute values):
277-
ahx = (hx & ABS_MASK); // asm type annotation
278-
ahy = (hy & ABS_MASK); // asm type annotation
275+
ahx = (hx & FLOAT32_ABS_MASK); // asm type annotation
276+
ahy = (hy & FLOAT32_ABS_MASK); // asm type annotation
279277

280278
// Determine the sign of the result...
281279
if ( sn && isOddf( y ) ) {
@@ -336,7 +334,7 @@ function powf( x, y ) {
336334
}
337335
}
338336
// z <= -150
339-
else if ( (j&ABS_MASK) >= SMALL_60 ) {
337+
else if ( (j&FLOAT32_ABS_MASK) >= SMALL_60 ) {
340338
// Signal underflow...
341339
return sn * TINY * TINY;
342340
}

lib/node_modules/@stdlib/math/base/special/powf/lib/pow2.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,18 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
4040
var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' );
4141
var ldexpf = require( '@stdlib/math/base/special/ldexpf' );
4242
var LN2 = require( '@stdlib/constants/float32/ln-two' );
43-
var BIAS = require( '@stdlib/constants/float32/exponent-bias' );
44-
var ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );
43+
var FLOAT32_EXPONENT_BIAS = require( '@stdlib/constants/float32/exponent-bias' );
44+
var FLOAT32_ABS_MASK = require( '@stdlib/constants/float32/abs-mask' );
45+
var FLOAT32_SIGNIFICAND_MASK = require( '@stdlib/constants/float32/significand-mask' );
4546
var polyvalP = require( './polyval_p.js' );
4647

4748

4849
// VARIABLES //
4950

50-
// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022
51+
// 0x00800000 = 8388608 => 0 00000001 00000000000000000000000 => biased exponent: 1 = -126+127 => 2^-126 (smallest normal float32)
5152
var HIGH_MIN_NORMAL_EXP = 0x00800000; // asm type annotation
5253

53-
// 0x007fffff = 8388607 => 0 00000000000 11111111111111111111111 => biased exponent: 0 = -127+127 => 2^-127
54-
var HIGH_SIGNIFICAND_MASK = 0x007fffff;// asm type annotation
55-
56-
// 0x3fe00000 = 1071644672 => 0 01111111110 00000000000000000000 => biased exponent: 1022 = -1+1023 => 2^-1
54+
// 0x3f000000 = 1056964608 => 0 01111110 00000000000000000000000 => biased exponent: 126 = -1+127 => 2^-1 (i.e., 0.5)
5755
var HIGH_BIASED_EXP_NEG_1 = 0x3f000000; // asm type annotation
5856

5957
// 0xffff8000 = 4294934528 => 1 11111111111 11111000000000000000
@@ -97,18 +95,18 @@ function pow2( j, hp, lp ) {
9795
var i;
9896
var k;
9997

100-
i = (j & ABS_MASK); // asm type annotation
101-
k = ((i>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS); // asm type annotation
98+
i = (j & FLOAT32_ABS_MASK); // asm type annotation
99+
k = ((i>>HIGH_NUM_SIGNIFICAND_BITS) - FLOAT32_EXPONENT_BIAS); // asm type annotation
102100
n = 0;
103101

104102
// `|z| > 0.5`, set `n = [z+0.5]`
105103
if ( i > HIGH_BIASED_EXP_NEG_1 ) {
106104
n = (j + (HIGH_MIN_NORMAL_EXP>>(k+1)))>>>0; // asm type annotation
107-
k = (((n & ABS_MASK)>>HIGH_NUM_SIGNIFICAND_BITS) - BIAS); // new k for n
108-
tmp = ((n & ~(HIGH_SIGNIFICAND_MASK >> k)))>>>0; // asm type annotation
105+
k = (((n & FLOAT32_ABS_MASK)>>HIGH_NUM_SIGNIFICAND_BITS) - FLOAT32_EXPONENT_BIAS); // new k for n
106+
tmp = ((n & ~(FLOAT32_SIGNIFICAND_MASK >> k)))>>>0; // asm type annotation
109107
tmp = float64ToFloat32( tmp );
110108
t = toWordf( tmp );
111-
n = (((n & HIGH_SIGNIFICAND_MASK)|HIGH_MIN_NORMAL_EXP) >> (HIGH_NUM_SIGNIFICAND_BITS-k))>>>0; // eslint-disable-line max-len
109+
n = (((n & FLOAT32_SIGNIFICAND_MASK)|HIGH_MIN_NORMAL_EXP) >> (HIGH_NUM_SIGNIFICAND_BITS-k))>>>0; // eslint-disable-line max-len
112110
if ( j < 0 ) {
113111
n = -n;
114112
}

0 commit comments

Comments
 (0)