Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ var tape = require( 'tape' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
var abs = require( '@stdlib/math/base/special/abs' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var tryRequire = require( '@stdlib/utils/try-require' );
var EPS = require( '@stdlib/constants/float64/eps' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var PI = require( '@stdlib/constants/float64/pi' );
Expand Down Expand Up @@ -196,8 +195,6 @@ tape( 'the function returns `-PI/2` if provided a negative `y` and `x=-0`', opts
tape( 'the function evaluates the `atan2` function (when x and y are positive)', opts, function test( t ) {
var expected;
var actual;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -207,18 +204,14 @@ tape( 'the function evaluates the `atan2` function (when x and y are positive)',
expected = positivePositive.expected;
for ( i = 0; i < x.length; i++ ) {
actual = atan2( y[i], x[i] );
delta = abs( actual - expected[i] );
tol = EPS * abs( expected[i] );
t.strictEqual( delta <= tol, true, 'within tolerance. y: '+y[i]+'. x: '+x[i]+'. Actual: '+actual+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( actual, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function evaluates the `atan2` function (when x is negative and y is positive)', opts, function test( t ) {
var expected;
var actual;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -228,18 +221,14 @@ tape( 'the function evaluates the `atan2` function (when x is negative and y is
expected = negativePositive.expected;
for ( i = 0; i < x.length; i++ ) {
actual = atan2( y[i], x[i] );
delta = abs( actual - expected[i] );
tol = 2.0 * EPS * abs( expected[i] );
t.strictEqual( delta <= tol, true, 'within tolerance. y: '+y[i]+'. x: '+x[i]+'. Actual: '+actual+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( actual, expected[ i ], 2 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function evaluates the `atan2` function (when x and y are negative)', opts, function test( t ) {
var expected;
var actual;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -249,9 +238,7 @@ tape( 'the function evaluates the `atan2` function (when x and y are negative)',
expected = negativeNegative.expected;
for ( i = 0; i < x.length; i++ ) {
actual = atan2( y[i], x[i] );
delta = abs( actual - expected[i] );
tol = 2.0 * EPS * abs( expected[i] );
t.strictEqual( delta <= tol, true, 'within tolerance. y: '+y[i]+'. x: '+x[i]+'. Actual: '+actual+'. E: '+expected[i]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( actual, expected[ i ], 2 ), true, 'returns expected value' );
}
t.end();
});