From c47f240fe2929fa310d20ab0f58905f1123f7eaa Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Fri, 28 Feb 2025 17:35:25 -0800 Subject: [PATCH] refactor: update benchmarks and test fixtures --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../math/base/special/tan/benchmark/benchmark.js | 12 +++++++----- .../base/special/tan/benchmark/benchmark.native.js | 7 ++++--- .../math/base/special/tan/benchmark/c/benchmark.c | 9 ++++++--- .../base/special/tan/benchmark/c/cephes/benchmark.c | 9 ++++++--- .../base/special/tan/benchmark/c/native/benchmark.c | 9 ++++++--- .../@stdlib/math/base/special/tan/test/test.js | 6 +++--- .../math/base/special/tan/test/test.native.js | 6 +++--- .../math/base/special/tand/benchmark/benchmark.js | 7 ++++--- .../base/special/tand/benchmark/benchmark.native.js | 7 ++++--- .../base/special/tand/benchmark/c/native/benchmark.c | 9 ++++++--- .../@stdlib/math/base/special/tand/test/test.js | 6 +++--- .../math/base/special/tanh/benchmark/benchmark.js | 12 +++++++----- .../base/special/tanh/benchmark/benchmark.native.js | 7 ++++--- .../math/base/special/tanh/benchmark/c/benchmark.c | 9 ++++++--- .../base/special/tanh/benchmark/c/cephes/benchmark.c | 9 ++++++--- .../base/special/tanh/benchmark/c/native/benchmark.c | 9 ++++++--- .../@stdlib/math/base/special/tanh/test/test.js | 10 +++++----- .../math/base/special/tanh/test/test.native.js | 10 +++++----- 18 files changed, 91 insertions(+), 62 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.js index 5fd63b9232b6..b76835431fcf 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var tan = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10.0 ) - 5.0; - y = tan( x ); + y = tan( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -55,10 +56,11 @@ bench( pkg+'::built-in', function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10.0 ) - 5.0; - y = Math.tan( x ); // eslint-disable-line stdlib/no-builtin-math + y = Math.tan( x[ i % x.length ] ); // eslint-disable-line stdlib/no-builtin-math if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.native.js index d908ed3902ed..b0f3d7f1e471 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 10.0 ) - 5.0; - y = tan( x ); + y = tan( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/benchmark.c index 41dac32a7d66..96f3b895b2b5 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/benchmark.c @@ -88,16 +88,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double()*10.0 ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double()*10.0 ) - 5.0; - y = tan( x ); + y = tan( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/cephes/benchmark.c b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/cephes/benchmark.c index cbef0bb0c0b3..ffc96a1d8690 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/cephes/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/cephes/benchmark.c @@ -94,16 +94,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double()*10.0 ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double()*10.0 ) - 5.0; - y = tan( x ); + y = tan( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/native/benchmark.c index c22cee206ca3..9a4e954a0235 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/tan/benchmark/c/native/benchmark.c @@ -90,16 +90,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double()*10.0 ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 10.0 * rand_double() ) - 5.0; - y = stdlib_base_tan( x ); + y = stdlib_base_tan( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/tan/test/test.js b/lib/node_modules/@stdlib/math/base/special/tan/test/test.js index ac87dcd9bdb7..c2d708aed342 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/tan/test/test.js @@ -433,18 +433,18 @@ tape( 'if provided a multiple of `pi/2`, the function does not return `+infinity tape( ' if provided a `NaN`, the function returns `NaN`', function test( t ) { var v = tan( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `+infinity`, the function returns `NaN`', function test( t ) { var v = tan( PINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `-infinity`, the function returns `NaN`', function test( t ) { var v = tan( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/tan/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/tan/test/test.native.js index f8acc7b9bd75..0610e583b5d0 100644 --- a/lib/node_modules/@stdlib/math/base/special/tan/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/tan/test/test.native.js @@ -442,18 +442,18 @@ tape( 'if provided a multiple of `pi/2`, the function does not return `+infinity tape( ' if provided a `NaN`, the function returns `NaN`', opts, function test( t ) { var v = tan( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `+infinity`, the function returns `NaN`', opts, function test( t ) { var v = tan( PINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `-infinity`, the function returns `NaN`', opts, function test( t ) { var v = tan( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.js index a9185d12e754..5a07c430bcde 100644 --- a/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var tand = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10.0 ) - 5.0; - y = tand( x ); + y = tand( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.native.js index aab7fc7aebea..23785e12c61c 100644 --- a/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/tand/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 10.0 ) - 5.0; - y = tand( x ); + y = tand( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/tand/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/tand/benchmark/c/native/benchmark.c index 9394980c3a58..7e502fa2e6ef 100644 --- a/lib/node_modules/@stdlib/math/base/special/tand/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/tand/benchmark/c/native/benchmark.c @@ -90,16 +90,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double()*10.0 ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 10.0 * rand_double() ) - 5.0; - y = stdlib_base_tand( x ); + y = stdlib_base_tand( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/tand/test/test.js b/lib/node_modules/@stdlib/math/base/special/tand/test/test.js index 1f5ac15234f4..c1511ffad560 100644 --- a/lib/node_modules/@stdlib/math/base/special/tand/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/tand/test/test.js @@ -93,19 +93,19 @@ tape( 'the function computes the tangent of an angle measured in degrees (positi tape( 'if provided a `NaN`, the function returns `NaN`', function test( t ) { var v = tand( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `+infinity`, the function returns `NaN`', function test( t ) { var v = tand( PINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided `-infinity`, the function returns `NaN`', function test( t ) { var v = tand( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.js index d4bfbf47fc9b..f853f09a8e0f 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var tanh = require( './../lib' ); @@ -41,10 +41,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10.0 ) - 5.0; - y = tanh( x ); + y = tanh( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -62,10 +63,11 @@ bench( pkg+'::built-in', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10.0 ) - 5.0; - y = Math.tanh( x ); // eslint-disable-line stdlib/no-builtin-math + y = Math.tanh( x[ i % x.length ] ); // eslint-disable-line stdlib/no-builtin-math if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.native.js index fe64d0249cdc..992aefc3142f 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -43,10 +43,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = uniform( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10.0 ) - 5.0; - y = tanh( x ); + y = tanh( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/benchmark.c index 476fb462520e..2b9508eafcf0 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/benchmark.c @@ -88,16 +88,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double()*10.0 ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double()*10.0 ) - 5.0; - y = tanh( x ); + y = tanh( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/cephes/benchmark.c b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/cephes/benchmark.c index e5739808f136..eeac4fa21a05 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/cephes/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/cephes/benchmark.c @@ -94,16 +94,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double()*10.0 ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double()*10.0 ) - 5.0; - y = tanh( x ); + y = tanh( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/native/benchmark.c index cbf59dd0b496..8c489d5dfd34 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/tanh/benchmark/c/native/benchmark.c @@ -89,16 +89,19 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double x[ 100 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( rand_double()*10.0 ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( rand_double()*10.0 ) - 5.0; - y = stdlib_base_tanh( x ); + y = stdlib_base_tanh( x[ i%100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/test/test.js b/lib/node_modules/@stdlib/math/base/special/tanh/test/test.js index 981a3cc58299..f9e75d8ac36e 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/tanh/test/test.js @@ -170,30 +170,30 @@ tape( 'the function computes the hyperbolic tangent (large positive)', function tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = tanh( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0`', function test( t ) { var v = tanh( -0.0 ); - t.equal( isNegativeZero( v ), true, 'returns -0' ); + t.equal( isNegativeZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+0` if provided `+0`', function test( t ) { var v = tanh( +0.0 ); - t.equal( isPositiveZero( v ), true, 'returns +0' ); + t.equal( isPositiveZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `1.0` if provided `+infinity`', function test( t ) { var v = tanh( PINF ); - t.equal( v, 1.0, 'returns 1.0' ); + t.equal( v, 1.0, 'returns expected value' ); t.end(); }); tape( 'the function returns `-1.0` if provided `-infinity`', function test( t ) { var v = tanh( NINF ); - t.equal( v, -1.0, 'returns -1.0' ); + t.equal( v, -1.0, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/tanh/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/tanh/test/test.native.js index 65dc27efddfd..87272b2c8f5e 100644 --- a/lib/node_modules/@stdlib/math/base/special/tanh/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/tanh/test/test.native.js @@ -179,30 +179,30 @@ tape( 'the function computes the hyperbolic tangent (large positive)', opts, fun tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) { var v = tanh( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0` if provided `-0`', opts, function test( t ) { var v = tanh( -0.0 ); - t.equal( isNegativeZero( v ), true, 'returns -0' ); + t.equal( isNegativeZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+0` if provided `+0`', opts, function test( t ) { var v = tanh( +0.0 ); - t.equal( isPositiveZero( v ), true, 'returns +0' ); + t.equal( isPositiveZero( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `1.0` if provided `+infinity`', opts, function test( t ) { var v = tanh( PINF ); - t.equal( v, 1.0, 'returns 1.0' ); + t.equal( v, 1.0, 'returns expected value' ); t.end(); }); tape( 'the function returns `-1.0` if provided `-infinity`', opts, function test( t ) { var v = tanh( NINF ); - t.equal( v, -1.0, 'returns -1.0' ); + t.equal( v, -1.0, 'returns expected value' ); t.end(); });