File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
lib/node_modules/@stdlib/math/base/special/acoshf/lib Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ var log1pf = require( '@stdlib/math/base/special/log1pf' );
3939var sqrtf = require ( '@stdlib/math/base/special/sqrtf' ) ;
4040var FLOAT32_LN2 = require ( '@stdlib/constants/float32/ln-two' ) ;
4141var lnf = require ( '@stdlib/math/base/special/lnf' ) ;
42+ var f32 = require ( '@stdlib/number/float64/base/to-float32' ) ;
4243
4344
4445// VARIABLES //
@@ -101,14 +102,14 @@ function acoshf( x ) {
101102 return 0.0 ;
102103 }
103104 if ( x >= HUGE ) {
104- return lnf ( x ) + FLOAT32_LN2 ;
105+ return f32 ( lnf ( x ) + FLOAT32_LN2 ) ;
105106 }
106107 if ( x > 2.0 ) {
107- return lnf ( ( 2.0 * x ) - ( 1.0 / ( x + sqrtf ( ( x * x ) - 1.0 ) ) ) ) ;
108+ return lnf ( f32 ( 2.0 * x ) - f32 ( 1.0 / f32 ( x + sqrtf ( f32 ( x * x ) - 1.0 ) ) ) ) ;
108109 }
109110 // Case: 2 >= x > 1
110- t = x - 1.0 ;
111- return log1pf ( t + sqrtf ( ( 2.0 * t ) + ( t * t ) ) ) ;
111+ t = f32 ( x - 1.0 ) ;
112+ return log1pf ( t + sqrtf ( f32 ( 2.0 * t ) + f32 ( t * t ) ) ) ;
112113}
113114
114115
You can’t perform that action at this time.
0 commit comments