3
3
< html lang ="en ">
4
4
5
5
< head >
6
- < title > Code coverage report for math/base/special/expf/lib/expmulti .js</ title >
6
+ < title > Code coverage report for math/base/special/expf/lib/expmultif .js</ title >
7
7
< meta charset ="utf-8 " />
8
8
< link rel ="stylesheet " href ="../../../../../prettify.css " />
9
9
< link rel ="stylesheet " href ="../../../../../base.css " />
19
19
< body >
20
20
< div class ='wrapper '>
21
21
< div class ='pad1 '>
22
- < h1 > < a href ="../../../../../index.html "> All files</ a > / < a href ="index.html "> math/base/special/expf/lib</ a > expmulti .js</ h1 >
22
+ < h1 > < a href ="../../../../../index.html "> All files</ a > / < a href ="index.html "> math/base/special/expf/lib</ a > expmultif .js</ h1 >
23
23
< div class ='clearfix '>
24
24
25
25
< div class ='fl pad1y space-right2 '>
26
- < span class ="strong "> 97.36 % </ span >
26
+ < span class ="strong "> 100 % </ span >
27
27
< span class ="quiet "> Statements</ span >
28
- < span class ='fraction '> 74 /76</ span >
28
+ < span class ='fraction '> 76 /76</ span >
29
29
</ div >
30
30
31
31
32
32
< div class ='fl pad1y space-right2 '>
33
- < span class ="strong "> 66.66 % </ span >
33
+ < span class ="strong "> 100 % </ span >
34
34
< span class ="quiet "> Branches</ span >
35
- < span class ='fraction '> 2/3 </ span >
35
+ < span class ='fraction '> 2/2 </ span >
36
36
</ div >
37
37
38
38
@@ -44,9 +44,9 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">mat
44
44
45
45
46
46
< div class ='fl pad1y space-right2 '>
47
- < span class ="strong "> 97.36 % </ span >
47
+ < span class ="strong "> 100 % </ span >
48
48
< span class ="quiet "> Lines</ span >
49
- < span class ='fraction '> 74 /76</ span >
49
+ < span class ='fraction '> 76 /76</ span >
50
50
</ div >
51
51
52
52
@@ -191,25 +191,25 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">mat
191
191
< span class ="cline-any cline-yes "> 1x</ span >
192
192
< span class ="cline-any cline-yes "> 1x</ span >
193
193
< span class ="cline-any cline-yes "> 1x</ span >
194
- < span class ="cline-any cline-yes "> 3998x </ span >
195
- < span class ="cline-any cline-yes "> 3998x </ span >
196
- < span class ="cline-any cline-yes "> 3998x </ span >
197
- < span class ="cline-any cline-yes "> 3998x </ span >
198
- < span class ="cline-any cline-yes "> 3998x </ span >
199
- < span class ="cline-any cline-yes "> 3998x </ span >
200
- < span class ="cline-any cline-yes "> 3998x </ span >
201
- < span class ="cline-any cline-yes "> 3998x </ span >
202
- < span class ="cline-any cline-yes "> 3998x </ span >
203
- < span class ="cline-any cline-yes "> 3998x </ span >
204
- < span class ="cline-any cline-yes "> 3998x </ span >
205
- < span class ="cline-any cline-yes "> 3998x </ span >
206
- < span class ="cline-any cline-yes "> 3998x </ span >
207
- < span class ="cline-any cline-yes "> 3998x </ span >
208
- < span class ="cline-any cline-yes "> 3998x </ span >
209
- < span class ="cline-any cline-yes "> 3998x </ span >
210
- < span class ="cline-any cline-no " > </ span >
211
- < span class ="cline-any cline-no " > </ span >
212
- < span class ="cline-any cline-yes "> 3998x </ span >
194
+ < span class ="cline-any cline-yes "> 1x </ span >
195
+ < span class ="cline-any cline-yes "> 1x </ span >
196
+ < span class ="cline-any cline-yes "> 1x </ span >
197
+ < span class ="cline-any cline-yes "> 1x </ span >
198
+ < span class ="cline-any cline-yes "> 1x </ span >
199
+ < span class ="cline-any cline-yes "> 1x </ span >
200
+ < span class ="cline-any cline-yes "> 4002x </ span >
201
+ < span class ="cline-any cline-yes "> 4002x </ span >
202
+ < span class ="cline-any cline-yes "> 4002x </ span >
203
+ < span class ="cline-any cline-yes "> 4002x </ span >
204
+ < span class ="cline-any cline-yes "> 4002x </ span >
205
+ < span class ="cline-any cline-yes "> 4002x </ span >
206
+ < span class ="cline-any cline-yes "> 4002x </ span >
207
+ < span class ="cline-any cline-yes "> 4002x </ span >
208
+ < span class ="cline-any cline-yes "> 4002x </ span >
209
+ < span class ="cline-any cline-yes "> 4002x </ span >
210
+ < span class ="cline-any cline-yes " > 4002x </ span >
211
+ < span class ="cline-any cline-yes " > 4002x </ span >
212
+ < span class ="cline-any cline-yes "> 4002x </ span >
213
213
< span class ="cline-any cline-yes "> 1x</ span >
214
214
< span class ="cline-any cline-yes "> 1x</ span >
215
215
< span class ="cline-any cline-yes "> 1x</ span >
@@ -235,70 +235,70 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">mat
235
235
*
236
236
* ## Notice
237
237
*
238
- * The following copyrights, licenses, and long comment were part of the original implementation available as part of{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/e_expf.c?view=markup}, The implementation follows the original, but has been modified for JavaScript.
238
+ * The following copyrights, licenses, and long comment were part of the original implementation available as part of{@link https://svnweb.freebsd.org/base/release/12.2.0/lib/msun/src/e_expf.c}, The implementation follows the original, but has been modified for JavaScript.
239
+ *
240
+ * ```text
241
+ * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
239
242
*
240
- * e_expf.c -- float version of e_exp.c.
241
- * Conversion to float by Ian Lance Taylor, Cygnus Support,
[email protected] .
242
- * ====================================================
243
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
244
243
* Developed at SunPro, a Sun Microsystems, Inc. business.
245
244
* Permission to use, copy, modify, and distribute this
246
245
* software is freely granted, provided that this notice
247
246
* is preserved.
248
- * ====================================================
247
+ * ```
249
248
*/
250
249
251
250
'use strict';
252
251
253
252
// MODULES //
254
253
255
254
var ldexpf = require( '@stdlib/math/base/special/ldexpf' );
255
+ var f32 = require( '@stdlib/number/float64/base/to-float32' );
256
256
var polyvalP = require( './polyval_p.js' );
257
257
258
258
259
+ // VARIABLES //
260
+
261
+ var ONE = f32( 1.0 );
262
+ var TWO = f32( 2.0 );
263
+
264
+
259
265
// MAIN //
260
266
261
267
/**
262
- * Computes \\(e^{r} 2^k\\) where \\(r = \mathrm{hi} - \mathrm{lo}\\) and \\(|r| \leq \ln(2)/2\\).
268
+ * Computes \\(e^{r} 2^k\\) for a single-precision floating-point number, where \\(r = \mathrm{hi} - \mathrm{lo}\\) and \\(|r| \leq \ln(2)/2\\).
263
269
*
264
270
* @private
265
271
* @param {number} hi - upper bound
266
272
* @param {number} lo - lower bound
267
273
* @param {integer} k - power of 2
268
274
* @returns {number} function value
269
275
*/
270
- function expmulti( hi, lo, k ) {
271
- var twom100;
276
+ function expmultif( hi, lo, k ) {
272
277
var r;
273
278
var t;
274
279
var c;
275
280
var y;
276
281
277
- twom100 = 7.8886090522e-31;
278
- r = hi - lo;
279
- t = r * r;
280
- c = r - ( t*polyvalP( t ) );
281
- y = 1.0 - ( lo - ( (r*c)/(2.0-c) ) - hi );
282
+ r = f32( hi - lo );
283
+ t = f32( r * r );
284
+ c = f32( r - f32( t*polyvalP( t ) ) );
285
+ y = f32( ONE - f32( f32( lo - f32( f32(r*c)/f32(TWO-c) ) ) - hi ) );
282
286
283
- if ( k >= -125 ) {
284
- return ldexpf( y, k );
285
- }
286
- < span class ="cstat-no " title ="statement not covered " > < span class ="branch-0 cbranch-no " title ="branch not covered " > </ span > </ span >
287
- < span class ="cstat-no " title ="statement not covered " > return ldexpf( y, k + 100 ) * twom100 * twom100;</ span >
287
+ return ldexpf( y, k );
288
288
}
289
289
290
290
291
291
// EXPORTS //
292
292
293
- module.exports = expmulti ;
293
+ module.exports = expmultif ;
294
294
</ pre > </ td > </ tr > </ table > </ pre >
295
295
296
296
< div class ='push '> </ div > <!-- for sticky footer -->
297
297
</ div > <!-- /wrapper -->
298
298
< div class ='footer quiet pad2 space-top1 center small '>
299
299
Code coverage generated by
300
300
< a href ="https://istanbul.js.org/ " target ="_blank " rel ="noopener noreferrer "> istanbul</ a >
301
- at 2025-08-18T06:25:36.097Z
301
+ at 2025-08-18T06:27:29.394Z
302
302
</ div >
303
303
< script src ="../../../../../prettify.js "> </ script >
304
304
< script >
0 commit comments