@@ -25,14 +25,14 @@ <h1><a href="index.html">All files</a> main.js</h1>
2525 < div class ='fl pad1y space-right2 '>
2626 < span class ="strong "> 100% </ span >
2727 < span class ="quiet "> Statements</ span >
28- < span class ='fraction '> 137/137 </ span >
28+ < span class ='fraction '> 141/141 </ span >
2929 </ div >
3030
3131
3232 < div class ='fl pad1y space-right2 '>
33- < span class ="strong "> 95 % </ span >
33+ < span class ="strong "> 100 % </ span >
3434 < span class ="quiet "> Branches</ span >
35- < span class ='fraction '> 19/20 </ span >
35+ < span class ='fraction '> 21/21 </ span >
3636 </ div >
3737
3838
@@ -46,7 +46,7 @@ <h1><a href="index.html">All files</a> main.js</h1>
4646 < div class ='fl pad1y space-right2 '>
4747 < span class ="strong "> 100% </ span >
4848 < span class ="quiet "> Lines</ span >
49- < span class ='fraction '> 137/137 </ span >
49+ < span class ='fraction '> 141/141 </ span >
5050 </ div >
5151
5252
@@ -200,7 +200,15 @@ <h1><a href="index.html">All files</a> main.js</h1>
200200< a name ='L135 '> </ a > < a href ='#L135 '> 135</ a >
201201< a name ='L136 '> </ a > < a href ='#L136 '> 136</ a >
202202< a name ='L137 '> </ a > < a href ='#L137 '> 137</ a >
203- < a name ='L138 '> </ a > < a href ='#L138 '> 138</ a > </ td > < td class ="line-coverage quiet "> < span class ="cline-any cline-yes "> 1x</ span >
203+ < a name ='L138 '> </ a > < a href ='#L138 '> 138</ a >
204+ < a name ='L139 '> </ a > < a href ='#L139 '> 139</ a >
205+ < a name ='L140 '> </ a > < a href ='#L140 '> 140</ a >
206+ < a name ='L141 '> </ a > < a href ='#L141 '> 141</ a >
207+ < a name ='L142 '> </ a > < a href ='#L142 '> 142</ a > </ td > < td class ="line-coverage quiet "> < span class ="cline-any cline-yes "> 1x</ span >
208+ < span class ="cline-any cline-yes "> 1x</ span >
209+ < span class ="cline-any cline-yes "> 1x</ span >
210+ < span class ="cline-any cline-yes "> 1x</ span >
211+ < span class ="cline-any cline-yes "> 1x</ span >
204212< span class ="cline-any cline-yes "> 1x</ span >
205213< span class ="cline-any cline-yes "> 1x</ span >
206214< span class ="cline-any cline-yes "> 1x</ span >
@@ -317,9 +325,9 @@ <h1><a href="index.html">All files</a> main.js</h1>
317325< span class ="cline-any cline-yes "> 1x</ span >
318326< span class ="cline-any cline-yes "> 1x</ span >
319327< span class ="cline-any cline-yes "> 10017x</ span >
320- < span class ="cline-any cline-yes "> 2002x </ span >
321- < span class ="cline-any cline-yes "> 2002x </ span >
322- < span class ="cline-any cline-yes "> 2002x </ span >
328+ < span class ="cline-any cline-yes "> 4005x </ span >
329+ < span class ="cline-any cline-yes "> 4005x </ span >
330+ < span class ="cline-any cline-yes "> 4005x </ span >
323331< span class ="cline-any cline-yes "> 8014x</ span >
324332< span class ="cline-any cline-yes "> 10017x</ span >
325333< span class ="cline-any cline-yes "> 4010x</ span >
@@ -357,7 +365,7 @@ <h1><a href="index.html">All files</a> main.js</h1>
357365*
358366* ## Notice
359367*
360- * The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/9.3 .0/lib/msun/src/e_atanh .c?view=markup}. The implementation follows the original, but has been modified for JavaScript.
368+ * The following copyright, license, and long comment were part of the original implementation available as part of [FreeBSD]{@link https://svnweb.freebsd.org/base/release/12.2 .0/lib/msun/src/e_atanhf .c?view=markup}. The implementation follows the original, but has been modified for JavaScript.
361369*
362370* ```text
363371* Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
@@ -382,7 +390,11 @@ <h1><a href="index.html">All files</a> main.js</h1>
382390
383391// VARIABLES //
384392
385- var NEAR_ZERO = 1.0 / (1 << 28); // 2**-28
393+ var ZERO = f32( 0.0 );
394+ var ONE = f32( 1.0 );
395+ var HALF = f32( 0.5 );
396+ var NEG_ONE = f32( -1.0 );
397+ var NEAR_ZERO = f32( f32( 1.0 ) / (1 << 28) ); // 2**-28
386398
387399
388400// MAIN //
@@ -444,30 +456,30 @@ <h1><a href="index.html">All files</a> main.js</h1>
444456 var t;
445457
446458 x = f32( x );
447- if ( isnanf( x ) || x < -1.0 || x > 1.0 ) {
459+ if ( isnanf( x ) || x < NEG_ONE || x > ONE ) {
448460 return NaN;
449461 }
450- if ( x === 1.0 ) {
462+ if ( x === ONE ) {
451463 return PINF;
452464 }
453- if ( x === -1.0 ) {
465+ if ( x === NEG_ONE ) {
454466 return NINF;
455467 }
456- if ( x < 0.0 ) {
468+ if ( x < ZERO ) {
457469 sgn = true;
458- x = -x ;
470+ x = f32( -x ) ;
459471 }
460472 // Case: |x| < 2**-28
461473 if ( x < NEAR_ZERO ) {
462- return ( sgn ) < span class =" branch-0 cbranch-no " title =" branch not covered " > ? -x </ span > : x;
474+ return ( sgn ) ? f32( -x ) : x;
463475 }
464- if ( x < 0.5 ) {
476+ if ( x < HALF ) {
465477 t = f32( x + x );
466- t = f32( 0.5 * log1pf( f32( t + ( t*x/(1-x ) ) ) ) );
478+ t = f32( HALF * log1pf( f32( t + f32 ( t*f32( x/f32(ONE-x) ) ) ) ) );
467479 } else {
468- t = f32( 0.5 * log1pf( f32( (x+x) / (1 -x) ) ) );
480+ t = f32( HALF * log1pf( f32( f32 (x+x) / f32(ONE -x) ) ) );
469481 }
470- return ( sgn ) ? -t : t;
482+ return ( sgn ) ? f32( -t ) : t;
471483}
472484
473485
@@ -481,7 +493,7 @@ <h1><a href="index.html">All files</a> main.js</h1>
481493 < div class ='footer quiet pad2 space-top1 center small '>
482494 Code coverage generated by
483495 < a href ="https://istanbul.js.org/ " target ="_blank " rel ="noopener noreferrer "> istanbul</ a >
484- at 2026-01-07T09:57:43.880Z
496+ at 2026-01-08T05:40:41.792Z
485497 </ div >
486498 < script src ="prettify.js "> </ script >
487499 < script >
0 commit comments