Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions lib/node_modules/@stdlib/math/base/special/acscf/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var tape = require( 'tape' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var uniform = require( '@stdlib/random/base/uniform' );
var EPS = require( '@stdlib/constants/float32/eps' );
var abs = require( '@stdlib/math/base/special/abs' );
var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' );
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var acscf = require( './../lib' );

Expand All @@ -45,8 +45,6 @@ tape( 'main export is a function', function test( t ) {

tape( 'the function computes the arccosecant (negative values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -58,21 +56,13 @@ tape( 'the function computes the arccosecant (negative values)', function test(
for ( i = 0; i < x.length; i++ ) {
y = acscf( x[ i ] );
e = float64ToFloat32( expected[ i ] );
if ( y === e ) {
t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e );
} else {
delta = abs( y - e );
tol = 1.3 * EPS * abs( e );
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, e, 2 ), true, 'return expected value' );
}
t.end();
});

tape( 'the function computes the arccosecant (positive values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -84,13 +74,7 @@ tape( 'the function computes the arccosecant (positive values)', function test(
for ( i = 0; i < x.length; i++ ) {
y = acscf( x[ i ] );
e = float64ToFloat32( expected[ i ] );
if ( y === e ) {
t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e );
} else {
delta = abs( y - e );
tol = 1.3 * EPS * abs( e );
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, e, 2 ), true, 'return expected value' );
}
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var tape = require( 'tape' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var uniform = require( '@stdlib/random/base/uniform' );
var EPS = require( '@stdlib/constants/float32/eps' );
var abs = require( '@stdlib/math/base/special/abs' );
var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' );
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var tryRequire = require( '@stdlib/utils/try-require' );

Expand Down Expand Up @@ -54,8 +54,6 @@ tape( 'main export is a function', opts, function test( t ) {

tape( 'the function computes the arccosecant (negative values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -67,21 +65,13 @@ tape( 'the function computes the arccosecant (negative values)', opts, function
for ( i = 0; i < x.length; i++ ) {
y = acscf( x[ i ] );
e = float64ToFloat32( expected[ i ] );
if ( y === e ) {
t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e );
} else {
delta = abs( y - e );
tol = 1.3 * EPS * abs( e );
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, e, 2 ), true, 'return expected value' );
}
t.end();
});

tape( 'the function computes the arccosecant (positive values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -93,13 +83,7 @@ tape( 'the function computes the arccosecant (positive values)', opts, function
for ( i = 0; i < x.length; i++ ) {
y = acscf( x[ i ] );
e = float64ToFloat32( expected[ i ] );
if ( y === e ) {
t.strictEqual( y, e, 'x: '+x[ i ]+'. E: '+e );
} else {
delta = abs( y - e );
tol = 1.3 * EPS * abs( e );
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. y: '+y+'. E: '+e+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, e, 2 ), true, 'return expected value' );
}
t.end();
});
Expand Down