diff --git a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.js index 3f952130282a..0d6d6f162aae 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var randu = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var csch = require( './../lib' ); @@ -34,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = randu( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*10.0 ) - 5.0; - y = csch( x ); + y = csch( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.native.js index 63b6bb729daa..5d4a51a88129 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/csch/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 randu = 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 = randu( 100, -5.0, 5.0 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() * 10.0 ) - 5.0; - y = csch( x ); + y = csch( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/csch/benchmark/c/native/benchmark.c index 80689f82436e..c959414aee04 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/csch/benchmark/c/native/benchmark.c @@ -91,15 +91,18 @@ static double rand_double( void ) { */ static double benchmark( void ) { double elapsed; - double x; + double x[ 100 ]; double y; double t; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 10.0 * rand_double() ) - 5.0; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 10.0 * rand_double() ) - 5.0; - y = stdlib_base_csch( x ); + y = stdlib_base_csch( x[ i % 100 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/csch/src/Makefile b/lib/node_modules/@stdlib/math/base/special/csch/src/Makefile index 8be96d0b0f76..bcf18aa46655 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/src/Makefile +++ b/lib/node_modules/@stdlib/math/base/special/csch/src/Makefile @@ -1,3 +1,4 @@ +#/ # @license Apache-2.0 # # Copyright (c) 2024 The Stdlib Authors. @@ -45,69 +46,6 @@ endif endif -# RULES # - -#/ -# Removes generated files for building an add-on. -# -# @example -# make clean-addon -#/ -clean-addon: - $(QUIET) -rm -f *.o *.node - -.PHONY: clean-addon - -#/ -# Removes generated files. -# -# @example -# make clean -#/ -clean: clean-addon - -.PHONY: clean - copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# VARIABLES # - -ifndef VERBOSE - QUIET := @ -else - QUIET := -endif - -# Determine the OS ([1][1], [2][2]). -# -# [1]: https://en.wikipedia.org/wiki/Uname#Examples -# [2]: http://stackoverflow.com/a/27776822/2225624 -OS ?= $(shell uname) -ifneq (, $(findstring MINGW,$(OS))) - OS := WINNT -else -ifneq (, $(findstring MSYS,$(OS))) - OS := WINNT -else -ifneq (, $(findstring CYGWIN,$(OS))) - OS := WINNT -else -ifneq (, $(findstring Windows_NT,$(OS))) - OS := WINNT -endif -endif -endif -endif - - # RULES # #/ diff --git a/lib/node_modules/@stdlib/math/base/special/csch/test/test.js b/lib/node_modules/@stdlib/math/base/special/csch/test/test.js index 15071b2028d3..d36cc23cfde2 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/csch/test/test.js @@ -171,31 +171,31 @@ tape( 'the function computes the hyperbolic cosecant (tiny positive)', function tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) { var v = csch( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+Infinity` if provided `+0.0`', function test( t ) { var v = csch( +0.0 ); - t.equal( v, PINF, 'returns +Infinity' ); + t.equal( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-Infinity` if provided `-0.0`', function test( t ) { var v = csch( -0.0 ); - t.equal( v, NINF, 'returns -Infinity' ); + t.equal( v, NINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `+0.0` if provided `+Infinity`', function test( t ) { var v = csch( PINF ); - t.equal( isPositiveZero(v), true, 'returns +0.0' ); + t.equal( isPositiveZero(v), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0.0` if provided `-Infinity`', function test( t ) { var v = csch( NINF ); - t.equal( isNegativeZero(v), true, 'returns -0.0' ); + t.equal( isNegativeZero(v), true, 'returns expected value' ); t.end(); }); @@ -207,7 +207,7 @@ tape( 'the function returns `+0.0` if provided a value greater than `~710.476`', for ( i = 0; i < 500; i++ ) { v = ( randu()*1e6 ) + 710.476; y = csch( v ); - t.equal( isPositiveZero( y ), true, 'returns +0.0' ); + t.equal( isPositiveZero( y ), true, 'returns expected value' ); } t.end(); }); @@ -220,7 +220,7 @@ tape( 'the function returns `-0.0` if provided a value less than `~-709.0896`', for ( i = 0; i < 500; i++ ) { v = ( -randu()*1e6 ) - 709.0896; y = csch( v ); - t.equal( isNegativeZero( y ), true, 'returns -0.0' ); + t.equal( isNegativeZero( y ), true, 'returns expected value' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/csch/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/csch/test/test.native.js index bfc48bacf013..eb92ae5c720e 100644 --- a/lib/node_modules/@stdlib/math/base/special/csch/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/csch/test/test.native.js @@ -180,31 +180,31 @@ tape( 'the function computes the hyperbolic cosecant (tiny positive)', opts, fun tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) { var v = csch( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `+Infinity` if provided `+0.0`', opts, function test( t ) { var v = csch( +0.0 ); - t.equal( v, PINF, 'returns +Infinity' ); + t.equal( v, PINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `-Infinity` if provided `-0.0`', opts, function test( t ) { var v = csch( -0.0 ); - t.equal( v, NINF, 'returns -Infinity' ); + t.equal( v, NINF, 'returns expected value' ); t.end(); }); tape( 'the function returns `+0.0` if provided `+Infinity`', opts, function test( t ) { var v = csch( PINF ); - t.equal( isPositiveZero(v), true, 'returns +0.0' ); + t.equal( isPositiveZero(v), true, 'returns expected value' ); t.end(); }); tape( 'the function returns `-0.0` if provided `-Infinity`', opts, function test( t ) { var v = csch( NINF ); - t.equal( isNegativeZero(v), true, 'returns -0.0' ); + t.equal( isNegativeZero(v), true, 'returns expected value' ); t.end(); }); @@ -216,7 +216,7 @@ tape( 'the function returns `+0.0` if provided a value greater than `~710.476`', for ( i = 0; i < 500; i++ ) { v = ( randu() * 1e6 ) + 710.476; y = csch( v ); - t.equal( isPositiveZero( y ), true, 'returns +0.0' ); + t.equal( isPositiveZero( y ), true, 'returns expected value' ); } t.end(); }); @@ -229,7 +229,7 @@ tape( 'the function returns `-0.0` if provided a value less than `~-709.0896`', for ( i = 0; i < 500; i++ ) { v = ( -randu() * 1e6 ) - 709.0896; y = csch( v ); - t.equal( isNegativeZero( y ), true, 'returns -0.0' ); + t.equal( isNegativeZero( y ), true, 'returns expected value' ); } t.end(); });