diff --git a/lib/node_modules/@stdlib/math/base/special/acosf/lib/main.js b/lib/node_modules/@stdlib/math/base/special/acosf/lib/main.js index 0fb76378ac31..1a8afefabefe 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosf/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/acosf/lib/main.js @@ -111,7 +111,7 @@ function acosf( x ) { r = float64ToFloat32( p / q ); return float64ToFloat32( PIO2_HI - float64ToFloat32( x - float64ToFloat32( PIO2_LO - float64ToFloat32( x * r ) ) ) ); // eslint-disable-line max-len } - if ( x < -0.5 ) { + if ( x <= -0.5 ) { z = float64ToFloat32( 0.5 * float64ToFloat32( 1.0 + x ) ); p = float64ToFloat32( z * polyp( z ) ); q = float64ToFloat32( 1.0 + float64ToFloat32( z * QS1 ) ); diff --git a/lib/node_modules/@stdlib/math/base/special/acosf/test/test.js b/lib/node_modules/@stdlib/math/base/special/acosf/test/test.js index 371b9914a37d..aa74e1d3f16b 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/acosf/test/test.js @@ -140,6 +140,12 @@ tape( 'the function returns `PI` if provided a value equal to `-1`', function te t.end(); }); +tape( 'the function returns `2π/3` if provided `-0.5`', function test( t ) { + var v = acosf( -0.5 ); + t.strictEqual( v, float64ToFloat32( 2.0 * PI / 3.0 ), 'returns expected value' ); + t.end(); +}); + tape( 'the function returns `0` if provided `1`', function test( t ) { t.strictEqual( isPositiveZero( acosf( 1.0 ) ), true, 'returns expected value' ); t.end(); diff --git a/lib/node_modules/@stdlib/math/base/special/acosf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/acosf/test/test.native.js index 013d6750b464..26b08194ce35 100644 --- a/lib/node_modules/@stdlib/math/base/special/acosf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/acosf/test/test.native.js @@ -149,6 +149,12 @@ tape( 'the function returns `PI` if provided a value equal to `-1`', opts, funct t.end(); }); +tape( 'the function returns `2π/3` if provided `-0.5`', opts, function test( t ) { + var v = acosf( -0.5 ); + t.strictEqual( v, float64ToFloat32( 2.0 * PI / 3.0 ), 'returns expected value' ); + t.end(); +}); + tape( 'the function returns `0` if provided `1`', opts, function test( t ) { t.strictEqual( isPositiveZero( acosf( 1.0 ) ), true, 'returns expected value' ); t.end();