Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Nov 21, 2024
1 parent 4dd100d commit 51c71e9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 86 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ A total of 5 people contributed to this release. Thank you to the following cont

<details>

- [`c660c70`](https://github.com/stdlib-js/stdlib/commit/c660c705bb3478f4fb6cb818c9b1d3429e8a6774) - **chore:** use correct `Makefile` and update benchmarks in `math/base/special/csch` [(#3209)](https://github.com/stdlib-js/stdlib/pull/3209) _(by Gunj Joshi)_
- [`b6a2b0b`](https://github.com/stdlib-js/stdlib/commit/b6a2b0b27dc8cc1e9fc02d9679a3ce468cf49b9d) - **docs:** update namespace table of contents [(#3192)](https://github.com/stdlib-js/stdlib/pull/3192) _(by stdlib-bot, Philipp Burckhardt)_
- [`961d039`](https://github.com/stdlib-js/stdlib/commit/961d03929b8b1b9c5221dc36cb21f0e8194f06c2) - **chore:** use relative path to load package.json file _(by Philipp Burckhardt)_
- [`15546a9`](https://github.com/stdlib-js/stdlib/commit/15546a92fb2f48b6c780fdf2dd0460340cda8830) - **docs:** update function name in header of C section _(by Philipp Burckhardt)_
Expand Down
7 changes: 4 additions & 3 deletions base/special/csch/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( './../../../../base/assert/is-nan' );
var pkg = require( './../package.json' ).name;
var csch = require( './../lib' );
Expand All @@ -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' );
}
Expand Down
7 changes: 4 additions & 3 deletions base/special/csch/benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( './../../../../base/assert/is-nan' );
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;
Expand All @@ -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' );
}
Expand Down
9 changes: 6 additions & 3 deletions base/special/csch/benchmark/c/native/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
64 changes: 1 addition & 63 deletions base/special/csch/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#/
# @license Apache-2.0
#
# Copyright (c) 2024 The Stdlib Authors.
Expand Down Expand Up @@ -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 #

#/
Expand Down
14 changes: 7 additions & 7 deletions base/special/csch/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand All @@ -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();
});
Expand All @@ -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();
});
14 changes: 7 additions & 7 deletions base/special/csch/test/test.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand All @@ -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();
});
Expand All @@ -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();
});

0 comments on commit 51c71e9

Please sign in to comment.