Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
45 changes: 8 additions & 37 deletions lib/node_modules/@stdlib/math/base/special/erfc/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ var tape = require( 'tape' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var NINF = require( '@stdlib/constants/float64/ninf' );
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 erfc = require( './../lib' );


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

tape( 'the function evaluates the complementary error function for `x` on the interval `[-5,-100]', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -68,18 +65,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
Comment thread
shubham220420 marked this conversation as resolved.
Outdated
delta = abs( y - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
Comment thread
shubham220420 marked this conversation as resolved.
Outdated
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[5,100]`', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -91,18 +84,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-2.5,-28]`', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -114,18 +103,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[2.5,28]`', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -137,18 +122,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-1,-3]`', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -160,18 +141,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[1,3]`', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -183,18 +160,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-0.8,-1]`', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -206,9 +179,7 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
Expand Down
75 changes: 13 additions & 62 deletions lib/node_modules/@stdlib/math/base/special/erfc/test/test.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var tryRequire = require( '@stdlib/utils/try-require' );
var EPS = require( '@stdlib/constants/float64/eps' );
var abs = require( '@stdlib/math/base/special/abs' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );


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

tape( 'the function evaluates the complementary error function for `x` on the interval `[-5,-100]', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -77,18 +74,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[5,100]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -100,18 +93,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-2.5,-28]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -123,18 +112,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[2.5,28]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -146,18 +131,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-1,-3]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -169,18 +150,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[1,3]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -192,18 +169,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-0.8,-1]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -215,18 +188,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[0.8,1]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -238,18 +207,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-0.8,0.8]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -261,18 +226,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 2.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[-1e-300,-1e-308]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -284,18 +245,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+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]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for `x` on the interval `[1e-300,1e-308]`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -307,18 +264,14 @@ tape( 'the function evaluates the complementary error function for `x` on the in
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+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]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
});

tape( 'the function evaluates the complementary error function for subnormal `x`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -330,9 +283,7 @@ tape( 'the function evaluates the complementary error function for subnormal `x`
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+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]+'. Δ: '+delta+'. tol: '+tol );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
}
}
t.end();
Expand Down
Loading