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/rempio2/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
var incrspace = require( '@stdlib/array/base/incrspace' );
var linspace = require( '@stdlib/array/base/linspace' );
var randu = require( '@stdlib/random/base/randu' );
var abs = require( '@stdlib/math/base/special/abs' );
var pow = require( '@stdlib/math/base/special/pow' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var PIO2 = require( '@stdlib/constants/float64/half-pi' );
var PIO4 = require( '@stdlib/constants/float64/fourth-pi' );
var rempio2 = require( './../lib' );
Expand Down Expand Up @@ -70,8 +69,6 @@ tape( 'the function returns `0` and sets the elements of `y` to `NaN` if provide
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (positive)', function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -88,16 +85,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( z, x, 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny positive)', function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -114,16 +107,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'returns expected value' );
t.strictEqual( z, x, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (negative)', function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -140,16 +129,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( z, x, 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny negative)', function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -166,16 +151,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'returns expected value' );
t.strictEqual( z, x, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (multiples of π/4)', function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -192,9 +173,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x[i] );
tol = EPS * abs( x[i] );
t.strictEqual( delta <= tol, true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( z, x[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
var incrspace = require( '@stdlib/array/base/incrspace' );
var linspace = require( '@stdlib/array/base/linspace' );
var randu = require( '@stdlib/random/base/randu' );
var abs = require( '@stdlib/math/base/special/abs' );
var pow = require( '@stdlib/math/base/special/pow' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var PIO2 = require( '@stdlib/constants/float64/half-pi' );
var PIO4 = require( '@stdlib/constants/float64/fourth-pi' );
var Float64Array = require( '@stdlib/array/float64' );
Expand Down Expand Up @@ -80,8 +79,6 @@ tape( 'the function returns `0` and sets the elements of `y` to `NaN` if provide
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (positive)', opts, function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -98,16 +95,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'can recover input value' );
t.strictEqual( isAlmostSameValue( z, x, 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny positive)', opts, function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -124,16 +117,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'can recover input value' );
t.strictEqual( z, x, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (negative)', opts, function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -150,16 +139,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'can recover input value' );
t.strictEqual( isAlmostSameValue( z, x, 1 ), true, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (tiny negative)', opts, function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -176,16 +161,12 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x );
tol = EPS * abs( x );
t.strictEqual( delta <= tol, true, 'can recover input value' );
t.strictEqual( z, x, 'returns expected value' );
}
t.end();
});

tape( 'the function returns `n` and stores `r` as two double-precision floating point numbers in `y` such that `x - nπ/2 = r` (multiples of π/4)', opts, function test( t ) {
var delta;
var tol;
var x;
var y;
var z;
Expand All @@ -202,9 +183,7 @@ tape( 'the function returns `n` and stores `r` as two double-precision floating
t.strictEqual( isNumber( y[1] ), true, 'returns expected value' );

z = ( PIO2*n ) + ( y[0]+y[1] );
delta = abs( z - x[i] );
tol = EPS * abs( x[i] );
t.strictEqual( delta <= tol, true, 'can recover input value' );
t.strictEqual( isAlmostSameValue( z, x[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand Down