From b796c0327d7f74541292d97c0b7c3fe1a218ab09 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Sun, 27 Oct 2024 00:20:25 +0530 Subject: [PATCH 01/17] feat:add math/base/special/bernoullif --- .../math/base/special/bernoullif/README.md | 232 ++++++++++++++++++ .../special/bernoullif/benchmark/benchmark.js | 52 ++++ .../bernoullif/benchmark/benchmark.native.js | 61 +++++ .../bernoullif/benchmark/c/native/Makefile | 146 +++++++++++ .../bernoullif/benchmark/c/native/benchmark.c | 133 ++++++++++ .../math/base/special/bernoullif/binding.gyp | 170 +++++++++++++ .../base/special/bernoullif/docs/repl.txt | 45 ++++ .../special/bernoullif/docs/types/index.d.ts | 72 ++++++ .../special/bernoullif/docs/types/test.ts | 44 ++++ .../special/bernoullif/examples/c/Makefile | 146 +++++++++++ .../special/bernoullif/examples/c/example.c | 31 +++ .../base/special/bernoullif/examples/index.js | 29 +++ .../math/base/special/bernoullif/include.gypi | 53 ++++ .../stdlib/math/base/special/bernoullif.h | 40 +++ .../special/bernoullif/lib/bernoullif.json | 34 +++ .../math/base/special/bernoullif/lib/index.js | 58 +++++ .../math/base/special/bernoullif/lib/main.js | 102 ++++++++ .../base/special/bernoullif/lib/native.js | 77 ++++++ .../base/special/bernoullif/manifest.json | 84 +++++++ .../math/base/special/bernoullif/package.json | 66 +++++ .../math/base/special/bernoullif/src/Makefile | 70 ++++++ .../math/base/special/bernoullif/src/addon.c | 23 ++ .../math/base/special/bernoullif/src/main.c | 85 +++++++ .../math/base/special/bernoullif/test/test.js | 102 ++++++++ .../special/bernoullif/test/test.native.js | 99 ++++++++ 25 files changed, 2054 insertions(+) create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/README.md create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/package.json create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js create mode 100644 lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md new file mode 100644 index 000000000000..9920f686e3e2 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md @@ -0,0 +1,232 @@ + + +# bernoullif + +> Compute the nth [Bernoulli number][bernoulli-number] of a single-precision floating-point number. + +
+ + + +
+ +## Usage + +```javascript +var bernoullif = require( '@stdlib/math/base/special/bernoullif' ); +``` + +#### bernoullif( n ) + +Computes the nth [Bernoulli number][bernoulli-number] of a single-precision floating-point number. + +```javascript +var v = bernoullif( 0 ); +// returns 1.0 + +v = bernoullif( 1 ); +// returns 0.0 + +v = bernoullif( 2 ); +// returns ~0.167 + +v = bernoullif( 3 ); +// returns 0.0 + +v = bernoullif( 4 ); +// returns ~-0.033 + +v = bernoullif( 5 ); +// returns 0.0 + +v = bernoullif( 20 ); +// returns ~-529.124 +``` + +For even integers `n >= 64`, the function alternates between returning positive and negative infinity, as larger [Bernoulli numbers][bernoulli-number] cannot be safely represented in [single-precision floating-point format][ieee754] + +```javascript +var v = bernoullif( 64 ); +// returns -Infinity + +v = bernoullif( 66 ); +// returns Infinity + +v = bernoullif( 68 ); +// returns -Infinity +``` + +If not provided a nonnegative integer value, the function returns `NaN`. + +```javascript +var v = bernoullif( 3.14 ); +// returns NaN + +v = bernoullif( -1 ); +// returns NaN +``` + +If provided `NaN`, the function returns `NaN`. + +```javascript +var v = bernoullif( NaN ); +// returns NaN +``` + +
+ + + +
+ +
+ + + +
+ +## Examples + + + +```javascript +var bernoullif = require( '@stdlib/math/base/special/bernoullif' ); + +var v; +var i; + +for ( i = 0; i < 70; i++ ) { + v = bernoullif( i ); + console.log( v ); +} +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/bernoullif.h" +``` + +#### stdlib_base_bernoullif( n ) + +Computes the nth [Bernoulli number][bernoulli-number] of a single-precision floating-point number. + +```c +float out = stdlib_base_bernoullif( 0 ); +// returns 1.0 + +out = stdlib_base_bernoullif( 1 ); +// returns 0.0 +``` + +The function accepts the following arguments: + +- **n**: `[in] int32_t` input value. + +```c +float stdlib_base_bernoullif( const int32_t n ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/bernoullif.h" +#include +#include + +int main( void ) { + int32_t i; + float v; + + for ( i = 0; i < 130; i++ ) { + v = stdlib_base_bernoullif( i ); + printf( "bernoullif(%d) = %f\n", i, v ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js new file mode 100644 index 000000000000..73d7f1ddc6a3 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js @@ -0,0 +1,52 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var randu = require( '@stdlib/random/base/randu' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pkg = require( './../package.json' ).name; +var bernoullif = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var x; + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x = floor( randu() * 500.0 ); + y = bernoullif( x ); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js new file mode 100644 index 000000000000..4849613cbb67 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var randu = require( '@stdlib/random/base/randu' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var bernoullif = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( bernoullif instanceof Error ) +}; + + +// MAIN // + +bench( pkg+'::native', opts, function benchmark( b ) { + var x; + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x = floor( randu() * 500.0 ); + y = bernoullif( x ); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile new file mode 100644 index 000000000000..f69e9da2b4d3 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +# You may obtain a 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 + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c new file mode 100644 index 000000000000..0bcb780e59e5 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c @@ -0,0 +1,133 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +#include "stdlib/math/base/special/bernoullif.h" +#include +#include +#include +#include +#include + +#define NAME "bernoullif" +#define ITERATIONS 1000000 +#define REPEATS 3 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param elapsed elapsed time in seconds +*/ +static void print_results( double elapsed ) { + double rate = (double)ITERATIONS / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", ITERATIONS ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + double elapsed; + double t; + float x; + float y; + int i; + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + x = ( 500.0 * rand_float() ); + y = stdlib_base_bernoullif( x ); + if ( y != y ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( y != y ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int i; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + for ( i = 0; i < REPEATS; i++ ) { + printf( "# c::native::%s\n", NAME ); + elapsed = benchmark(); + print_results( elapsed ); + printf( "ok %d benchmark finished\n", i+1 ); + } + print_summary( REPEATS, REPEATS ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp b/lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp new file mode 100644 index 000000000000..ec3992233442 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +# You may obtain a 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. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt new file mode 100644 index 000000000000..e8ad52353b07 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt @@ -0,0 +1,45 @@ + +{{alias}}( n ) + Computes the nth Bernoulli number of a single-precision floating-point + number. + + If not provided a nonnegative integer value, the function returns `NaN`. + + If provided `NaN`, the function returns `NaN`. + + Parameters + ---------- + n: integer + Input value. + + Returns + ------- + y: number + Bernoulli number. + + Examples + -------- + > var y = {{alias}}( 0 ) + 1.0 + > y = {{alias}}( 1 ) + 0.0 + > y = {{alias}}( 2 ) + ~0.167 + > y = {{alias}}( 3 ) + 0.0 + > y = {{alias}}( 4 ) + ~-0.033 + > y = {{alias}}( 5 ) + 0.0 + > y = {{alias}}( 20 ) + ~-529.124 + > y = {{alias}}( 64 ) + -Infinity + > y = {{alias}}( 66 ) + Infinity + > y = {{alias}}( NaN ) + NaN + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts new file mode 100644 index 000000000000..07b777984fde --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts @@ -0,0 +1,72 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +// TypeScript Version: 4.1 + +/** +* Computes the nth Bernoulli number of a single-precision floating-point number. +* +* @param n - the Bernoulli number to compute +* @returns Bernoulli number +* +* @example +* var y = bernoullif( 0 ); +* // returns 1.0 +* +* @example +* var y = bernoullif( 1 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 2 ); +* // returns ~0.167 +* +* @example +* var y = bernoullif( 3 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 4 ); +* // returns ~-0.033 +* +* @example +* var y = bernoullif( 5 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 20 ); +* // returns ~-529.124 +* +* @example +* var y = bernoullif( 64 ); +* // returns -Infinity +* +* @example +* var y = bernoullif( 66 ); +* // returns Infinity +* +* @example +* var y = bernoullif( NaN ); +* // returns NaN +*/ +declare function bernoullif( n: number ): number; + + +// EXPORTS // + +export = bernoullif; diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts new file mode 100644 index 000000000000..f72864ff4aa4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +import bernoullif = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + bernoullif( 8 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + bernoullif( true ); // $ExpectError + bernoullif( false ); // $ExpectError + bernoullif( null ); // $ExpectError + bernoullif( undefined ); // $ExpectError + bernoullif( '5' ); // $ExpectError + bernoullif( [] ); // $ExpectError + bernoullif( {} ); // $ExpectError + bernoullif( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + bernoullif(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile new file mode 100644 index 000000000000..6aed70daf167 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +# You may obtain a 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 + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c new file mode 100644 index 000000000000..cb63122c4ed2 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c @@ -0,0 +1,31 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +#include "stdlib/math/base/special/bernoullif.h" +#include +#include + +int main( void ) { + int32_t i; + float v; + + for ( i = 0; i < 70; i++ ) { + v = stdlib_base_bernoullif( i ); + printf( "bernoulli(%d) = %f\n", i, v ); + } +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js new file mode 100644 index 000000000000..7547fd476748 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js @@ -0,0 +1,29 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +var bernoullif = require( './../lib' ); + +var v; +var i; + +for ( i = 0; i < 70; i++ ) { + v = bernoullif( i ); + console.log( v ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi b/lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi new file mode 100644 index 000000000000..575cb043c0bf --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +# You may obtain a 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. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' + +/* +* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. +*/ +#ifdef __cplusplus +extern "C" { +#endif + +/** +* Computes the nth Bernoulli number. +*/ +float stdlib_base_bernoullif( const int32_t n ); + +#ifdef __cplusplus +} +#endif + +#endif // !STDLIB_MATH_BASE_SPECIAL_BERNOULLIF_H diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json new file mode 100644 index 000000000000..3fd3373bb6cd --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json @@ -0,0 +1,34 @@ +[ + 1.00000000000000000000000000000000000000000, + 0.166666666666666666666666666666666666666667, + -0.0333333333333333333333333333333333333333333, + 0.0238095238095238095238095238095238095238095, + -0.0333333333333333333333333333333333333333333, + 0.0757575757575757575757575757575757575757576, + -0.253113553113553113553113553113553113553114, + 1.16666666666666666666666666666666666666667, + -7.09215686274509803921568627450980392156863, + 54.9711779448621553884711779448621553884712, + -529.124242424242424242424242424242424242424, + 6192.12318840579710144927536231884057971014, + -86580.2531135531135531135531135531135531136, + 1.42551716666666666666666666666666666666667e6, + -2.72982310678160919540229885057471264367816e7, + 6.01580873900642368384303868174835916771401e8, + -1.51163157670921568627450980392156862745098e10, + 4.29614643061166666666666666666666666666667e11, + -1.37116552050883327721590879485616327721591e13, + 4.88332318973593166666666666666666666666667e14, + -1.92965793419400681486326681448632668144863e16, + 8.41693047573682615000553709856035437430786e17, + -4.03380718540594554130768115942028985507246e19, + 2.11507486380819916056014539007092198581560e21, + -1.20866265222965259346027311937082525317819e23, + 7.50086674607696436685572007575757575757576e24, + -5.03877810148106891413789303052201257861635e26, + 3.65287764848181233351104308429711779448622e28, + -2.84987693024508822262691464329106781609195e30, + 2.38654274996836276446459819192192149717514e32, + -2.13999492572253336658107447651910973926742e34, + 2.05009757234780975699217330956723102516667e36 +] diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js new file mode 100644 index 000000000000..708b86ec31b7 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js @@ -0,0 +1,58 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +/** +* Compute the nth Bernoulli number of a single-precision floating-point number. +* +* @module @stdlib/math/base/special/bernoullif +* +* @example +* var bernoullif = require( '@stdlib/math/base/special/bernoullif' ); +* +* var y = bernoullif( 0 ); +* // returns 1.0 +* +* y = bernoullif( 1 ); +* // returns 0.0 +* +* y = bernoullif( 2 ); +* // returns ~0.166 +* +* y = bernoullif( 3 ); +* // returns 0.0 +* +* y = bernoullif( 4 ); +* // returns ~-0.033 +* +* y = bernoullif( 5 ); +* // returns 0.0 +* +* y = bernoullif( 20 ); +* // returns ~-529.124 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js new file mode 100644 index 000000000000..87ef0844759a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -0,0 +1,102 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +// MODULES // + +var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var isOdd = require( '@stdlib/math/base/assert/is-odd' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var BERNOULLIF = require( './bernoullif.json' ); + + +// VARIABLES // + +var MAX_BERNOULLI = 62|0; // asm type annotation + + +// MAIN // + +/** +* Computes the nth Bernoulli number of a single-precision floating-point number. +* +* @param {NonNegativeInteger} n - the Bernoulli number to compute +* @returns {number} Bernoulli number +* +* @example +* var y = bernoullif( 0 ); +* // returns 1.0 +* +* @example +* var y = bernoullif( 1 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 2 ); +* // returns ~0.167 +* +* @example +* var y = bernoullif( 3 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 4 ); +* // returns ~-0.033 +* +* @example +* var y = bernoullif( 5 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 20 ); +* // returns ~-529.124 +* +* @example +* var y = bernoullif( 64 ); +* // returns -Infinity +* +* @example +* var y = bernoullif( 66 ); +* // returns Infinity +* +* @example +* var y = bernoullif( NaN ); +* // returns NaN +*/ +function bernoullif( n ) { + if ( isnanf( n ) || !isNonNegativeInteger( n ) ) { + return NaN; + } + n = float64ToFloat32( n ); + if ( isOdd( n ) ) { + return 0.0; + } + if ( n > MAX_BERNOULLI ) { + return ( ( n/2 ) & 1 ) ? PINF : NINF; + } + return BERNOULLIF[ n/2 ]; +} + + +// EXPORTS // + +module.exports = bernoullif; diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js new file mode 100644 index 000000000000..4adb778ccf8e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js @@ -0,0 +1,77 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Computes the nth Bernoulli number of a single-precision floating-point number. +* +* @param {NonNegativeInteger} n - the Bernoulli number to compute +* @returns {number} Bernoulli number +* +* @example +* var y = bernoullif( 0 ); +* // returns 1.0 +* +* @example +* var y = bernoullif( 1 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 2 ); +* // returns ~0.167 +* +* @example +* var y = bernoullif( 3 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 4 ); +* // returns ~-0.033 +* +* @example +* var y = bernoullif( 5 ); +* // returns 0.0 +* +* @example +* var y = bernoullif( 20 ); +* // returns ~-529.124 +* +* @example +* var y = bernoullif( 64 ); +* // returns -Infinity +* +* @example +* var y = bernoullif( 66 ); +* // returns Infinity +*/ +function bernoullif( n ) { + return addon( n ); +} + + +// EXPORTS // + +module.exports = bernoullif; diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json new file mode 100644 index 000000000000..3e820564dde8 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json @@ -0,0 +1,84 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/napi/unary", + "stdlib/math/base/assert/is_nonnegative_integer.h", + "stdlib/math/base/assert/is_nanf.h", + "stdlib/math/base/assert/is_odd.h", + "stdlib/constants/float32/ninf.h", + "stdlib/constants/float32/pinf.h" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "stdlib/math/base/assert/is_nonnegative_integer.h", + "stdlib/math/base/assert/is_nanf.h", + "stdlib/math/base/assert/is_odd.h", + "stdlib/constants/float32/ninf.h", + "stdlib/constants/float32/pinf.h" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "stdlib/math/base/assert/is_nonnegative_integer.h", + "stdlib/math/base/assert/is_nanf.h", + "stdlib/math/base/assert/is_odd.h", + "stdlib/constants/float32/ninf.h", + "stdlib/constants/float32/pinf.h" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/package.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/package.json new file mode 100644 index 000000000000..e62dea9a398c --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/package.json @@ -0,0 +1,66 @@ +{ + "name": "@stdlib/math/base/special/bernoullif", + "version": "0.0.0", + "description": "Compute the nth Bernoulli number of a single-precision floating-point number.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "special functions", + "special", + "function", + "bernoulli", + "bernoullif", + "number" + ] +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile new file mode 100644 index 000000000000..bcf18aa46655 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +# You may obtain a 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 # + +#/ +# 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 diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c new file mode 100644 index 000000000000..ce7d2000b694 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c @@ -0,0 +1,23 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +#include "stdlib/math/base/special/bernoullif.h" +#include "stdlib/math/base/napi/unary.h" + +// cppcheck-suppress shadowFunction +STDLIB_MATH_BASE_NAPI_MODULE_I_F( stdlib_base_bernoullif ) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c new file mode 100644 index 000000000000..94b360d66219 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -0,0 +1,85 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +#include "stdlib/math/base/assert/is_nonnegative_integer.h" +#include "stdlib/math/base/assert/is_nanf.h" +#include "stdlib/math/base/assert/is_odd.h" +#include "stdlib/constants/float32/ninf.h" +#include "stdlib/constants/float32/pinf.h" +#include "stdlib/math/base/special/bernoullif.h" + +static const float bernoulli_value[ 32 ] = { + 1.00000000000000000000000000000000000000000, + 0.166666666666666666666666666666666666666667, + -0.0333333333333333333333333333333333333333333, + 0.0238095238095238095238095238095238095238095, + -0.0333333333333333333333333333333333333333333, + 0.0757575757575757575757575757575757575757576, + -0.253113553113553113553113553113553113553114, + 1.16666666666666666666666666666666666666667, + -7.09215686274509803921568627450980392156863, + 54.9711779448621553884711779448621553884712, + -529.124242424242424242424242424242424242424, + 6192.12318840579710144927536231884057971014, + -86580.2531135531135531135531135531135531136, + 1.42551716666666666666666666666666666666667e6, + -2.72982310678160919540229885057471264367816e7, + 6.01580873900642368384303868174835916771401e8, + -1.51163157670921568627450980392156862745098e10, + 4.29614643061166666666666666666666666666667e11, + -1.37116552050883327721590879485616327721591e13, + 4.88332318973593166666666666666666666666667e14, + -1.92965793419400681486326681448632668144863e16, + 8.41693047573682615000553709856035437430786e17, + -4.03380718540594554130768115942028985507246e19, + 2.11507486380819916056014539007092198581560e21, + -1.20866265222965259346027311937082525317819e23, + 7.50086674607696436685572007575757575757576e24, + -5.03877810148106891413789303052201257861635e26, + 3.65287764848181233351104308429711779448622e28, + -2.84987693024508822262691464329106781609195e30, + 2.38654274996836276446459819192192149717514e32, + -2.13999492572253336658107447651910973926742e34, + 2.05009757234780975699217330956723102516667e36, +}; + + +int32_t MAX_BERNOULLI = 62; + +/** +* Computes the nth Bernoulli number of a single-precision floating-point number. +* +* @param n input value +* @return output value +* +* @example +* float out = stdlib_base_bernoullif( 0 ); +* // returns 1 +*/ +float stdlib_base_bernoullif( const int32_t n ) { + if ( stdlib_base_is_nanf( n ) || !stdlib_base_is_nonnegative_integer( n ) ) { + return 0.0 / 0.0; // NaN + } + if ( stdlib_base_is_odd( n ) ) { + return 0.0; + } + if ( n > MAX_BERNOULLI ) { + return ( ( n / 2 ) & 1 ) ? STDLIB_CONSTANT_FLOAT32_PINF : STDLIB_CONSTANT_FLOAT32_NINF; + } + return bernoulli_value[ n / 2 ]; +} diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js new file mode 100644 index 000000000000..095f68bf0de3 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js @@ -0,0 +1,102 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var bernoullif = require( './../lib' ); + + +// FIXTURES // + +var BERNOULLIF = require( './../lib/bernoullif.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof bernoullif, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided a negative number, the function returns `NaN`', function test( t ) { + var v; + var i; + + t.strictEqual( isnan( bernoullif( -3.14 ) ), true, 'returns NaN' ); + + for ( i = -1; i > -50; i-- ) { + v = bernoullif( i ); + t.strictEqual( isnan( v ), true, 'returns NaN when provided ' + i ); + } + t.end(); +}); + +tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) { + var v = bernoullif( NaN ); + t.strictEqual( isnan( v ), true, 'returns NaN when provided a NaN' ); + t.end(); +}); + +tape( 'if provided a non-integer, the function returns `NaN`', function test( t ) { + var v = bernoullif( 3.14 ); + t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'the function returns the nth Bernoulli number for odd numbers', function test( t ) { + var v; + var i; + for ( i = 1; i < 500; i += 2 ) { + v = bernoullif( i ); + + // Odd Bernoulli numbers are equal to zero: + t.strictEqual( v, 0.0, 'returns the '+i+'th Bernoulli number' ); + } + t.end(); +}); + +tape( 'the function returns the nth Bernoulli number for even numbers', function test( t ) { + var v; + var i; + for ( i = 0; i < 64; i += 2 ) { + v = bernoullif( i ); + t.strictEqual( v, BERNOULLIF[ i/2 ], 'returns the '+i+'th Bernoulli number' ); + } + t.end(); +}); + +tape( 'the function returns +/- infinity for large integers', function test( t ) { + var v; + var i; + for ( i = 64; i < 500; i += 2 ) { + v = bernoullif( i ); + if ( i % 4 === 0 ) { + t.strictEqual( v, NINF, 'returns negative infinity' ); + } else { + t.strictEqual( v, PINF, 'returns positive infinity' ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js new file mode 100644 index 000000000000..9658c1a00f6a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js @@ -0,0 +1,99 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +* You may obtain a 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var bernoullif = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( bernoullif instanceof Error ) +}; + + +// FIXTURES // + +var BERNOULLIF = require( './../lib/bernoullif.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof bernoullif, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided a negative number, the function returns `NaN`', opts, function test( t ) { + var v; + var i; + + t.strictEqual( isnan( bernoullif( -3.14 ) ), true, 'returns NaN' ); + + for ( i = -1; i > -50; i-- ) { + v = bernoullif( i ); + t.strictEqual( isnan( v ), true, 'returns NaN when provided ' + i ); + } + t.end(); +}); + +tape( 'the function returns the nth Bernoulli number for odd numbers', opts, function test( t ) { + var v; + var i; + for ( i = 1; i < 500; i += 2 ) { + v = bernoullif( i ); + + // Odd Bernoulli numbers are equal to zero: + t.strictEqual( v, 0.0, 'returns the '+i+'th Bernoulli number' ); + } + t.end(); +}); + +tape( 'the function returns the nth Bernoulli number for even numbers', opts, function test( t ) { + var v; + var i; + for ( i = 0; i < 64; i += 2 ) { + v = bernoullif( i ); + t.strictEqual( v, BERNOULLIF[ i/2 ], 'returns the '+i+'th Bernoulli number' ); + } + t.end(); +}); + +tape( 'the function returns +/- infinity for large integers', opts, function test( t ) { + var v; + var i; + for ( i = 64; i < 500; i += 2 ) { + v = bernoullif( i ); + if ( i % 4 === 0 ) { + t.strictEqual( v, NINF, 'returns negative infinity' ); + } else { + t.strictEqual( v, PINF, 'returns positive infinity' ); + } + } + t.end(); +}); From c54b6bc0a637e7de87e161da909392b80a77168f Mon Sep 17 00:00:00 2001 From: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:32:43 +0530 Subject: [PATCH 02/17] Update lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c Co-authored-by: Athan Signed-off-by: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> --- .../@stdlib/math/base/special/bernoullif/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index 94b360d66219..537d30388119 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -59,7 +59,7 @@ static const float bernoulli_value[ 32 ] = { }; -int32_t MAX_BERNOULLI = 62; +static const int32_t MAX_BERNOULLI = 62; /** * Computes the nth Bernoulli number of a single-precision floating-point number. From 5489bb6f7c96e22dbb763c11becdaa67f4cea3e8 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Sun, 27 Oct 2024 21:16:20 +0530 Subject: [PATCH 03/17] fix: manifest.json file dependencies --- .../base/special/bernoullif/manifest.json | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json index 3e820564dde8..00d66b7f56b2 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json @@ -37,11 +37,11 @@ "libpath": [], "dependencies": [ "@stdlib/math/base/napi/unary", - "stdlib/math/base/assert/is_nonnegative_integer.h", - "stdlib/math/base/assert/is_nanf.h", - "stdlib/math/base/assert/is_odd.h", - "stdlib/constants/float32/ninf.h", - "stdlib/constants/float32/pinf.h" + "@stdlib/math/base/assert/is_nonnegative_integer.h", + "@stdlib/math/base/assert/is_nanf.h", + "@stdlib/math/base/assert/is_odd.h", + "@stdlib/constants/float32/ninf.h", + "@stdlib/constants/float32/pinf.h" ] }, { @@ -55,11 +55,11 @@ "libraries": [], "libpath": [], "dependencies": [ - "stdlib/math/base/assert/is_nonnegative_integer.h", - "stdlib/math/base/assert/is_nanf.h", - "stdlib/math/base/assert/is_odd.h", - "stdlib/constants/float32/ninf.h", - "stdlib/constants/float32/pinf.h" + "@stdlib/math/base/assert/is_nonnegative_integer.h", + "@stdlib/math/base/assert/is_nanf.h", + "@stdlib/math/base/assert/is_odd.h", + "@stdlib/constants/float32/ninf.h", + "@stdlib/constants/float32/pinf.h" ] }, { @@ -73,11 +73,11 @@ "libraries": [], "libpath": [], "dependencies": [ - "stdlib/math/base/assert/is_nonnegative_integer.h", - "stdlib/math/base/assert/is_nanf.h", - "stdlib/math/base/assert/is_odd.h", - "stdlib/constants/float32/ninf.h", - "stdlib/constants/float32/pinf.h" + "@stdlib/math/base/assert/is_nonnegative_integer.h", + "@stdlib/math/base/assert/is_nanf.h", + "@stdlib/math/base/assert/is_odd.h", + "@stdlib/constants/float32/ninf.h", + "@stdlib/constants/float32/pinf.h" ] } ] From 1824084f8cf717371719ea431f747c3be25952e5 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Mon, 28 Oct 2024 12:53:14 +0530 Subject: [PATCH 04/17] fix: apply review changes --- .../math/base/special/bernoullif/lib/main.js | 2 -- .../base/special/bernoullif/manifest.json | 30 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js index 87ef0844759a..e9521d685b2b 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -21,7 +21,6 @@ // MODULES // var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var isOdd = require( '@stdlib/math/base/assert/is-odd' ); var NINF = require( '@stdlib/constants/float32/ninf' ); @@ -86,7 +85,6 @@ function bernoullif( n ) { if ( isnanf( n ) || !isNonNegativeInteger( n ) ) { return NaN; } - n = float64ToFloat32( n ); if ( isOdd( n ) ) { return 0.0; } diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json index 00d66b7f56b2..a8502792a24a 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json @@ -37,11 +37,11 @@ "libpath": [], "dependencies": [ "@stdlib/math/base/napi/unary", - "@stdlib/math/base/assert/is_nonnegative_integer.h", - "@stdlib/math/base/assert/is_nanf.h", - "@stdlib/math/base/assert/is_odd.h", - "@stdlib/constants/float32/ninf.h", - "@stdlib/constants/float32/pinf.h" + "@stdlib/math/base/assert/is_nonnegative_integer", + "@stdlib/math/base/assert/is_nanf", + "@stdlib/math/base/assert/is_odd", + "@stdlib/constants/float32/ninf", + "@stdlib/constants/float32/pinf" ] }, { @@ -55,11 +55,11 @@ "libraries": [], "libpath": [], "dependencies": [ - "@stdlib/math/base/assert/is_nonnegative_integer.h", - "@stdlib/math/base/assert/is_nanf.h", - "@stdlib/math/base/assert/is_odd.h", - "@stdlib/constants/float32/ninf.h", - "@stdlib/constants/float32/pinf.h" + "@stdlib/math/base/assert/is_nonnegative_integer", + "@stdlib/math/base/assert/is_nanf", + "@stdlib/math/base/assert/is_odd", + "@stdlib/constants/float32/ninf", + "@stdlib/constants/float32/pinf" ] }, { @@ -73,11 +73,11 @@ "libraries": [], "libpath": [], "dependencies": [ - "@stdlib/math/base/assert/is_nonnegative_integer.h", - "@stdlib/math/base/assert/is_nanf.h", - "@stdlib/math/base/assert/is_odd.h", - "@stdlib/constants/float32/ninf.h", - "@stdlib/constants/float32/pinf.h" + "@stdlib/math/base/assert/is_nonnegative_integer", + "@stdlib/math/base/assert/is_nanf", + "@stdlib/math/base/assert/is_odd", + "@stdlib/constants/float32/ninf", + "@stdlib/constants/float32/pinf" ] } ] From d6e8e6bf542664baed1188df2b64b976e163f68a Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Mon, 28 Oct 2024 18:35:18 +0530 Subject: [PATCH 05/17] fix: changes --- .../math/base/special/bernoullif/benchmark/benchmark.js | 2 +- .../base/special/bernoullif/benchmark/benchmark.native.js | 2 +- .../@stdlib/math/base/special/bernoullif/lib/main.js | 3 ++- .../@stdlib/math/base/special/bernoullif/test/test.js | 7 ++++--- .../math/base/special/bernoullif/test/test.native.js | 7 ++++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js index 73d7f1ddc6a3..de3ca18ec85e 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js @@ -22,7 +22,7 @@ var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); +var floor = require( '@stdlib/math/base/special/floorf' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pkg = require( './../package.json' ).name; var bernoullif = require( './../lib' ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js index 4849613cbb67..084ef63f0c7e 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js @@ -23,7 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floor' ); +var floor = require( '@stdlib/math/base/special/floorf' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js index e9521d685b2b..4fc654cecd6e 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -21,6 +21,7 @@ // MODULES // var isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var isOdd = require( '@stdlib/math/base/assert/is-odd' ); var NINF = require( '@stdlib/constants/float32/ninf' ); @@ -91,7 +92,7 @@ function bernoullif( n ) { if ( n > MAX_BERNOULLI ) { return ( ( n/2 ) & 1 ) ? PINF : NINF; } - return BERNOULLIF[ n/2 ]; + return float64ToFloat32( BERNOULLIF[ n/2 ] ); } diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js index 095f68bf0de3..9fc46fb9673a 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js @@ -21,9 +21,10 @@ // MODULES // var tape = require( 'tape' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); var bernoullif = require( './../lib' ); @@ -82,7 +83,7 @@ tape( 'the function returns the nth Bernoulli number for even numbers', function var i; for ( i = 0; i < 64; i += 2 ) { v = bernoullif( i ); - t.strictEqual( v, BERNOULLIF[ i/2 ], 'returns the '+i+'th Bernoulli number' ); + t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i/2 ] ), 'returns the '+i+'th Bernoulli number' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js index 9658c1a00f6a..e50fc421d0ce 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js @@ -22,9 +22,10 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var NINF = require( '@stdlib/constants/float64/ninf' ); -var PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -79,7 +80,7 @@ tape( 'the function returns the nth Bernoulli number for even numbers', opts, fu var i; for ( i = 0; i < 64; i += 2 ) { v = bernoullif( i ); - t.strictEqual( v, BERNOULLIF[ i/2 ], 'returns the '+i+'th Bernoulli number' ); + t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i/2 ] ), 'returns the '+i+'th Bernoulli number' ); } t.end(); }); From 7c37cc04f4a22f1daad48771eb81a3f8fa87a0d3 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Sat, 2 Nov 2024 17:11:35 +0530 Subject: [PATCH 06/17] fix: check errors --- .../@stdlib/math/base/special/bernoullif/manifest.json | 6 +++--- .../@stdlib/math/base/special/bernoullif/src/main.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json index a8502792a24a..7f186dd2360d 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json @@ -38,7 +38,7 @@ "dependencies": [ "@stdlib/math/base/napi/unary", "@stdlib/math/base/assert/is_nonnegative_integer", - "@stdlib/math/base/assert/is_nanf", + "@stdlib/math/base/assert/is_nan", "@stdlib/math/base/assert/is_odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" @@ -56,7 +56,7 @@ "libpath": [], "dependencies": [ "@stdlib/math/base/assert/is_nonnegative_integer", - "@stdlib/math/base/assert/is_nanf", + "@stdlib/math/base/assert/is_nan", "@stdlib/math/base/assert/is_odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" @@ -74,7 +74,7 @@ "libpath": [], "dependencies": [ "@stdlib/math/base/assert/is_nonnegative_integer", - "@stdlib/math/base/assert/is_nanf", + "@stdlib/math/base/assert/is_nan", "@stdlib/math/base/assert/is_odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index 537d30388119..86ea7dd1836c 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -16,12 +16,12 @@ * limitations under the License. */ +#include "stdlib/math/base/special/bernoullif.h" #include "stdlib/math/base/assert/is_nonnegative_integer.h" -#include "stdlib/math/base/assert/is_nanf.h" +#include "stdlib/math/base/assert/is_nan.h" #include "stdlib/math/base/assert/is_odd.h" #include "stdlib/constants/float32/ninf.h" #include "stdlib/constants/float32/pinf.h" -#include "stdlib/math/base/special/bernoullif.h" static const float bernoulli_value[ 32 ] = { 1.00000000000000000000000000000000000000000, @@ -72,7 +72,7 @@ static const int32_t MAX_BERNOULLI = 62; * // returns 1 */ float stdlib_base_bernoullif( const int32_t n ) { - if ( stdlib_base_is_nanf( n ) || !stdlib_base_is_nonnegative_integer( n ) ) { + if ( stdlib_base_is_nan( n ) || !stdlib_base_is_nonnegative_integer( n ) ) { return 0.0 / 0.0; // NaN } if ( stdlib_base_is_odd( n ) ) { From aca6ec3684145b4e471098764d48335e766c678b Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Tue, 5 Nov 2024 20:37:49 +0530 Subject: [PATCH 07/17] fix: bernoullif manifest.json file --- .../math/base/special/bernoullif/manifest.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json index 7f186dd2360d..b6625241cff6 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json @@ -37,9 +37,9 @@ "libpath": [], "dependencies": [ "@stdlib/math/base/napi/unary", - "@stdlib/math/base/assert/is_nonnegative_integer", - "@stdlib/math/base/assert/is_nan", - "@stdlib/math/base/assert/is_odd", + "@stdlib/math/base/assert/is-nonnegative-integer", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/assert/is-odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" ] @@ -55,9 +55,9 @@ "libraries": [], "libpath": [], "dependencies": [ - "@stdlib/math/base/assert/is_nonnegative_integer", - "@stdlib/math/base/assert/is_nan", - "@stdlib/math/base/assert/is_odd", + "@stdlib/math/base/assert/is-nonnegative-integer", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/assert/is-odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" ] @@ -73,9 +73,9 @@ "libraries": [], "libpath": [], "dependencies": [ - "@stdlib/math/base/assert/is_nonnegative_integer", - "@stdlib/math/base/assert/is_nan", - "@stdlib/math/base/assert/is_odd", + "@stdlib/math/base/assert/is-nonnegative-integer", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/assert/is-odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" ] From 2dcd971641cd8abeb1b58b296fe963b24095dc7c Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Fri, 15 Nov 2024 00:12:23 +0530 Subject: [PATCH 08/17] refactor: update return value for n=1 --- .../math/base/special/bernoullif/README.md | 4 ++-- .../math/base/special/bernoullif/docs/repl.txt | 2 +- .../special/bernoullif/docs/types/index.d.ts | 2 +- .../math/base/special/bernoullif/lib/index.js | 2 +- .../math/base/special/bernoullif/lib/main.js | 5 ++++- .../math/base/special/bernoullif/lib/native.js | 2 +- .../math/base/special/bernoullif/manifest.json | 6 ------ .../math/base/special/bernoullif/src/main.c | 7 ++++--- .../math/base/special/bernoullif/test/test.js | 18 ++++++++++++------ .../special/bernoullif/test/test.native.js | 12 +++++++++--- 10 files changed, 35 insertions(+), 25 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md index 9920f686e3e2..37b5e5cbbde9 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md @@ -43,7 +43,7 @@ var v = bernoullif( 0 ); // returns 1.0 v = bernoullif( 1 ); -// returns 0.0 +// returns 0.5 v = bernoullif( 2 ); // returns ~0.167 @@ -158,7 +158,7 @@ float out = stdlib_base_bernoullif( 0 ); // returns 1.0 out = stdlib_base_bernoullif( 1 ); -// returns 0.0 +// returns 0.5 ``` The function accepts the following arguments: diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt index e8ad52353b07..08283b1d8d28 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt @@ -22,7 +22,7 @@ > var y = {{alias}}( 0 ) 1.0 > y = {{alias}}( 1 ) - 0.0 + 0.5 > y = {{alias}}( 2 ) ~0.167 > y = {{alias}}( 3 ) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts index 07b777984fde..f7ca7ef957ff 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts @@ -30,7 +30,7 @@ * * @example * var y = bernoullif( 1 ); -* // returns 0.0 +* // returns 0.5 * * @example * var y = bernoullif( 2 ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js index 708b86ec31b7..e963c8871d6d 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js @@ -30,7 +30,7 @@ * // returns 1.0 * * y = bernoullif( 1 ); -* // returns 0.0 +* // returns 0.5 * * y = bernoullif( 2 ); * // returns ~0.166 diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js index 4fc654cecd6e..2a22e7a0d064 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -48,7 +48,7 @@ var MAX_BERNOULLI = 62|0; // asm type annotation * * @example * var y = bernoullif( 1 ); -* // returns 0.0 +* // returns 0.5 * * @example * var y = bernoullif( 2 ); @@ -86,6 +86,9 @@ function bernoullif( n ) { if ( isnanf( n ) || !isNonNegativeInteger( n ) ) { return NaN; } + if ( n == 1 ) { + return 0.5; + } if ( isOdd( n ) ) { return 0.0; } diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js index 4adb778ccf8e..52fb480c3f4a 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js @@ -37,7 +37,7 @@ var addon = require( './../src/addon.node' ); * * @example * var y = bernoullif( 1 ); -* // returns 0.0 +* // returns 0.5 * * @example * var y = bernoullif( 2 ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json index b6625241cff6..15de4a2cf1ad 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/manifest.json @@ -37,8 +37,6 @@ "libpath": [], "dependencies": [ "@stdlib/math/base/napi/unary", - "@stdlib/math/base/assert/is-nonnegative-integer", - "@stdlib/math/base/assert/is-nan", "@stdlib/math/base/assert/is-odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" @@ -55,8 +53,6 @@ "libraries": [], "libpath": [], "dependencies": [ - "@stdlib/math/base/assert/is-nonnegative-integer", - "@stdlib/math/base/assert/is-nan", "@stdlib/math/base/assert/is-odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" @@ -73,8 +69,6 @@ "libraries": [], "libpath": [], "dependencies": [ - "@stdlib/math/base/assert/is-nonnegative-integer", - "@stdlib/math/base/assert/is-nan", "@stdlib/math/base/assert/is-odd", "@stdlib/constants/float32/ninf", "@stdlib/constants/float32/pinf" diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index 86ea7dd1836c..262afdb779cc 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -17,8 +17,6 @@ */ #include "stdlib/math/base/special/bernoullif.h" -#include "stdlib/math/base/assert/is_nonnegative_integer.h" -#include "stdlib/math/base/assert/is_nan.h" #include "stdlib/math/base/assert/is_odd.h" #include "stdlib/constants/float32/ninf.h" #include "stdlib/constants/float32/pinf.h" @@ -72,9 +70,12 @@ static const int32_t MAX_BERNOULLI = 62; * // returns 1 */ float stdlib_base_bernoullif( const int32_t n ) { - if ( stdlib_base_is_nan( n ) || !stdlib_base_is_nonnegative_integer( n ) ) { + if ( n < 0 ) { return 0.0 / 0.0; // NaN } + if ( n == 1 ) { + return 0.5; + } if ( stdlib_base_is_odd( n ) ) { return 0.0; } diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js index 9fc46fb9673a..fd5aa5b08444 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js @@ -49,27 +49,33 @@ tape( 'if provided a negative number, the function returns `NaN`', function test for ( i = -1; i > -50; i-- ) { v = bernoullif( i ); - t.strictEqual( isnan( v ), true, 'returns NaN when provided ' + i ); + t.strictEqual( isnan( v ), true, 'returns expected value when provided ' + i ); } t.end(); }); +tape( 'if provided `1`, the function returns `0.5`', function test( t ) { + var v = bernoullif( 1 ); + t.strictEqual( v, 0.5, 'returns expected value' ); + t.end(); +}); + tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) { var v = bernoullif( NaN ); - t.strictEqual( isnan( v ), true, 'returns NaN when provided a NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided a non-integer, the function returns `NaN`', function test( t ) { var v = bernoullif( 3.14 ); - t.strictEqual( isnan( v ), true, 'returns NaN' ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); t.end(); }); tape( 'the function returns the nth Bernoulli number for odd numbers', function test( t ) { var v; var i; - for ( i = 1; i < 500; i += 2 ) { + for ( i = 3; i < 500; i += 2 ) { v = bernoullif( i ); // Odd Bernoulli numbers are equal to zero: @@ -94,9 +100,9 @@ tape( 'the function returns +/- infinity for large integers', function test( t ) for ( i = 64; i < 500; i += 2 ) { v = bernoullif( i ); if ( i % 4 === 0 ) { - t.strictEqual( v, NINF, 'returns negative infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); } else { - t.strictEqual( v, PINF, 'returns positive infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); } } t.end(); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js index e50fc421d0ce..a8cdf80371fc 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js @@ -63,10 +63,16 @@ tape( 'if provided a negative number, the function returns `NaN`', opts, functio t.end(); }); +tape( 'if provided `1`, the function returns `0.5`', opts, function test( t ) { + var v = bernoullif( 1 ); + t.strictEqual( v, 0.5, 'returns expected value' ); + t.end(); +}); + tape( 'the function returns the nth Bernoulli number for odd numbers', opts, function test( t ) { var v; var i; - for ( i = 1; i < 500; i += 2 ) { + for ( i = 3; i < 500; i += 2 ) { v = bernoullif( i ); // Odd Bernoulli numbers are equal to zero: @@ -91,9 +97,9 @@ tape( 'the function returns +/- infinity for large integers', opts, function tes for ( i = 64; i < 500; i += 2 ) { v = bernoullif( i ); if ( i % 4 === 0 ) { - t.strictEqual( v, NINF, 'returns negative infinity' ); + t.strictEqual( v, NINF, 'returns expected value' ); } else { - t.strictEqual( v, PINF, 'returns positive infinity' ); + t.strictEqual( v, PINF, 'returns expected value' ); } } t.end(); From 46c3d205e74820f5e0d793df3cabdc954fd30a75 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Fri, 15 Nov 2024 00:22:56 +0530 Subject: [PATCH 09/17] fix: lint error --- .../@stdlib/math/base/special/bernoullif/lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js index 2a22e7a0d064..187132ef279d 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -86,7 +86,7 @@ function bernoullif( n ) { if ( isnanf( n ) || !isNonNegativeInteger( n ) ) { return NaN; } - if ( n == 1 ) { + if ( n === 1 ) { return 0.5; } if ( isOdd( n ) ) { From 26348081cb5e3b38a826ad149845355551e4977f Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Fri, 22 Nov 2024 17:00:02 +0530 Subject: [PATCH 10/17] refactor: as per suggested --- .../math/base/special/bernoullif/README.md | 16 ++--- .../special/bernoullif/benchmark/benchmark.js | 4 +- .../bernoullif/benchmark/benchmark.native.js | 4 +- .../base/special/bernoullif/docs/repl.txt | 6 +- .../special/bernoullif/docs/types/index.d.ts | 10 +-- .../special/bernoullif/lib/bernoullif.json | 3 +- .../math/base/special/bernoullif/lib/index.js | 2 +- .../math/base/special/bernoullif/lib/main.js | 12 ++-- .../base/special/bernoullif/lib/native.js | 10 +-- .../math/base/special/bernoullif/package.json | 2 +- .../math/base/special/bernoullif/src/main.c | 67 ++++++++++--------- .../math/base/special/bernoullif/test/test.js | 14 ++-- .../special/bernoullif/test/test.native.js | 10 +-- 13 files changed, 81 insertions(+), 79 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md index 37b5e5cbbde9..5929b3574dd6 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md @@ -20,7 +20,7 @@ limitations under the License. # bernoullif -> Compute the nth [Bernoulli number][bernoulli-number] of a single-precision floating-point number. +> Compute the nth [Bernoulli number][bernoulli-number] as a single-precision floating-point number.
@@ -36,7 +36,7 @@ var bernoullif = require( '@stdlib/math/base/special/bernoullif' ); #### bernoullif( n ) -Computes the nth [Bernoulli number][bernoulli-number] of a single-precision floating-point number. +Compute the nth [Bernoulli number][bernoulli-number] as a single-precision floating-point number. ```javascript var v = bernoullif( 0 ); @@ -61,17 +61,17 @@ v = bernoullif( 20 ); // returns ~-529.124 ``` -For even integers `n >= 64`, the function alternates between returning positive and negative infinity, as larger [Bernoulli numbers][bernoulli-number] cannot be safely represented in [single-precision floating-point format][ieee754] +For even integers `n >= 66`, the function alternates between returning positive and negative infinity, as larger [Bernoulli numbers][bernoulli-number] cannot be safely represented in [single-precision floating-point format][ieee754] ```javascript -var v = bernoullif( 64 ); -// returns -Infinity - -v = bernoullif( 66 ); +var v = bernoullif( 66 ); // returns Infinity v = bernoullif( 68 ); // returns -Infinity + +v = bernoullif( 70 ); +// returns Infinity ``` If not provided a nonnegative integer value, the function returns `NaN`. @@ -151,7 +151,7 @@ for ( i = 0; i < 70; i++ ) { #### stdlib_base_bernoullif( n ) -Computes the nth [Bernoulli number][bernoulli-number] of a single-precision floating-point number. +Compute the nth [Bernoulli number][bernoulli-number] as a single-precision floating-point number. ```c float out = stdlib_base_bernoullif( 0 ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js index de3ca18ec85e..84e4eb901de3 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js @@ -22,7 +22,7 @@ var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floorf' ); +var floorf = require( '@stdlib/math/base/special/floorf' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pkg = require( './../package.json' ).name; var bernoullif = require( './../lib' ); @@ -37,7 +37,7 @@ bench( pkg, function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = floor( randu() * 500.0 ); + x = floorf( randu() * 500.0 ); y = bernoullif( x ); if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js index 084ef63f0c7e..23f6c8ab8328 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js @@ -23,7 +23,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random/base/randu' ); -var floor = require( '@stdlib/math/base/special/floorf' ); +var floorf = require( '@stdlib/math/base/special/floorf' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -46,7 +46,7 @@ bench( pkg+'::native', opts, function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = floor( randu() * 500.0 ); + x = floorf( randu() * 500.0 ); y = bernoullif( x ); if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt index 08283b1d8d28..1a4f8672bbc5 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt @@ -1,6 +1,6 @@ {{alias}}( n ) - Computes the nth Bernoulli number of a single-precision floating-point + Compute the nth Bernoulli number as a single-precision floating-point number. If not provided a nonnegative integer value, the function returns `NaN`. @@ -33,10 +33,10 @@ 0.0 > y = {{alias}}( 20 ) ~-529.124 - > y = {{alias}}( 64 ) - -Infinity > y = {{alias}}( 66 ) Infinity + > y = {{alias}}( 68 ) + -Infinity > y = {{alias}}( NaN ) NaN diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts index f7ca7ef957ff..fe8da137343a 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts @@ -19,7 +19,7 @@ // TypeScript Version: 4.1 /** -* Computes the nth Bernoulli number of a single-precision floating-point number. +* Compute the nth Bernoulli number as a single-precision floating-point number. * * @param n - the Bernoulli number to compute * @returns Bernoulli number @@ -53,14 +53,14 @@ * // returns ~-529.124 * * @example -* var y = bernoullif( 64 ); -* // returns -Infinity -* -* @example * var y = bernoullif( 66 ); * // returns Infinity * * @example +* var y = bernoullif( 68 ); +* // returns -Infinity +* +* @example * var y = bernoullif( NaN ); * // returns NaN */ diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json index 3fd3373bb6cd..619bfaebd415 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/bernoullif.json @@ -30,5 +30,6 @@ -2.84987693024508822262691464329106781609195e30, 2.38654274996836276446459819192192149717514e32, -2.13999492572253336658107447651910973926742e34, - 2.05009757234780975699217330956723102516667e36 + 2.05009757234780975699217330956723102516667e36, + -2.09380059113463784090951852900279701847092e38 ] diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js index e963c8871d6d..ae50a89599ad 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Compute the nth Bernoulli number of a single-precision floating-point number. +* Compute the nth Bernoulli number as a single-precision floating-point number. * * @module @stdlib/math/base/special/bernoullif * diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js index 187132ef279d..dea221fb43a1 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -31,13 +31,13 @@ var BERNOULLIF = require( './bernoullif.json' ); // VARIABLES // -var MAX_BERNOULLI = 62|0; // asm type annotation +var MAX_BERNOULLI = 64|0; // asm type annotation // MAIN // /** -* Computes the nth Bernoulli number of a single-precision floating-point number. +* Compute the nth Bernoulli number as a single-precision floating-point number. * * @param {NonNegativeInteger} n - the Bernoulli number to compute * @returns {number} Bernoulli number @@ -71,14 +71,14 @@ var MAX_BERNOULLI = 62|0; // asm type annotation * // returns ~-529.124 * * @example -* var y = bernoullif( 64 ); -* // returns -Infinity -* -* @example * var y = bernoullif( 66 ); * // returns Infinity * * @example +* var y = bernoullif( 68 ); +* // returns -Infinity +* +* @example * var y = bernoullif( NaN ); * // returns NaN */ diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js index 52fb480c3f4a..aec8c0b9317e 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js @@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' ); // MAIN // /** -* Computes the nth Bernoulli number of a single-precision floating-point number. +* Compute the nth Bernoulli number as a single-precision floating-point number. * * @param {NonNegativeInteger} n - the Bernoulli number to compute * @returns {number} Bernoulli number @@ -60,12 +60,12 @@ var addon = require( './../src/addon.node' ); * // returns ~-529.124 * * @example -* var y = bernoullif( 64 ); -* // returns -Infinity -* -* @example * var y = bernoullif( 66 ); * // returns Infinity +* +* @example +* var y = bernoullif( 68 ); +* // returns -Infinity */ function bernoullif( n ) { return addon( n ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/package.json b/lib/node_modules/@stdlib/math/base/special/bernoullif/package.json index e62dea9a398c..57a8d2c44357 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/package.json +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/math/base/special/bernoullif", "version": "0.0.0", - "description": "Compute the nth Bernoulli number of a single-precision floating-point number.", + "description": "Compute the nth Bernoulli number as a single-precision floating-point number.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index 262afdb779cc..f72e0d656810 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -22,45 +22,46 @@ #include "stdlib/constants/float32/pinf.h" static const float bernoulli_value[ 32 ] = { - 1.00000000000000000000000000000000000000000, - 0.166666666666666666666666666666666666666667, - -0.0333333333333333333333333333333333333333333, - 0.0238095238095238095238095238095238095238095, - -0.0333333333333333333333333333333333333333333, - 0.0757575757575757575757575757575757575757576, - -0.253113553113553113553113553113553113553114, - 1.16666666666666666666666666666666666666667, - -7.09215686274509803921568627450980392156863, - 54.9711779448621553884711779448621553884712, - -529.124242424242424242424242424242424242424, - 6192.12318840579710144927536231884057971014, - -86580.2531135531135531135531135531135531136, - 1.42551716666666666666666666666666666666667e6, - -2.72982310678160919540229885057471264367816e7, - 6.01580873900642368384303868174835916771401e8, - -1.51163157670921568627450980392156862745098e10, - 4.29614643061166666666666666666666666666667e11, - -1.37116552050883327721590879485616327721591e13, - 4.88332318973593166666666666666666666666667e14, - -1.92965793419400681486326681448632668144863e16, - 8.41693047573682615000553709856035437430786e17, - -4.03380718540594554130768115942028985507246e19, - 2.11507486380819916056014539007092198581560e21, - -1.20866265222965259346027311937082525317819e23, - 7.50086674607696436685572007575757575757576e24, - -5.03877810148106891413789303052201257861635e26, - 3.65287764848181233351104308429711779448622e28, - -2.84987693024508822262691464329106781609195e30, - 2.38654274996836276446459819192192149717514e32, - -2.13999492572253336658107447651910973926742e34, - 2.05009757234780975699217330956723102516667e36, + 1.0000000000000000f, + 0.1666666666666666f, + -0.0333333333333333f, + 0.0238095238095238f, + -0.0333333333333333f, + 0.0757575757575757f, + -0.2531135531135531f, + 1.1666666666666666f, + -7.0921568627450980f, + 54.9711779448621553f, + -529.1242424242424242f, + 6192.1231884057971014f, + -86580.2531135531135531f, + 1.4255171666666666e+6f, + -2.7298231067816091e+7f, + 6.0158087390064236e+8f, + -1.5116315767092156e+10f, + 4.2961464306116666e+11f, + -1.3711655205088332e+13f, + 4.8833231897359316e+14f, + -1.9296579341940068e+16f, + 8.4169304757368261e+17f, + -4.0338071854059455e+19f, + 2.1150748638081991e+21f, + -1.2086626522296525e+23f, + 7.5008667460769643e+24f, + -5.0387781014810689e+26f, + 3.6528776484818123e+28f, + -2.8498769302450882e+30f, + 2.3865427499683627e+32f, + -2.1399949257225333e+34f, + 2.0500975723478097e+36f, + -2.0938006042234345e+38f }; static const int32_t MAX_BERNOULLI = 62; /** -* Computes the nth Bernoulli number of a single-precision floating-point number. +* Compute the nth Bernoulli number as a single-precision floating-point number. * * @param n input value * @return output value diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js index fd5aa5b08444..3807d666496e 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js @@ -22,7 +22,7 @@ var tape = require( 'tape' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var NINF = require( '@stdlib/constants/float32/ninf' ); var PINF = require( '@stdlib/constants/float32/pinf' ); var bernoullif = require( './../lib' ); @@ -45,11 +45,11 @@ tape( 'if provided a negative number, the function returns `NaN`', function test var v; var i; - t.strictEqual( isnan( bernoullif( -3.14 ) ), true, 'returns NaN' ); + t.strictEqual( isnanf( bernoullif( -3.14 ) ), true, 'returns NaN' ); for ( i = -1; i > -50; i-- ) { v = bernoullif( i ); - t.strictEqual( isnan( v ), true, 'returns expected value when provided ' + i ); + t.strictEqual( isnanf( v ), true, 'returns expected value when provided ' + i ); } t.end(); }); @@ -62,13 +62,13 @@ tape( 'if provided `1`, the function returns `0.5`', function test( t ) { tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) { var v = bernoullif( NaN ); - t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); t.end(); }); tape( 'if provided a non-integer, the function returns `NaN`', function test( t ) { var v = bernoullif( 3.14 ); - t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); t.end(); }); @@ -87,7 +87,7 @@ tape( 'the function returns the nth Bernoulli number for odd numbers', function tape( 'the function returns the nth Bernoulli number for even numbers', function test( t ) { var v; var i; - for ( i = 0; i < 64; i += 2 ) { + for ( i = 0; i < 66; i += 2 ) { v = bernoullif( i ); t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i/2 ] ), 'returns the '+i+'th Bernoulli number' ); } @@ -97,7 +97,7 @@ tape( 'the function returns the nth Bernoulli number for even numbers', function tape( 'the function returns +/- infinity for large integers', function test( t ) { var v; var i; - for ( i = 64; i < 500; i += 2 ) { + for ( i = 66; i < 500; i += 2 ) { v = bernoullif( i ); if ( i % 4 === 0 ) { t.strictEqual( v, NINF, 'returns expected value' ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js index a8cdf80371fc..69382155157a 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js @@ -23,7 +23,7 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var NINF = require( '@stdlib/constants/float32/ninf' ); var PINF = require( '@stdlib/constants/float32/pinf' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -54,11 +54,11 @@ tape( 'if provided a negative number, the function returns `NaN`', opts, functio var v; var i; - t.strictEqual( isnan( bernoullif( -3.14 ) ), true, 'returns NaN' ); + t.strictEqual( isnanf( bernoullif( -3.14 ) ), true, 'returns NaN' ); for ( i = -1; i > -50; i-- ) { v = bernoullif( i ); - t.strictEqual( isnan( v ), true, 'returns NaN when provided ' + i ); + t.strictEqual( isnanf( v ), true, 'returns NaN when provided ' + i ); } t.end(); }); @@ -84,7 +84,7 @@ tape( 'the function returns the nth Bernoulli number for odd numbers', opts, fun tape( 'the function returns the nth Bernoulli number for even numbers', opts, function test( t ) { var v; var i; - for ( i = 0; i < 64; i += 2 ) { + for ( i = 0; i < 66; i += 2 ) { v = bernoullif( i ); t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i/2 ] ), 'returns the '+i+'th Bernoulli number' ); } @@ -94,7 +94,7 @@ tape( 'the function returns the nth Bernoulli number for even numbers', opts, fu tape( 'the function returns +/- infinity for large integers', opts, function test( t ) { var v; var i; - for ( i = 64; i < 500; i += 2 ) { + for ( i = 66; i < 500; i += 2 ) { v = bernoullif( i ); if ( i % 4 === 0 ) { t.strictEqual( v, NINF, 'returns expected value' ); From 90cb9e161e9cfb36772e2217c55dba4c49261559 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Fri, 22 Nov 2024 17:06:44 +0530 Subject: [PATCH 11/17] refactor: max_bernoullif to 64 --- .../@stdlib/math/base/special/bernoullif/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index f72e0d656810..62dac4cbc8c6 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -58,7 +58,7 @@ static const float bernoulli_value[ 32 ] = { }; -static const int32_t MAX_BERNOULLI = 62; +static const int32_t MAX_BERNOULLI = 64; /** * Compute the nth Bernoulli number as a single-precision floating-point number. From 0ba3ac6fe3bd1035ddc541c9e7a79ea170fbd172 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:30:03 +0530 Subject: [PATCH 12/17] Update main.c Signed-off-by: Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> --- .../@stdlib/math/base/special/bernoullif/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index 62dac4cbc8c6..a47d3b2482bf 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -21,7 +21,7 @@ #include "stdlib/constants/float32/ninf.h" #include "stdlib/constants/float32/pinf.h" -static const float bernoulli_value[ 32 ] = { +static const float bernoulli_value[ 33 ] = { 1.0000000000000000f, 0.1666666666666666f, -0.0333333333333333f, From 9822a8356d4dbfcf6a0618a8078c923913ac5a29 Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Thu, 5 Dec 2024 16:38:40 +0530 Subject: [PATCH 13/17] Apply suggestions from code review Signed-off-by: Gunj Joshi --- .../@stdlib/math/base/special/bernoullif/docs/repl.txt | 2 +- .../math/base/special/bernoullif/docs/types/index.d.ts | 2 +- .../include/stdlib/math/base/special/bernoullif.h | 2 +- .../@stdlib/math/base/special/bernoullif/lib/main.js | 6 +++--- .../@stdlib/math/base/special/bernoullif/lib/native.js | 2 +- .../@stdlib/math/base/special/bernoullif/src/main.c | 2 +- .../@stdlib/math/base/special/bernoullif/test/test.js | 4 ++-- .../math/base/special/bernoullif/test/test.native.js | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt index 1a4f8672bbc5..7d48fe08ddc6 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/repl.txt @@ -1,6 +1,6 @@ {{alias}}( n ) - Compute the nth Bernoulli number as a single-precision floating-point + Computes the nth Bernoulli number as a single-precision floating-point number. If not provided a nonnegative integer value, the function returns `NaN`. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts index fe8da137343a..06fee1a8b605 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts @@ -19,7 +19,7 @@ // TypeScript Version: 4.1 /** -* Compute the nth Bernoulli number as a single-precision floating-point number. +* Computes the nth Bernoulli number as a single-precision floating-point number. * * @param n - the Bernoulli number to compute * @returns Bernoulli number diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h b/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h index 4c518c012cde..ec19d7b08994 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h @@ -29,7 +29,7 @@ extern "C" { #endif /** -* Computes the nth Bernoulli number. +* Computes the nth Bernoulli number as a single-precision floating-point number. */ float stdlib_base_bernoullif( const int32_t n ); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js index dea221fb43a1..64ec0fddcc1d 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -37,7 +37,7 @@ var MAX_BERNOULLI = 64|0; // asm type annotation // MAIN // /** -* Compute the nth Bernoulli number as a single-precision floating-point number. +* Computes the nth Bernoulli number as a single-precision floating-point number. * * @param {NonNegativeInteger} n - the Bernoulli number to compute * @returns {number} Bernoulli number @@ -93,9 +93,9 @@ function bernoullif( n ) { return 0.0; } if ( n > MAX_BERNOULLI ) { - return ( ( n/2 ) & 1 ) ? PINF : NINF; + return ( ( n / 2 ) & 1 ) ? PINF : NINF; } - return float64ToFloat32( BERNOULLIF[ n/2 ] ); + return float64ToFloat32( BERNOULLIF[ n / 2 ] ); } diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js index aec8c0b9317e..b1d9bcd99cea 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js @@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' ); // MAIN // /** -* Compute the nth Bernoulli number as a single-precision floating-point number. +* Computes the nth Bernoulli number as a single-precision floating-point number. * * @param {NonNegativeInteger} n - the Bernoulli number to compute * @returns {number} Bernoulli number diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index a47d3b2482bf..eee13a8b97b8 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -61,7 +61,7 @@ static const float bernoulli_value[ 33 ] = { static const int32_t MAX_BERNOULLI = 64; /** -* Compute the nth Bernoulli number as a single-precision floating-point number. +* Computes the nth Bernoulli number as a single-precision floating-point number. * * @param n input value * @return output value diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js index 3807d666496e..869571b0ca7e 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js @@ -45,7 +45,7 @@ tape( 'if provided a negative number, the function returns `NaN`', function test var v; var i; - t.strictEqual( isnanf( bernoullif( -3.14 ) ), true, 'returns NaN' ); + t.strictEqual( isnanf( bernoullif( -3.14 ) ), true, 'returns expected value' ); for ( i = -1; i > -50; i-- ) { v = bernoullif( i ); @@ -89,7 +89,7 @@ tape( 'the function returns the nth Bernoulli number for even numbers', function var i; for ( i = 0; i < 66; i += 2 ) { v = bernoullif( i ); - t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i/2 ] ), 'returns the '+i+'th Bernoulli number' ); + t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i / 2 ] ), 'returns the '+i+'th Bernoulli number' ); } t.end(); }); diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js index 69382155157a..65362e6f4022 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js @@ -58,7 +58,7 @@ tape( 'if provided a negative number, the function returns `NaN`', opts, functio for ( i = -1; i > -50; i-- ) { v = bernoullif( i ); - t.strictEqual( isnanf( v ), true, 'returns NaN when provided ' + i ); + t.strictEqual( isnanf( v ), true, 'returns expected value when provided ' + i ); } t.end(); }); @@ -86,7 +86,7 @@ tape( 'the function returns the nth Bernoulli number for even numbers', opts, fu var i; for ( i = 0; i < 66; i += 2 ) { v = bernoullif( i ); - t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i/2 ] ), 'returns the '+i+'th Bernoulli number' ); + t.strictEqual( v, float64ToFloat32( BERNOULLIF[ i / 2 ] ), 'returns the '+i+'th Bernoulli number' ); } t.end(); }); From a7e3e9246fed7e467c9e55db2432a370956ae0f4 Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Thu, 5 Dec 2024 16:39:11 +0530 Subject: [PATCH 14/17] Update lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js Signed-off-by: Gunj Joshi --- .../@stdlib/math/base/special/bernoullif/test/test.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js index 65362e6f4022..9bc726bb5f74 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js @@ -54,7 +54,7 @@ tape( 'if provided a negative number, the function returns `NaN`', opts, functio var v; var i; - t.strictEqual( isnanf( bernoullif( -3.14 ) ), true, 'returns NaN' ); + t.strictEqual( isnanf( bernoullif( -3.14 ) ), true, 'returns expected value' ); for ( i = -1; i > -50; i-- ) { v = bernoullif( i ); From da01fa4910d6d0422dcebff89d0dadf5b3069870 Mon Sep 17 00:00:00 2001 From: Gururaj Gurram Date: Sat, 14 Dec 2024 20:58:37 +0530 Subject: [PATCH 15/17] refactor: benchmark files as per project conventions --- .../math/base/special/bernoullif/benchmark/benchmark.js | 8 ++++---- .../special/bernoullif/benchmark/benchmark.native.js | 8 ++++---- .../special/bernoullif/benchmark/c/native/benchmark.c | 9 ++++++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js index 84e4eb901de3..fa239e813f0b 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); -var floorf = require( '@stdlib/math/base/special/floorf' ); +var randu = require( '@stdlib/random/array/discrete-uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pkg = require( './../package.json' ).name; var bernoullif = require( './../lib' ); @@ -35,10 +34,11 @@ bench( pkg, function benchmark( b ) { var y; var i; + x = randu( 100, 0, 500 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = floorf( randu() * 500.0 ); - y = bernoullif( x ); + y = bernoullif( x[ i % x.length ] ); if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js index 23f6c8ab8328..cd7d80415bb8 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js @@ -22,8 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); -var floorf = require( '@stdlib/math/base/special/floorf' ); +var randu = require( '@stdlib/random/array/discrete-uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -44,10 +43,11 @@ bench( pkg+'::native', opts, function benchmark( b ) { var y; var i; + x = randu( 100, 0, 500 ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = floorf( randu() * 500.0 ); - y = bernoullif( x ); + y = bernoullif( x[ i % x.length ] ); if ( isnanf( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c index 0bcb780e59e5..8ce74387edff 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c @@ -91,15 +91,18 @@ static float rand_float( void ) { */ static double benchmark( void ) { double elapsed; + float x[ 100 ]; double t; - float x; float y; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 500.0 * rand_float() ); + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 500.0 * rand_float() ); - y = stdlib_base_bernoullif( x ); + y = stdlib_base_bernoullif( (int)( x[ i % 100 ] ) ); if ( y != y ) { printf( "should not return NaN\n" ); break; From c9c3de019ed4160af97df4fd922f5e9cbf94cf16 Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Thu, 3 Apr 2025 09:46:19 +0530 Subject: [PATCH 16/17] Update lib/node_modules/@stdlib/math/base/special/bernoullif/README.md Signed-off-by: Gunj Joshi --- lib/node_modules/@stdlib/math/base/special/bernoullif/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md index 5929b3574dd6..0deb7d92d316 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md @@ -36,7 +36,7 @@ var bernoullif = require( '@stdlib/math/base/special/bernoullif' ); #### bernoullif( n ) -Compute the nth [Bernoulli number][bernoulli-number] as a single-precision floating-point number. +Computes the nth [Bernoulli number][bernoulli-number] as a single-precision floating-point number. ```javascript var v = bernoullif( 0 ); From da8ec49f9faa120ceddc3d8090f4fb5d09f576d0 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Thu, 3 Apr 2025 04:50:21 +0000 Subject: [PATCH 17/17] chore: update copyright years --- lib/node_modules/@stdlib/math/base/special/bernoullif/README.md | 2 +- .../@stdlib/math/base/special/bernoullif/benchmark/benchmark.js | 2 +- .../math/base/special/bernoullif/benchmark/benchmark.native.js | 2 +- .../math/base/special/bernoullif/benchmark/c/native/Makefile | 2 +- .../math/base/special/bernoullif/benchmark/c/native/benchmark.c | 2 +- .../@stdlib/math/base/special/bernoullif/binding.gyp | 2 +- .../@stdlib/math/base/special/bernoullif/docs/types/index.d.ts | 2 +- .../@stdlib/math/base/special/bernoullif/docs/types/test.ts | 2 +- .../@stdlib/math/base/special/bernoullif/examples/c/Makefile | 2 +- .../@stdlib/math/base/special/bernoullif/examples/c/example.c | 2 +- .../@stdlib/math/base/special/bernoullif/examples/index.js | 2 +- .../@stdlib/math/base/special/bernoullif/include.gypi | 2 +- .../bernoullif/include/stdlib/math/base/special/bernoullif.h | 2 +- .../@stdlib/math/base/special/bernoullif/lib/index.js | 2 +- .../@stdlib/math/base/special/bernoullif/lib/main.js | 2 +- .../@stdlib/math/base/special/bernoullif/lib/native.js | 2 +- .../@stdlib/math/base/special/bernoullif/src/Makefile | 2 +- .../@stdlib/math/base/special/bernoullif/src/addon.c | 2 +- .../@stdlib/math/base/special/bernoullif/src/main.c | 2 +- .../@stdlib/math/base/special/bernoullif/test/test.js | 2 +- .../@stdlib/math/base/special/bernoullif/test/test.native.js | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md index 0deb7d92d316..6cafddfee3ac 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2024 The Stdlib Authors. +Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js index fa239e813f0b..ba9418c53db8 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js index cd7d80415bb8..6e4ca797a5dd 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/benchmark.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile index f69e9da2b4d3..a4bd7b38fd74 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c index 8ce74387edff..57cb69a5d7a4 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/benchmark/c/native/benchmark.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp b/lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp index ec3992233442..68a1ca11d160 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/binding.gyp @@ -1,6 +1,6 @@ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts index 06fee1a8b605..a7874a88d8b5 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts index f72864ff4aa4..013ce85c0445 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile index 6aed70daf167..25ced822f96a 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c index cb63122c4ed2..900b309036b2 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/c/example.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js index 7547fd476748..c602af481082 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi b/lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi index 575cb043c0bf..ecfaf82a3279 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/include.gypi @@ -1,6 +1,6 @@ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h b/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h index ec19d7b08994..d91a06908c7e 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/include/stdlib/math/base/special/bernoullif.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js index ae50a89599ad..f25abb3531b9 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js index 64ec0fddcc1d..f1ceb1a99d89 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js index b1d9bcd99cea..b819ea701748 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/lib/native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile index bcf18aa46655..7733b6180cb4 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c index ce7d2000b694..64c9fc109f77 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/addon.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c index eee13a8b97b8..9fbca8c15b78 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/src/main.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js index 869571b0ca7e..dba51e7de8d1 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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. diff --git a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js index 9bc726bb5f74..b5ba716cef54 100644 --- a/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/bernoullif/test/test.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 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.