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
42 changes: 5 additions & 37 deletions lib/node_modules/@stdlib/math/base/special/acosh/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
var randu = require( '@stdlib/random/base/randu' );
var EPS = require( '@stdlib/constants/float64/eps' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var abs = require( '@stdlib/math/base/special/abs' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var isPositiveZero = require( '@stdlib/assert/is-positive-zero' );
var acosh = require( './../lib' );

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

tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -59,21 +57,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]'

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0]', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -83,21 +73,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0]

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100.0]', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -107,21 +89,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100.

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function computes the hyperbolic arccosine for huge values', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -131,13 +105,7 @@ tape( 'the function computes the hyperbolic arccosine for huge values', function

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
var randu = require( '@stdlib/random/base/randu' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var abs = require( '@stdlib/math/base/special/abs' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var isPositiveZero = require( '@stdlib/assert/is-positive-zero' );
var tryRequire = require( '@stdlib/utils/try-require' );

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

tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -68,21 +66,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [1.0,3.0]'

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0]', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -92,21 +82,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [3.0,28.0]

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100.0]', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -116,21 +98,13 @@ tape( 'the function computes the hyperbolic arccosine on the interval [28.0,100.

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function computes the hyperbolic arccosine for huge values', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -140,13 +114,7 @@ tape( 'the function computes the hyperbolic arccosine for huge values', opts, fu

for ( i = 0; i < x.length; i++ ) {
y = acosh( x[i] );
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. E: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = 1.0 * EPS * abs( expected[i] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand Down