Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
41 changes: 8 additions & 33 deletions lib/node_modules/@stdlib/math/base/special/cos/test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,10 +22,9 @@

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 isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var cos = require( './../lib' );


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

tape( 'the function computes the cosine (medium negative values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -63,9 +60,7 @@ tape( 'the function computes the cosine (medium negative values)', function test
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -74,8 +69,6 @@ tape( 'the function computes the cosine (medium negative values)', function test

tape( 'the function computes the cosine (positive medium values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -88,9 +81,7 @@ tape( 'the function computes the cosine (positive medium values)', function test
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -99,8 +90,6 @@ tape( 'the function computes the cosine (positive medium values)', function test

tape( 'the function computes the cosine (large negative values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -113,9 +102,7 @@ tape( 'the function computes the cosine (large negative values)', function test(
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -124,8 +111,6 @@ tape( 'the function computes the cosine (large negative values)', function test(

tape( 'the function computes the cosine (large positive values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -138,9 +123,7 @@ tape( 'the function computes the cosine (large positive values)', function test(
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -149,8 +132,6 @@ tape( 'the function computes the cosine (large positive values)', function test(

tape( 'the function computes the cosine (huge negative values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -163,9 +144,7 @@ tape( 'the function computes the cosine (huge negative values)', function test(
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -174,8 +153,6 @@ tape( 'the function computes the cosine (huge negative values)', function test(

tape( 'the function computes the cosine (huge positive values)', function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -188,9 +165,7 @@ tape( 'the function computes the cosine (huge positive values)', function test(
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand Down
41 changes: 8 additions & 33 deletions lib/node_modules/@stdlib/math/base/special/cos/test/test.native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,10 +23,9 @@
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 EPS = require( '@stdlib/constants/float64/eps' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var tryRequire = require( '@stdlib/utils/try-require' );


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

tape( 'the function computes the cosine (medium negative values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -72,9 +69,7 @@ tape( 'the function computes the cosine (medium negative values)', opts, functio
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -83,8 +78,6 @@ tape( 'the function computes the cosine (medium negative values)', opts, functio

tape( 'the function computes the cosine (positive medium values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -97,9 +90,7 @@ tape( 'the function computes the cosine (positive medium values)', opts, functio
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -108,8 +99,6 @@ tape( 'the function computes the cosine (positive medium values)', opts, functio

tape( 'the function computes the cosine (large negative values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -122,9 +111,7 @@ tape( 'the function computes the cosine (large negative values)', opts, function
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -133,8 +120,6 @@ tape( 'the function computes the cosine (large negative values)', opts, function

tape( 'the function computes the cosine (large positive values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -147,9 +132,7 @@ tape( 'the function computes the cosine (large positive values)', opts, function
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -158,8 +141,6 @@ tape( 'the function computes the cosine (large positive values)', opts, function

tape( 'the function computes the cosine (huge negative values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -172,9 +153,7 @@ tape( 'the function computes the cosine (huge negative values)', opts, function
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand All @@ -183,8 +162,6 @@ tape( 'the function computes the cosine (huge negative values)', opts, function

tape( 'the function computes the cosine (huge positive values)', opts, function test( t ) {
var expected;
var delta;
var tol;
var x;
var y;
var i;
Expand All @@ -197,9 +174,7 @@ tape( 'the function computes the cosine (huge positive values)', opts, function
if ( y === expected[ i ] ) {
t.strictEqual( y, expected[ i ], 'x: '+x[i]+'. 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]+'. tol: '+tol+'. Δ: '+delta+'.' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i] );
}
}

Expand Down