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
33 changes: 6 additions & 27 deletions lib/node_modules/@stdlib/math/base/special/exp/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@

var tape = require( 'tape' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var abs = require( '@stdlib/math/base/special/abs' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var isPositiveZero = require( '@stdlib/assert/is-positive-zero' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var exp = require( './../lib' );


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

tape( 'the function accurately computes the natural exponential function for negative medium numbers', function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -60,17 +57,13 @@ tape( 'the function accurately computes the natural exponential function for neg

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for positive medium numbers', function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -80,17 +73,13 @@ tape( 'the function accurately computes the natural exponential function for pos

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for negative small numbers', function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -100,17 +89,13 @@ tape( 'the function accurately computes the natural exponential function for neg

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for positive small numbers', function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -120,17 +105,13 @@ tape( 'the function accurately computes the natural exponential function for pos

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for very small `x`', function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -140,9 +121,7 @@ tape( 'the function accurately computes the natural exponential function for ver

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand Down
33 changes: 6 additions & 27 deletions lib/node_modules/@stdlib/math/base/special/exp/test/test.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var abs = require( '@stdlib/math/base/special/abs' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var isPositiveZero = require( '@stdlib/assert/is-positive-zero' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var tryRequire = require( '@stdlib/utils/try-require' );
var EPS = require( '@stdlib/constants/float64/eps' );


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

tape( 'the function accurately computes the natural exponential function for negative medium numbers', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -69,17 +66,13 @@ tape( 'the function accurately computes the natural exponential function for neg

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for positive medium numbers', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -89,17 +82,13 @@ tape( 'the function accurately computes the natural exponential function for pos

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for negative small numbers', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -109,17 +98,13 @@ tape( 'the function accurately computes the natural exponential function for neg

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for positive small numbers', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -129,17 +114,13 @@ tape( 'the function accurately computes the natural exponential function for pos

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function accurately computes the natural exponential function for very small `x`', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var v;
var i;
Expand All @@ -149,9 +130,7 @@ tape( 'the function accurately computes the natural exponential function for ver

for ( i = 0; i < x.length; i++ ) {
v = exp( x[ i ] );
delta = abs( v - expected[ i ] );
tol = EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand Down