diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/README.md b/lib/node_modules/@stdlib/math/base/special/factoriallnf/README.md new file mode 100644 index 000000000000..b8ee1364407a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/README.md @@ -0,0 +1,257 @@ + + +# factoriallnf + +> Natural logarithm of the [factorial][factorial-function] of a single-precision floating-point number. + +
+ +The natural logarithm of the factorial function may be expressed + + + +```math +f(n)=\ln (n!) +``` + + + +The [factorial function][factorial-function] may be defined as the product + + + +```math +n! = \prod_{k=1}^n k +``` + + + +or according to the recurrence relation + + + +```math +n! = \begin{cases}1 & \textrm{if } n = 0,\\(n-1)! \times n & \textrm{if } n > 1\end{cases} +``` + + + +Following the convention for an [empty product][empty-product], in all definitions, + + + +```math +0! = 1 +``` + + + +The [Gamma][gamma-function] function extends the [factorial function][factorial-function] for non-integer values. + + + +```math +n! = \Gamma(n+1) +``` + + + +The [factorial][factorial-function] of a **negative** integer is not defined. + +Evaluating the natural logarithm of [factorial function][factorial-function] is useful as the [factorial function][factorial-function] can overflow for large `n`. Thus, `factoriallnf( n )` is generally preferred to `lnf( n! )`. + +
+ + + +
+ +## Usage + +```javascript +var factoriallnf = require( '@stdlib/math/base/special/factoriallnf' ); +``` + +#### factoriallnf( x ) + +Evaluates the natural logarithm of the [factorial][factorial-function] of a single-precision floating-point number. For input values other than negative integers, the function returns `ln( x! ) = ln( Γ(x+1) )`, where `Γ` is the [Gamma][gamma-function] function. For negative integers, the function returns `NaN`. + +```javascript +var v = factoriallnf( 3.0 ); +// returns ~1.792 + +v = factoriallnf( 2.4 ); +// returns ~1.092 + +v = factoriallnf( -1.0 ); +// returns NaN + +v = factoriallnf( -1.5 ); +// returns ~1.266 +``` + +If provided `NaN`, the function returns `NaN`. + +```javascript +var v = factoriallnf( NaN ); +// returns NaN +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var factoriallnf = require( '@stdlib/math/base/special/factoriallnf' ); + +var opts = { + 'dtype': 'float32' +}; +var x = uniform( 100, -10.0, 50.0, opts ); + +logEachMap( 'factoriallnf(%0.4f) = %0.4f', x, factoriallnf ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/factoriallnf.h" +``` + +#### stdlib_base_factoriallnf( x ) + +Evaluates the natural logarithm of the [factorial][factorial-function] of a single-precision floating-point number. For input values other than negative integers, the function returns `ln( x! ) = ln( Γ(x+1) )`, where `Γ` is the [Gamma][gamma-function] function. For negative integers, the function returns `NaN`. + +```c +float out = stdlib_base_factoriallnf( 3.0f ); +// returns ~1.792f + +out = stdlib_base_factoriallnf( -1.5f ); +// returns ~1.266f +``` + +The function accepts the following arguments: + +- **x**: `[in] float` input value. + +```c +float stdlib_base_factoriallnf( const float x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/factoriallnf.h" +#include + +int main( void ) { + const float x[] = { 2.0f, 3.0f, 5.0f, 8.0f }; + + float y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_factoriallnf( x[ i ] ); + printf( "factoriallnf(%f) = %f\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/benchmark.js new file mode 100644 index 000000000000..b91af4614208 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/benchmark.js @@ -0,0 +1,79 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 uniform = require( '@stdlib/random/array/uniform' ); +var floorf = require( '@stdlib/math/base/special/floorf' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pkg = require( './../package.json' ).name; +var factoriallnf = require( './../lib' ); + + +// MAIN // + +bench( pkg+'::integers', function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, 1.0, 35.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = factoriallnf( floorf( x[ i%x.length ] ) ); + 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(); +}); + +bench( pkg+'::decimals', function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, 1.0, 35.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = factoriallnf( x[ i%x.length ] ); + 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/factoriallnf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/benchmark.native.js new file mode 100644 index 000000000000..82c112fb7648 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/benchmark.native.js @@ -0,0 +1,88 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 uniform = require( '@stdlib/random/array/uniform' ); +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; + + +// VARIABLES // + +var factoriallnf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( factoriallnf instanceof Error ) +}; + + +// MAIN // + +bench( pkg+'::native,integers', opts, function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, 1.0, 35.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = factoriallnf( floorf( x[ i%x.length ] ) ); + 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(); +}); + +bench( pkg+'::native,decimals', opts, function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, 1.0, 35.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = factoriallnf( x[ i%x.length ] ); + 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/factoriallnf/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/c/native/Makefile new file mode 100644 index 000000000000..a4bd7b38fd74 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/c/native/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# 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. +# 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/factoriallnf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/c/native/benchmark.c new file mode 100644 index 000000000000..8d57170d7901 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/benchmark/c/native/benchmark.c @@ -0,0 +1,138 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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/factoriallnf.h" +#include +#include +#include +#include +#include + +#define NAME "factoriallnf" +#define ITERATIONS 100 +#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 [min,max). +* +* @param min minimum value (inclusive) +* @param max maximum value (exclusive) +* @return random number +*/ +static float random_uniform( const float min, const float max ) { + float v = (float)rand() / ( (float)RAND_MAX + 1.0f ); + return min + ( v*(max-min) ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + float x[ 100 ]; + double elapsed; + double t; + float y; + int i; + + for ( i = 0; i < 100; i++ ) { + x[ i ] = random_uniform( 1.0f, 35.0f ); + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + y = stdlib_base_factoriallnf( x[ i%100 ] ); + if ( y != y ) { + printf( "should return a nonnegative integer\n" ); + break; + } + } + elapsed = tic() - t; + if ( y != y ) { + printf( "should return a nonnegative integer\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/factoriallnf/binding.gyp b/lib/node_modules/@stdlib/math/base/special/factoriallnf/binding.gyp new file mode 100644 index 000000000000..68a1ca11d160 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# 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. +# 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/factoriallnf/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/repl.txt new file mode 100644 index 000000000000..2af603518227 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/repl.txt @@ -0,0 +1,40 @@ + +{{alias}}( x ) + Evaluates the natural logarithm of the factorial of a single-precision + floating-point number. + + For input values other than negative integers, the function returns + + ln( x! ) = ln( Γ(x+1) ) + + where `Γ` is the Gamma function. For negative integers, the function returns + `NaN`. + + If provided `NaN`, the function returns `NaN`. + + Parameters + ---------- + x: number + Input value. + + Returns + ------- + y: number + Natural logarithm of the factorial of `x`. + + Examples + -------- + > var y = {{alias}}( 3.0 ) + ~1.792 + > y = {{alias}}( 2.4 ) + ~1.092 + > y = {{alias}}( -1.0 ) + NaN + > y = {{alias}}( -1.5 ) + ~1.266 + > y = {{alias}}( NaN ) + NaN + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/types/index.d.ts new file mode 100644 index 000000000000..942ac86edd8e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/types/index.d.ts @@ -0,0 +1,52 @@ +/* +* @license Apache-2.0 +* +* 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. +* 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 + +/** +* Evaluates the natural logarithm of the factorial of a single-precision floating-point number. +* +* @param x - input value +* @returns natural logarithm of factorial of `x` +* +* @example +* var v = factoriallnf( 3.0 ); +* // returns ~1.792 +* +* @example +* var v = factoriallnf( 2.4 ); +* // returns ~1.092 +* +* @example +* var v = factoriallnf( -1.0 ); +* // returns NaN +* +* @example +* var v = factoriallnf( -1.5 ); +* // returns ~1.266 +* +* @example +* var v = factoriallnf( NaN ); +* // returns NaN +*/ +declare function factoriallnf( x: number ): number; + + +// EXPORTS // + +export = factoriallnf; diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/types/test.ts new file mode 100644 index 000000000000..e10bc31de310 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* 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. +* 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 factoriallnf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + factoriallnf( 0.5 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + factoriallnf( true ); // $ExpectError + factoriallnf( false ); // $ExpectError + factoriallnf( null ); // $ExpectError + factoriallnf( undefined ); // $ExpectError + factoriallnf( '5' ); // $ExpectError + factoriallnf( [] ); // $ExpectError + factoriallnf( {} ); // $ExpectError + factoriallnf( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + factoriallnf(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/c/Makefile b/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/c/Makefile new file mode 100644 index 000000000000..25ced822f96a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# 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. +# 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/factoriallnf/examples/c/example.c b/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/c/example.c new file mode 100644 index 000000000000..0e6c89b053c7 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/c/example.c @@ -0,0 +1,31 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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/factoriallnf.h" +#include + +int main( void ) { + const float x[] = { 2.0f, 3.0f, 5.0f, 8.0f }; + + float y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_factoriallnf( x[ i ] ); + printf( "factoriallnf(%f) = %f\n", x[ i ], y ); + } +} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/index.js b/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/index.js new file mode 100644 index 000000000000..21965eaa469b --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var factoriallnf = require( './../lib' ); + +var opts = { + 'dtype': 'float32' +}; +var x = uniform( 100, -10.0, 50.0, opts ); + +logEachMap( 'factoriallnf(%0.4f) = %0.4f', x, factoriallnf ); diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/include.gypi b/lib/node_modules/@stdlib/math/base/special/factoriallnf/include.gypi new file mode 100644 index 000000000000..ecfaf82a3279 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# 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. +# 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': [ + '=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", + "factorial", + "log-scale", + "logarithm", + "fact", + "lfact", + "factoriallnf", + "combinatorics", + "gamma", + "number" + ] +} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/Makefile b/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/Makefile new file mode 100644 index 000000000000..7733b6180cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# 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. +# 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/factoriallnf/src/addon.c b/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/addon.c new file mode 100644 index 000000000000..f1edea29b8ac --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/addon.c @@ -0,0 +1,22 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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/factoriallnf.h" +#include "stdlib/math/base/napi/unary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_F_F( stdlib_base_factoriallnf ) diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/main.c b/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/main.c new file mode 100644 index 000000000000..0b60b4376eb4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/src/main.c @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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/factoriallnf.h" +#include "stdlib/math/base/assert/is_negative_integerf.h" +#include "stdlib/math/base/special/absgammalnf.h" + +/** +* Evaluates the natural logarithm of the factorial of a single-precision floating-point number. +* +* @param x input value +* @return natural logarithm of factorial of `x` +* +* @example +* float out = stdlib_base_factoriallnf( 3.0f ); +* // returns ~1.792f +*/ +float stdlib_base_factoriallnf( const float x ) { + if ( stdlib_base_is_negative_integerf( x ) ) { + return 0.0f / 0.0f; // NaN + } + return stdlib_base_absgammalnf( x + 1.0f ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..06bfe7391215 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/REQUIRE @@ -0,0 +1,3 @@ +julia 1.5 +JSON 0.21 +SpecialFunctions 0.10.3 diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/large_positive.json b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/large_positive.json new file mode 100644 index 000000000000..548480a62104 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/large_positive.json @@ -0,0 +1 @@ +{"expected":[2611.3306,2767.335,2924.529,3082.8591,3242.2754,3402.7327,3564.1897,3726.6074,3889.951,4054.1865,4219.284,4385.2144,4551.9507,4719.4683,4887.7427,5056.752,5226.4756,5396.893,5567.9863,5739.737,5912.1284,6085.1445,6258.77,6432.9907,6607.7925,6783.1626,6959.0874,7135.556,7312.556,7490.077,7668.108,7846.6387,8025.6597,8205.161,8385.134,8565.569,8746.46,8927.796,9109.571,9291.776,9474.406,9657.452,9840.908,10024.767,10209.022,10393.668,10578.698,10764.108,10949.891,11136.04,11322.552,11509.421,11696.643,11884.211,12072.121,12260.369,12448.951,12637.861,12827.097,13016.652,13206.524,13396.709,13587.202,13777.999,13969.099,14160.495,14352.186,14544.166,14736.435,14928.987,15121.82,15314.932,15508.317,15701.975,15895.901,16090.093,16284.548,16479.264,16674.236,16869.465,17064.945,17260.676,17456.654,17652.879,17849.344,18046.05,18242.994,18440.174,18637.588,18835.234,19033.107,19231.209,19429.537,19628.086,19826.857,20025.85,20225.057,20424.48,20624.117,20823.967,21024.025,21224.293,21424.766,21625.445,21826.326,22027.41,22228.693,22430.176,22631.854,22833.729,23035.795,23238.055,23440.506,23643.146,23845.975,24048.99,24252.19,24455.572,24659.139,24862.887,25066.812,25270.918,25475.201,25679.66,25884.295,26089.102,26294.082,26499.232,26704.553,26910.043,27115.701,27321.525,27527.514,27733.668,27939.986,28146.467,28353.107,28559.908,28766.87,28973.988,29181.264,29388.697,29596.285,29804.025,30011.922,30219.969,30428.168,30636.518,30845.018,31053.666,31262.46,31471.404,31680.494,31889.729,32099.107,32308.63,32518.297,32728.105,32938.055,33148.145,33358.37,33568.74,33779.246,33989.89,34200.668,34411.586,34622.637,34833.82,35045.14,35256.594,35468.176,35679.89,35891.74,36103.715,36315.82,36528.06,36740.42,36952.91,37165.53,37378.273,37591.145],"x":[500.0,525.0,550.0,575.0,600.0,625.0,650.0,675.0,700.0,725.0,750.0,775.0,800.0,825.0,850.0,875.0,900.0,925.0,950.0,975.0,1000.0,1025.0,1050.0,1075.0,1100.0,1125.0,1150.0,1175.0,1200.0,1225.0,1250.0,1275.0,1300.0,1325.0,1350.0,1375.0,1400.0,1425.0,1450.0,1475.0,1500.0,1525.0,1550.0,1575.0,1600.0,1625.0,1650.0,1675.0,1700.0,1725.0,1750.0,1775.0,1800.0,1825.0,1850.0,1875.0,1900.0,1925.0,1950.0,1975.0,2000.0,2025.0,2050.0,2075.0,2100.0,2125.0,2150.0,2175.0,2200.0,2225.0,2250.0,2275.0,2300.0,2325.0,2350.0,2375.0,2400.0,2425.0,2450.0,2475.0,2500.0,2525.0,2550.0,2575.0,2600.0,2625.0,2650.0,2675.0,2700.0,2725.0,2750.0,2775.0,2800.0,2825.0,2850.0,2875.0,2900.0,2925.0,2950.0,2975.0,3000.0,3025.0,3050.0,3075.0,3100.0,3125.0,3150.0,3175.0,3200.0,3225.0,3250.0,3275.0,3300.0,3325.0,3350.0,3375.0,3400.0,3425.0,3450.0,3475.0,3500.0,3525.0,3550.0,3575.0,3600.0,3625.0,3650.0,3675.0,3700.0,3725.0,3750.0,3775.0,3800.0,3825.0,3850.0,3875.0,3900.0,3925.0,3950.0,3975.0,4000.0,4025.0,4050.0,4075.0,4100.0,4125.0,4150.0,4175.0,4200.0,4225.0,4250.0,4275.0,4300.0,4325.0,4350.0,4375.0,4400.0,4425.0,4450.0,4475.0,4500.0,4525.0,4550.0,4575.0,4600.0,4625.0,4650.0,4675.0,4700.0,4725.0,4750.0,4775.0,4800.0,4825.0,4850.0,4875.0,4900.0,4925.0,4950.0,4975.0,5000.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/medium_positive.json b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/medium_positive.json new file mode 100644 index 000000000000..342fce109f30 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/medium_positive.json @@ -0,0 +1 @@ +{"expected":[1.7917595,1.8131546,1.8346308,1.856189,1.8778273,1.8995467,1.9213463,1.9432249,1.9651829,1.9872205,2.0093367,2.0315313,2.0538032,2.0761526,2.0985796,2.1210837,2.1436644,2.1663206,2.1890526,2.2118607,2.234744,2.257702,2.2807343,2.3038404,2.3270211,2.3502755,2.3736024,2.397003,2.420475,2.4440205,2.467638,2.4913266,2.5150864,2.538918,2.5628204,2.5867934,2.6108358,2.6349483,2.659131,2.6833835,2.7077045,2.7320938,2.7565517,2.7810788,2.8056736,2.8303363,2.8550658,2.8798623,2.9047265,2.9296575,2.9546537,2.9797173,3.0048459,3.0300407,3.0553012,3.080626,3.1060154,3.1314707,3.15699,3.1825728,3.2082202,3.2339315,3.2597053,3.2855434,3.3114433,3.337407,3.3634331,3.3895206,3.415671,3.4418826,3.4681563,3.494491,3.5208874,3.5473447,3.5738623,3.600441,3.6270792,3.653778,3.680537,3.7073548,3.7342331,3.7611697,3.788166,3.8152206,3.8423343,3.8695068,3.8967366,3.924025,3.9513707,3.978775,4.0062366,4.033755,4.061331,4.0889626,4.116652,4.1443977,4.1721997,4.2000585,4.227972,4.2559423,4.283967,4.3120484,4.340185,4.368376,4.396622,4.4249225,4.453278,4.481687,4.5101514,4.538669,4.5672407,4.595866,4.6245446,4.653277,4.6820626,4.7109003,4.739792,4.768735,4.797732,4.8267803,4.855881,4.885034,4.9142385,4.9434953,4.9728026,5.0021625,5.0315733,5.0610347,5.0905476,5.120111,5.149725,5.17939,5.2091045,5.23887,5.2686844,5.2985497,5.328464,5.358429,5.3884425,5.418505,5.448618,5.478779,5.50899,5.539249,5.569556,5.5999126,5.6303163,5.6607695,5.6912694,5.7218184,5.752415,5.783059,5.8137507,5.844489,5.875276,5.9061093,5.9369893,5.9679174,5.9988904,6.0299115,6.0609784,6.0920916,6.123252,6.154457,6.1857095,6.2170067,6.2483506,6.2797403,6.311174,6.342654,6.374179,6.4057493,6.437364,6.469025,6.5007305,6.5324793,6.564274,6.5961123,6.6279955,6.659923,6.6918936,6.7239094,6.755968,6.788071,6.820217,6.852407,6.884641,6.9169173,6.949237,6.9816,7.0140057,7.046455,7.078946,7.1114807,7.144057,7.1766763,7.209337,7.2420416,7.2747874,7.3075747,7.340405,7.3732758,7.40619,7.439145,7.472141,7.505179,7.5382576,7.571378,7.6045394,7.6377425,7.6709857,7.7042694,7.7375946,7.77096,7.804366,7.837813,7.871299,7.904826,7.9383926,7.972,8.005647,8.039334,8.073061,8.106827,8.140634,8.174479,8.208364,8.242288,8.276251,8.310254,8.344295,8.378376,8.412494,8.446652,8.48085,8.515085,8.549359,8.583669,8.618021,8.6524105,8.686838,8.721302,8.755806,8.790348,8.8249235,8.859541,8.894196,8.928885,8.963615,8.998383,9.033187,9.068029,9.102907,9.137823,9.172773,9.207765,9.24279,9.277851,9.312951,9.348087,9.383261,9.41847,9.453716,9.488998,9.524314,9.5596695,9.595059,9.630484,9.665946,9.701446,9.7369795,9.772551,9.808155,9.843793,9.87947,9.915182,9.950928,9.986709,10.022525,10.058379,10.094265,10.130188,10.166145,10.202135,10.238162,10.274222,10.310319,10.346449,10.382614,10.418815,10.455048,10.491315,10.527617,10.5639515,10.600323,10.636727,10.673162,10.709633,10.7461405,10.782679,10.819252,10.855858,10.892498,10.929172,10.9658785,11.002619,11.0393915,11.076198,11.113038,11.149911,11.186817,11.223752,11.260724,11.2977295,11.334766,11.371834,11.408936,11.44607,11.483238,11.520439,11.55767,11.594933,11.63223,11.669559,11.70692,11.74431,11.781734,11.819192,11.856682,11.894202,11.931753,11.9693365,12.006952,12.0446,12.082278,12.1199875,12.157728,12.195502,12.233306,12.27114,12.309006,12.346903,12.384833,12.4227915,12.460782,12.498804,12.536856,12.574939,12.613053,12.651196,12.689372,12.727577,12.765814,12.804079,12.842376,12.880703,12.919062,12.957448,12.995868,13.034313,13.072792,13.1113,13.149838,13.188404,13.227004,13.265632,13.304289,13.342977,13.381689,13.420437,13.459212,13.498019,13.536854,13.575717,13.614612,13.653535,13.692487,13.731468,13.770476,13.809516,13.848585,13.887683,13.926809,13.965963,14.005149,14.044362,14.083603,14.122874,14.162171,14.201499,14.240856,14.280242,14.319653,14.359095,14.398566,14.438066,14.4775915,14.517143,14.556727,14.596339,14.635978,14.675646,14.715338,14.755063,14.794815,14.834592,14.8744,14.914232,14.954095,14.993985,15.033903,15.073849,15.113821,15.153819,15.193848,15.233903,15.273985,15.314095,15.354231,15.394395,15.4345875,15.474805,15.515051,15.555323,15.595623,15.63595,15.676302,15.716682,15.75709,15.797525,15.837985,15.878469,15.918986,15.959527,16.000093,16.040688,16.081306,16.121954,16.16263,16.20333,16.244053,16.284807,16.325584,16.366388,16.40722,16.448076,16.48896,16.52987,16.570807,16.611767,16.652752,16.693764,16.734808,16.775871,16.816961,16.858078,16.899218,16.940386,16.981583,17.0228,17.064045,17.105314,17.146608,17.187931,17.229275,17.270649,17.312044,17.35347,17.394917,17.436388,17.477886,17.519407,17.560957,17.60253,17.644127,17.685753,17.727402,17.769073,17.810774,17.852491,17.89424,17.936014,17.977814,18.019634,18.06148,18.10335,18.145247,18.187166,18.22911,18.27108,18.313074,18.355093,18.397135,18.439201,18.481293,18.523407,18.565548,18.607712,18.649899,18.692112,18.734348,18.776608,18.818893,18.861202,18.903532,18.94589,18.98827,19.030676,19.0731,19.115553,19.15803,19.200527,19.243052,19.285595,19.328169,19.370762,19.41338,19.456018,19.498684,19.541372,19.584084,19.626818,19.669573,19.712357,19.755163,19.797989,19.840845,19.883715,19.926615,19.969532,20.01248,20.055449,20.098433,20.141447,20.184486,20.227545,20.270626,20.313732,20.356857,20.400011,20.443184,20.486376,20.529598,20.572838,20.616104,20.659393,20.7027,20.746033,20.789389,20.832766,20.876167,20.919586,20.963032,21.006498,21.049992,21.093502,21.137035,21.180592,21.224173,21.267773,21.311396,21.355038,21.398706,21.442398,21.48611,21.529844,21.5736,21.617378,21.661177,21.705002,21.748842,21.792707,21.836597,21.880507,21.92444,21.968393,22.012367,22.056366,22.100382,22.144423,22.18848,22.232567,22.27667,22.320799,22.364946,22.409117,22.453306,22.49752,22.541754,22.586006,22.630285,22.674582,22.7189,22.763245,22.807602,22.851986,22.896393,22.940817,22.985266,23.02973,23.07422,23.118732,23.163261,23.207817,23.252388,23.29698,23.341599,23.386232,23.430891,23.475567,23.520266,23.564987,23.609726,23.654486,23.699268,23.744068,23.788895,23.833736,23.878601,23.923487,23.968393,24.013319,24.058268,24.103233,24.148222,24.19323,24.23826,24.28331,24.328379,24.37347,24.41858,24.46371,24.508862,24.554031,24.599222,24.644434,24.689669,24.73492,24.780193,24.825485,24.870796,24.916132,24.961483,25.006853,25.052248,25.097664,25.143095,25.188545,25.234018,25.27951,25.325026,25.37056,25.416107,25.461681,25.507273,25.552887,25.598516,25.644163,25.689835,25.735527,25.78124,25.826967,25.872717,25.918484,25.964273,26.010084,26.05591,26.101755,26.147623,26.19351,26.239412,26.285337,26.331282,26.377245,26.423227,26.46923,26.51525,26.56129,26.607351,26.65343,26.69953,26.745646,26.791782,26.837938,26.884115,26.93031,26.97652,27.022753,27.069002,27.115276,27.161562,27.207872,27.254198,27.300545,27.34691,27.393293,27.439695,27.486116,27.532558,27.579018,27.625492,27.671988,27.718506,27.76504,27.811592,27.858162,27.90475,27.951366,27.997988,28.04464,28.0913,28.137983,28.184687,28.231405,28.278145,28.324896,28.371677,28.41847,28.465284,28.51211,28.55896,28.605833,28.652716,28.699623,28.74654,28.793484,28.840439,28.887424,28.934414,28.981428,29.028461,29.075512,29.122578,29.169664,29.216772,29.263887,29.311033,29.358189,29.405365,29.452562,29.499775,29.547007,29.594255,29.641523,29.6888,29.73611,29.783424,29.830769,29.87812,29.925493,29.972885,30.020294,30.06772,30.115162,30.162628,30.210106,30.257608,30.30512,30.352655,30.400204,30.447775,30.495361,30.542965,30.590586,30.63822,30.685875,30.73355,30.78124,30.828953,30.876677,30.924423,30.972183,31.019962,31.067759,31.115574,31.163399,31.211243,31.259111,31.306992,31.354893,31.402813,31.450747,31.4987,31.546667,31.594646,31.642649,31.690672,31.738708,31.786764,31.834835,31.882927,31.931032,31.979156,32.027298,32.075447,32.12362,32.17181,32.220016,32.26824,32.31649,32.364746,32.41302,32.461315,32.50962,32.557945,32.60629,32.654644,32.703026,32.75142,32.799828,32.848255,32.896698,32.945156,32.993633,33.042126,33.090633,33.13916,33.187706,33.236267,33.284843,33.33344,33.38205,33.43067,33.479313,33.52797,33.57665,33.62534,33.67405,33.72278,33.77152,33.82028,33.86905,33.91784,33.96665,34.015472,34.064312,34.11317,34.162037,34.21093,34.259834,34.308754,34.357693,34.406643,34.455616,34.504604,34.553604,34.602627,34.651657,34.70071,34.74978,34.798862,34.847958,34.89707,34.946205,34.995354,35.044518,35.093697,35.142895,35.1921,35.241333,35.290577,35.33983,35.38911,35.438396,35.487705,35.53703,35.586372,35.635723,35.685097,35.734486,35.783886,35.8333,35.882732,35.932186,35.981655,36.03113,36.080627,36.130142,36.179672,36.229218,36.27877,36.328346,36.377934,36.427544,36.47717,36.526802,36.57646,36.62613,36.67581,36.725517,36.775223,36.824955,36.874702,36.924465,36.974243,37.02404,37.073845,37.123672,37.173508,37.223366,37.273228,37.323112,37.373016,37.42293,37.472866,37.522808,37.572773,37.622753,37.672745,37.72275,37.77277,37.82281,37.87286,37.922935,37.97302,38.023117,38.073235,38.12336,38.173508,38.22366,38.273838,38.324024,38.37423,38.424454,38.474693,38.52494,38.575203,38.62549,38.675774,38.726086,38.77641,38.82675,38.87711,38.92748,38.977863,39.028263,39.07868,39.12911,39.179546,39.230007,39.28048,39.330975,39.381477,39.431995,39.48253,39.533077,39.58364,39.63422,39.684803,39.735416,39.786037,39.836674,39.887325,39.937992,39.988674,40.03937,40.09008,40.1408,40.191536,40.242294,40.29306,40.343845,40.39464,40.445457,40.496284,40.547127,40.59798,40.648846,40.69973,40.75063,40.801544,40.85247,40.90342,40.954372,41.005344,41.05633,41.107327,41.15834,41.20937,41.26041,41.311474,41.362545,41.41363,41.464733,41.51585,41.566975,41.61812,41.669273,41.720448,41.771633,41.822838,41.874046,41.925278,41.976517,42.02778,42.079052,42.130333,42.181633,42.232944,42.284275,42.335617],"x":[3.0,3.017,3.034,3.051,3.068,3.085,3.102,3.119,3.136,3.153,3.17,3.187,3.204,3.221,3.238,3.255,3.272,3.289,3.306,3.323,3.34,3.357,3.374,3.391,3.408,3.425,3.442,3.459,3.476,3.493,3.51,3.527,3.544,3.561,3.578,3.595,3.612,3.629,3.646,3.663,3.68,3.697,3.714,3.731,3.748,3.765,3.782,3.799,3.816,3.833,3.85,3.867,3.884,3.901,3.918,3.935,3.952,3.969,3.986,4.003,4.02,4.037,4.054,4.071,4.088,4.105,4.122,4.139,4.156,4.173,4.19,4.207,4.224,4.241,4.258,4.275,4.292,4.309,4.326,4.343,4.36,4.377,4.394,4.411,4.428,4.445,4.462,4.479,4.496,4.513,4.53,4.547,4.564,4.581,4.598,4.615,4.632,4.649,4.666,4.683,4.7,4.717,4.734,4.751,4.768,4.785,4.802,4.819,4.836,4.853,4.87,4.887,4.904,4.921,4.938,4.955,4.972,4.989,5.006,5.023,5.04,5.057,5.074,5.091,5.108,5.125,5.142,5.159,5.176,5.193,5.21,5.227,5.244,5.261,5.278,5.295,5.312,5.329,5.346,5.363,5.38,5.397,5.414,5.431,5.448,5.465,5.482,5.499,5.516,5.533,5.55,5.567,5.584,5.601,5.618,5.635,5.652,5.669,5.686,5.703,5.72,5.737,5.754,5.771,5.788,5.805,5.822,5.839,5.856,5.873,5.89,5.907,5.924,5.941,5.958,5.975,5.992,6.009,6.026,6.043,6.06,6.077,6.094,6.111,6.128,6.145,6.162,6.179,6.196,6.213,6.23,6.247,6.264,6.281,6.298,6.315,6.332,6.349,6.366,6.383,6.4,6.417,6.434,6.451,6.468,6.485,6.502,6.519,6.536,6.553,6.57,6.587,6.604,6.621,6.638,6.655,6.672,6.689,6.706,6.723,6.74,6.757,6.774,6.791,6.808,6.825,6.842,6.859,6.876,6.893,6.91,6.927,6.944,6.961,6.978,6.995,7.012,7.029,7.046,7.063,7.08,7.097,7.114,7.131,7.148,7.165,7.182,7.199,7.216,7.233,7.25,7.267,7.284,7.301,7.318,7.335,7.352,7.369,7.386,7.403,7.42,7.437,7.454,7.471,7.488,7.505,7.522,7.539,7.556,7.573,7.59,7.607,7.624,7.641,7.658,7.675,7.692,7.709,7.726,7.743,7.76,7.777,7.794,7.811,7.828,7.845,7.862,7.879,7.896,7.913,7.93,7.947,7.964,7.981,7.998,8.015,8.032,8.049,8.066,8.083,8.1,8.117,8.134,8.151,8.168,8.185,8.202,8.219,8.236,8.253,8.27,8.287,8.304,8.321,8.338,8.355,8.372,8.389,8.406,8.423,8.44,8.457,8.474,8.491,8.508,8.525,8.542,8.559,8.576,8.593,8.61,8.627,8.644,8.661,8.678,8.695,8.712,8.729,8.746,8.763,8.78,8.797,8.814,8.831,8.848,8.865,8.882,8.899,8.916,8.933,8.95,8.967,8.984,9.001,9.018,9.035,9.052,9.069,9.086,9.103,9.12,9.137,9.154,9.171,9.188,9.205,9.222,9.239,9.256,9.273,9.29,9.307,9.324,9.341,9.358,9.375,9.392,9.409,9.426,9.443,9.46,9.477,9.494,9.511,9.528,9.545,9.562,9.579,9.596,9.613,9.63,9.647,9.664,9.681,9.698,9.715,9.732,9.749,9.766,9.783,9.8,9.817,9.834,9.851,9.868,9.885,9.902,9.919,9.936,9.953,9.97,9.987,10.004,10.021,10.038,10.055,10.072,10.089,10.106,10.123,10.14,10.157,10.174,10.191,10.208,10.225,10.242,10.259,10.276,10.293,10.31,10.327,10.344,10.361,10.378,10.395,10.412,10.429,10.446,10.463,10.48,10.497,10.514,10.531,10.548,10.565,10.582,10.599,10.616,10.633,10.65,10.667,10.684,10.701,10.718,10.735,10.752,10.769,10.786,10.803,10.82,10.837,10.854,10.871,10.888,10.905,10.922,10.939,10.956,10.973,10.99,11.007,11.024,11.041,11.058,11.075,11.092,11.109,11.126,11.143,11.16,11.177,11.194,11.211,11.228,11.245,11.262,11.279,11.296,11.313,11.33,11.347,11.364,11.381,11.398,11.415,11.432,11.449,11.466,11.483,11.5,11.517,11.534,11.551,11.568,11.585,11.602,11.619,11.636,11.653,11.67,11.687,11.704,11.721,11.738,11.755,11.772,11.789,11.806,11.823,11.84,11.857,11.874,11.891,11.908,11.925,11.942,11.959,11.976,11.993,12.01,12.027,12.044,12.061,12.078,12.095,12.112,12.129,12.146,12.163,12.18,12.197,12.214,12.231,12.248,12.265,12.282,12.299,12.316,12.333,12.35,12.367,12.384,12.401,12.418,12.435,12.452,12.469,12.486,12.503,12.52,12.537,12.554,12.571,12.588,12.605,12.622,12.639,12.656,12.673,12.69,12.707,12.724,12.741,12.758,12.775,12.792,12.809,12.826,12.843,12.86,12.877,12.894,12.911,12.928,12.945,12.962,12.979,12.996,13.013,13.03,13.047,13.064,13.081,13.098,13.115,13.132,13.149,13.166,13.183,13.2,13.217,13.234,13.251,13.268,13.285,13.302,13.319,13.336,13.353,13.37,13.387,13.404,13.421,13.438,13.455,13.472,13.489,13.506,13.523,13.54,13.557,13.574,13.591,13.608,13.625,13.642,13.659,13.676,13.693,13.71,13.727,13.744,13.761,13.778,13.795,13.812,13.829,13.846,13.863,13.88,13.897,13.914,13.931,13.948,13.965,13.982,13.999,14.016,14.033,14.05,14.067,14.084,14.101,14.118,14.135,14.152,14.169,14.186,14.203,14.22,14.237,14.254,14.271,14.288,14.305,14.322,14.339,14.356,14.373,14.39,14.407,14.424,14.441,14.458,14.475,14.492,14.509,14.526,14.543,14.56,14.577,14.594,14.611,14.628,14.645,14.662,14.679,14.696,14.713,14.73,14.747,14.764,14.781,14.798,14.815,14.832,14.849,14.866,14.883,14.9,14.917,14.934,14.951,14.968,14.985,15.002,15.019,15.036,15.053,15.07,15.087,15.104,15.121,15.138,15.155,15.172,15.189,15.206,15.223,15.24,15.257,15.274,15.291,15.308,15.325,15.342,15.359,15.376,15.393,15.41,15.427,15.444,15.461,15.478,15.495,15.512,15.529,15.546,15.563,15.58,15.597,15.614,15.631,15.648,15.665,15.682,15.699,15.716,15.733,15.75,15.767,15.784,15.801,15.818,15.835,15.852,15.869,15.886,15.903,15.92,15.937,15.954,15.971,15.988,16.005,16.022,16.039,16.056,16.073,16.09,16.107,16.124,16.141,16.158,16.175,16.192,16.209,16.226,16.243,16.26,16.277,16.294,16.311,16.328,16.345,16.362,16.379,16.396,16.413,16.43,16.447,16.464,16.481,16.498,16.515,16.532,16.549,16.566,16.583,16.6,16.617,16.634,16.651,16.668,16.685,16.702,16.719,16.736,16.753,16.77,16.787,16.804,16.821,16.838,16.855,16.872,16.889,16.906,16.923,16.94,16.957,16.974,16.991,17.008,17.025,17.042,17.059,17.076,17.093,17.11,17.127,17.144,17.161,17.178,17.195,17.212,17.229,17.246,17.263,17.28,17.297,17.314,17.331,17.348,17.365,17.382,17.399,17.416,17.433,17.45,17.467,17.484,17.501,17.518,17.535,17.552,17.569,17.586,17.603,17.62,17.637,17.654,17.671,17.688,17.705,17.722,17.739,17.756,17.773,17.79,17.807,17.824,17.841,17.858,17.875,17.892,17.909,17.926,17.943,17.96,17.977,17.994,18.011,18.028,18.045,18.062,18.079,18.096,18.113,18.13,18.147,18.164,18.181,18.198,18.215,18.232,18.249,18.266,18.283,18.3,18.317,18.334,18.351,18.368,18.385,18.402,18.419,18.436,18.453,18.47,18.487,18.504,18.521,18.538,18.555,18.572,18.589,18.606,18.623,18.64,18.657,18.674,18.691,18.708,18.725,18.742,18.759,18.776,18.793,18.81,18.827,18.844,18.861,18.878,18.895,18.912,18.929,18.946,18.963,18.98,18.997,19.014,19.031,19.048,19.065,19.082,19.099,19.116,19.133,19.15,19.167,19.184,19.201,19.218,19.235,19.252,19.269,19.286,19.303,19.32,19.337,19.354,19.371,19.388,19.405,19.422,19.439,19.456,19.473,19.49,19.507,19.524,19.541,19.558,19.575,19.592,19.609,19.626,19.643,19.66,19.677,19.694,19.711,19.728,19.745,19.762,19.779,19.796,19.813,19.83,19.847,19.864,19.881,19.898,19.915,19.932,19.949,19.966,19.983,20.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/runner.jl new file mode 100755 index 000000000000..a889c1887a00 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/runner.jl @@ -0,0 +1,85 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# 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. +# 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 JSON +using SpecialFunctions + +""" + gen( x, name ) + +Generate fixture data and write to file. + +# Arguments + +* `x`: domain +* `name::AbstractString`: output filename + +# Examples + +``` julia +julia> x = range( -1000.0, stop = 1000.0, length = 2001 ); +julia> gen( x, \"data.json\" ); +``` +""" +function gen( x, name ) + y = Array{Float32}( undef, length( x ) ); + for i in eachindex(x) + if isinteger( x[i] ) + y[i] = lfactorial( Int32( x[i] ) ); + else + y[i] = lgamma( x[i]+1 ); + end + end + + # Store data to be written to file as a collection: + data = Dict([ + ("x", x), + ("expected", y) + ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: + outfile = open( filepath, "w" ); + write( outfile, JSON.json(data) ); + write( outfile, "\n" ); + close( outfile ); +end + +# Get the filename: +file = @__FILE__; + +# Extract the directory in which this file resides: +dir = dirname( file ); + +# Positive small values: +x = Float32.( range( 1.0, stop = 3.0, length = 1001 ) ); +gen( x, "small_positive.json" ); + +# Positive medium values: +x = Float32.( range( 3.0, stop = 20.0, length = 1001 ) ); +gen( x, "medium_positive.json" ); + +# Large positive values: +x = Float32.( collect( 500:25:5000 ) ); +gen( x, "large_positive.json" ); + +# Very large positive values: +x = Float32.( collect( 5000:50:10000 ) ); +gen( x, "very_large_positive.json" ); diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/small_positive.json b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/small_positive.json new file mode 100644 index 000000000000..b55d0a9ecd91 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/small_positive.json @@ -0,0 +1 @@ +{"expected":[0.0,0.00084679655,0.0016962707,0.0025483181,0.003402834,0.004260019,0.0051197675,0.005981974,0.0068468405,0.0077142613,0.00858413,0.009456545,0.0103317145,0.011209216,0.012089256,0.012971936,0.013857149,0.014744784,0.01563505,0.01652784,0.017423045,0.018320872,0.019221213,0.020123957,0.021029206,0.02193707,0.022847435,0.023760188,0.024675548,0.025593398,0.026513629,0.027436454,0.028361764,0.029289443,0.0302196,0.031152451,0.032087553,0.033025123,0.03396527,0.034907877,0.035852835,0.036800362,0.037750337,0.038702656,0.039657533,0.040614855,0.041574504,0.042536594,0.04350123,0.044468306,0.045437694,0.04640962,0.04738398,0.04836064,0.049339835,0.050321445,0.051305354,0.052291673,0.053280633,0.054271765,0.055265296,0.056261346,0.05725979,0.05826051,0.05926374,0.06026936,0.06127724,0.062287506,0.06330039,0.064315416,0.06533281,0.066352695,0.06737495,0.06839945,0.06942644,0.07045578,0.07148737,0.072521426,0.07355783,0.07459647,0.07563745,0.076680906,0.0777267,0.078774706,0.07982518,0.08087798,0.081932984,0.082990445,0.08405024,0.08511222,0.08617652,0.0872434,0.088312335,0.08938359,0.09045727,0.091533266,0.09261143,0.093692034,0.09477493,0.095860004,0.09694749,0.09803727,0.09912922,0.100223444,0.10132009,0.10241902,0.10352009,0.10462357,0.10572933,0.10683722,0.10794751,0.10906007,0.11017477,0.11129172,0.1124112,0.11353267,0.11465639,0.1157825,0.11691086,0.11804133,0.119174175,0.12030926,0.12144645,0.12258602,0.12372782,0.124871716,0.12601784,0.12716633,0.12831704,0.12946984,0.130625,0.13178237,0.13294181,0.13410361,0.13526762,0.13643369,0.13760199,0.13877274,0.13994543,0.14112031,0.14229754,0.14347695,0.14465842,0.14584221,0.1470282,0.1482162,0.14940655,0.15059908,0.15179364,0.15299037,0.15418942,0.15539065,0.15659389,0.15779945,0.15900716,0.1602169,0.16142893,0.16264313,0.16385934,0.16507769,0.16629848,0.16752113,0.16874593,0.16997302,0.17120224,0.17243347,0.17366695,0.17490259,0.17614022,0.17738011,0.17862213,0.17986614,0.18111226,0.18236065,0.18361115,0.18486363,0.18611838,0.18737523,0.18863404,0.18989511,0.19115828,0.19242342,0.19369064,0.19496027,0.1962317,0.1975052,0.19878097,0.20005883,0.20133862,0.20262064,0.20390475,0.2051908,0.20647891,0.20776941,0.20906168,0.21035603,0.21165259,0.21295123,0.21425179,0.21555455,0.21685939,0.21816613,0.21947508,0.22078608,0.22209899,0.22341394,0.22473112,0.22605033,0.22737142,0.22869474,0.23002008,0.23134731,0.23267674,0.2340082,0.23534153,0.2366769,0.23801461,0.23935404,0.24069549,0.24203911,0.24338478,0.24473229,0.246082,0.2474337,0.24878725,0.250143,0.25150076,0.25286034,0.25422192,0.2555857,0.25695145,0.25831908,0.25968882,0.2610606,0.26243418,0.26380992,0.26518765,0.26656723,0.26794875,0.26933262,0.27071816,0.27210563,0.27349526,0.27488688,0.2762803,0.27767587,0.27907342,0.28047273,0.2818742,0.28327763,0.28468287,0.28609008,0.28749937,0.28891066,0.29032373,0.2917389,0.29315606,0.29457498,0.295996,0.29741898,0.29884374,0.30027044,0.30169943,0.30313,0.30456254,0.30599716,0.30743372,0.308872,0.31031245,0.3117548,0.3131989,0.3146451,0.31609324,0.3175431,0.31899488,0.32044876,0.32190454,0.32336208,0.32482168,0.32628322,0.32774648,0.32921183,0.3306791,0.33214805,0.33361894,0.33509204,0.33656672,0.3380433,0.33952194,0.34100246,0.3424847,0.34396902,0.3454552,0.3469431,0.34843308,0.34992492,0.3514185,0.35291392,0.3544114,0.35591075,0.3574118,0.35891488,0.36041987,0.36192653,0.36343524,0.3649458,0.36645803,0.36797217,0.36948848,0.3710063,0.372526,0.3740477,0.37557128,0.37709653,0.37862378,0.3801529,0.3816837,0.38321632,0.38475117,0.38628748,0.38782564,0.3893658,0.3909078,0.39245147,0.39399713,0.39554465,0.39709377,0.39864492,0.40019792,0.40175253,0.403309,0.40486747,0.4064277,0.40798962,0.40955353,0.41111925,0.4126866,0.41425592,0.4158271,0.41739988,0.41897446,0.4205512,0.42212942,0.4237094,0.42529136,0.42687514,0.42846054,0.4300479,0.43163708,0.43322784,0.4348206,0.43641514,0.43801126,0.43960917,0.44120908,0.4428107,0.44441402,0.44601923,0.44762626,0.44923484,0.45084542,0.45245773,0.45407167,0.45568734,0.4573052,0.4589244,0.46054542,0.46216837,0.46379307,0.46541935,0.46704757,0.46867758,0.4703091,0.4719426,0.47357786,0.47521466,0.47685322,0.47849372,0.48013598,0.48177978,0.4834255,0.48507297,0.48672202,0.48837298,0.49002567,0.49167994,0.4933359,0.494994,0.49665347,0.49831465,0.4999777,0.5016426,0.50330895,0.5049772,0.5066472,0.5083187,0.5099922,0.5116674,0.51334405,0.5150224,0.5167028,0.5183848,0.52006835,0.5217538,0.52344096,0.5251296,0.5268202,0.5285125,0.5302062,0.5319017,0.5335993,0.53529817,0.53699875,0.53870124,0.5404054,0.54211104,0.5438186,0.5455279,0.5472386,0.54895127,0.55066556,0.55238134,0.55409884,0.5558182,0.5575392,0.55926174,0.56098616,0.5627122,0.5644398,0.5661692,0.5679003,0.5696329,0.5713671,0.5731034,0.57484096,0.57658017,0.5783213,0.58006406,0.5818083,0.5835544,0.5853021,0.5870513,0.58880216,0.5905551,0.59230924,0.59406507,0.59582275,0.5975821,0.5993428,0.60110545,0.6028697,0.60463536,0.60640293,0.6081721,0.60994273,0.611715,0.61348903,0.61526483,0.617042,0.618821,0.62060165,0.6223837,0.62416756,0.62595314,0.62774,0.62952864,0.6313192,0.63311106,0.6349045,0.6366998,0.6384967,0.64029497,0.6420951,0.6438968,0.6456999,0.6475049,0.64931154,0.6511195,0.65292907,0.65474045,0.65655345,0.6583678,0.660184,0.6620019,0.6638211,0.6656421,0.66746473,0.6692887,0.6711143,0.6729419,0.6747707,0.67660105,0.6784333,0.68026704,0.68210214,0.6839391,0.68577766,0.68761754,0.68945926,0.69130254,0.6931472,0.6949937,0.6968414,0.69869107,0.700542,0.7023947,0.704249,0.70610476,0.7079622,0.70982105,0.71168166,0.7135438,0.7154074,0.7172726,0.7191395,0.7210077,0.7228777,0.724749,0.72662216,0.7284968,0.73037285,0.73225063,0.7341297,0.7360106,0.73789304,0.73977685,0.7416624,0.7435493,0.7454379,0.7473281,0.7492196,0.7511128,0.7530075,0.7549038,0.7568017,0.75870097,0.7606019,0.7625042,0.76440823,0.7663138,0.7682207,0.7701294,0.77203953,0.773951,0.77586424,0.77777874,0.77969503,0.7816129,0.783532,0.78545284,0.787375,0.7892989,0.7912243,0.793151,0.79507947,0.7970092,0.7989407,0.80087376,0.802808,0.804744,0.80668133,0.8086204,0.81056094,0.81250274,0.81444633,0.8163914,0.8183377,0.8202858,0.8222351,0.82418627,0.82613885,0.8280927,0.8300482,0.832005,0.8339636,0.8359237,0.83788496,0.83984804,0.8418123,0.8437783,0.84574586,0.8477146,0.8496851,0.8516568,0.85363024,0.8556052,0.8575813,0.85955924,0.86153865,0.86351925,0.8655015,0.8674851,0.8694704,0.87145716,0.87344515,0.8754348,0.8774258,0.8794184,0.8814125,0.88340783,0.8854049,0.88740313,0.8894031,0.89140457,0.89340717,0.89541155,0.8974171,0.8994244,0.90143317,0.9034431,0.90545475,0.90746754,0.9094821,0.9114982,0.9135154,0.91553426,0.9175546,0.91957617,0.92159945,0.9236239,0.92565006,0.92767763,0.9297064,0.9317369,0.9337686,0.9358019,0.93783677,0.93987274,0.9419104,0.9439492,0.94598985,0.9480318,0.9500749,0.95211977,0.9541658,0.9562135,0.9582627,0.96031296,0.962365,0.96441835,0.966473,0.9685292,0.97058666,0.97264576,0.97470635,0.976768,0.97883135,0.98089594,0.98296213,0.98502976,0.9870985,0.989169,0.9912406,0.9933139,0.9953885,0.9974644,0.9995419,1.0016205,1.0037009,1.0057826,1.0078654,1.00995,1.0120357,1.0141231,1.0162117,1.0183017,1.0203933,1.0224862,1.0245802,1.026676,1.0287728,1.0308714,1.0329714,1.0350723,1.037175,1.039279,1.0413845,1.0434912,1.0455992,1.047709,1.0498197,1.0519321,1.0540459,1.0561609,1.0582774,1.0603951,1.0625144,1.0646352,1.066757,1.0688804,1.0710053,1.0731313,1.0752589,1.0773876,1.0795178,1.0816495,1.0837824,1.0859169,1.0880524,1.0901896,1.0923282,1.0944679,1.0966091,1.0987515,1.1008955,1.1030409,1.1051874,1.1073354,1.1094847,1.1116354,1.1137877,1.1159409,1.1180959,1.1202521,1.1224093,1.1245683,1.1267284,1.12889,1.131053,1.1332171,1.1353829,1.1375496,1.139718,1.1418878,1.1440586,1.146231,1.1484046,1.1505797,1.1527562,1.1549337,1.1571128,1.159293,1.1614748,1.163658,1.1658423,1.1680281,1.170215,1.1724036,1.1745933,1.1767843,1.1789768,1.1811705,1.1833653,1.1855619,1.1877594,1.1899586,1.192159,1.1943606,1.1965637,1.1987679,1.2009736,1.2031807,1.2053888,1.2075986,1.2098093,1.2120216,1.2142353,1.21645,1.2186663,1.2208837,1.2231026,1.225323,1.2275442,1.2297671,1.2319913,1.2342165,1.2364433,1.2386711,1.2409005,1.2431312,1.245363,1.2475963,1.2498307,1.2520666,1.2543038,1.2565421,1.2587819,1.2610228,1.2632653,1.2655089,1.2677537,1.27,1.2722474,1.2744963,1.2767465,1.2789978,1.2812505,1.2835044,1.2857597,1.2880163,1.2902741,1.2925333,1.2947938,1.2970554,1.2993186,1.3015826,1.3038483,1.3061152,1.3083832,1.3106527,1.3129232,1.3151952,1.3174686,1.319743,1.3220189,1.3242958,1.3265742,1.328854,1.3311348,1.3334169,1.3357003,1.337985,1.3402712,1.3425583,1.344847,1.3471369,1.3494277,1.3517201,1.3540136,1.3563086,1.3586047,1.3609021,1.3632008,1.3655005,1.3678018,1.3701043,1.3724079,1.374713,1.3770189,1.3793265,1.3816353,1.3839452,1.3862565,1.3885689,1.3908827,1.3931978,1.3955138,1.3978314,1.4001503,1.4024701,1.4047915,1.4071138,1.4094377,1.4117627,1.4140887,1.4164164,1.4187449,1.421075,1.4234064,1.4257386,1.4280725,1.4304072,1.4327434,1.4350809,1.4374194,1.4397594,1.4421003,1.4444427,1.4467865,1.4491311,1.4514773,1.4538244,1.4561731,1.4585229,1.4608738,1.4632261,1.4655795,1.467934,1.4702901,1.472647,1.4750055,1.4773653,1.4797258,1.4820879,1.484451,1.4868157,1.4891813,1.4915481,1.4939163,1.4962856,1.4986562,1.5010281,1.5034009,1.5057752,1.5081505,1.5105273,1.5129052,1.5152841,1.5176644,1.5200461,1.5224286,1.5248127,1.5271976,1.529584,1.5319718,1.5343604,1.5367503,1.5391414,1.5415338,1.5439276,1.5463222,1.5487183,1.5511153,1.5535138,1.5559134,1.5583141,1.5607162,1.5631192,1.5655236,1.5679294,1.5703359,1.5727441,1.575153,1.5775635,1.5799751,1.5823877,1.5848018,1.5872171,1.5896332,1.5920509,1.5944694,1.5968893,1.5993106,1.6017327,1.6041563,1.6065807,1.6090066,1.6114337,1.6138618,1.6162913,1.6187217,1.6211536,1.6235865,1.6260206,1.6284559,1.6308922,1.6333299,1.6357689,1.6382087,1.64065,1.6430924,1.6455357,1.6479807,1.6504264,1.6528735,1.6553218,1.6577711,1.6602217,1.6626732,1.6651263,1.6675804,1.6700355,1.672492,1.6749495,1.6774082,1.6798683,1.6823292,1.6847916,1.6872547,1.6897194,1.6921853,1.694652,1.6971201,1.6995895,1.7020596,1.7045313,1.7070038,1.7094777,1.7119529,1.7144289,1.7169063,1.7193847,1.7218643,1.7243452,1.7268269,1.7293102,1.7317941,1.7342796,1.7367663,1.7392538,1.7417426,1.7442324,1.7467238,1.7492161,1.7517095,1.754204,1.7566996,1.7591965,1.7616947,1.7641935,1.7666941,1.7691956,1.771698,1.7742019,1.7767065,1.7792125,1.7817198,1.7842278,1.7867374,1.7892476,1.7917595],"x":[1.0,1.002,1.004,1.006,1.008,1.01,1.012,1.014,1.016,1.018,1.02,1.022,1.024,1.026,1.028,1.03,1.032,1.034,1.036,1.038,1.04,1.042,1.044,1.046,1.048,1.05,1.052,1.054,1.056,1.058,1.06,1.062,1.064,1.066,1.068,1.07,1.072,1.074,1.076,1.078,1.08,1.082,1.084,1.086,1.088,1.09,1.092,1.094,1.096,1.098,1.1,1.102,1.104,1.106,1.108,1.11,1.112,1.114,1.116,1.118,1.12,1.122,1.124,1.126,1.128,1.13,1.132,1.134,1.136,1.138,1.14,1.142,1.144,1.146,1.148,1.15,1.152,1.154,1.156,1.158,1.16,1.162,1.164,1.166,1.168,1.17,1.172,1.174,1.176,1.178,1.18,1.182,1.184,1.186,1.188,1.19,1.192,1.194,1.196,1.198,1.2,1.202,1.204,1.206,1.208,1.21,1.212,1.214,1.216,1.218,1.22,1.222,1.224,1.226,1.228,1.23,1.232,1.234,1.236,1.238,1.24,1.242,1.244,1.246,1.248,1.25,1.252,1.254,1.256,1.258,1.26,1.262,1.264,1.266,1.268,1.27,1.272,1.274,1.276,1.278,1.28,1.282,1.284,1.286,1.288,1.29,1.292,1.294,1.296,1.298,1.3,1.302,1.304,1.306,1.308,1.31,1.312,1.314,1.316,1.318,1.32,1.322,1.324,1.326,1.328,1.33,1.332,1.334,1.336,1.338,1.34,1.342,1.344,1.346,1.348,1.35,1.352,1.354,1.356,1.358,1.36,1.362,1.364,1.366,1.368,1.37,1.372,1.374,1.376,1.378,1.38,1.382,1.384,1.386,1.388,1.39,1.392,1.394,1.396,1.398,1.4,1.402,1.404,1.406,1.408,1.41,1.412,1.414,1.416,1.418,1.42,1.422,1.424,1.426,1.428,1.43,1.432,1.434,1.436,1.438,1.44,1.442,1.444,1.446,1.448,1.45,1.452,1.454,1.456,1.458,1.46,1.462,1.464,1.466,1.468,1.47,1.472,1.474,1.476,1.478,1.48,1.482,1.484,1.486,1.488,1.49,1.492,1.494,1.496,1.498,1.5,1.502,1.504,1.506,1.508,1.51,1.512,1.514,1.516,1.518,1.52,1.522,1.524,1.526,1.528,1.53,1.532,1.534,1.536,1.538,1.54,1.542,1.544,1.546,1.548,1.55,1.552,1.554,1.556,1.558,1.56,1.562,1.564,1.566,1.568,1.57,1.572,1.574,1.576,1.578,1.58,1.582,1.584,1.586,1.588,1.59,1.592,1.594,1.596,1.598,1.6,1.602,1.604,1.606,1.608,1.61,1.612,1.614,1.616,1.618,1.62,1.622,1.624,1.626,1.628,1.63,1.632,1.634,1.636,1.638,1.64,1.642,1.644,1.646,1.648,1.65,1.652,1.654,1.656,1.658,1.66,1.662,1.664,1.666,1.668,1.67,1.672,1.674,1.676,1.678,1.68,1.682,1.684,1.686,1.688,1.69,1.692,1.694,1.696,1.698,1.7,1.702,1.704,1.706,1.708,1.71,1.712,1.714,1.716,1.718,1.72,1.722,1.724,1.726,1.728,1.73,1.732,1.734,1.736,1.738,1.74,1.742,1.744,1.746,1.748,1.75,1.752,1.754,1.756,1.758,1.76,1.762,1.764,1.766,1.768,1.77,1.772,1.774,1.776,1.778,1.78,1.782,1.784,1.786,1.788,1.79,1.792,1.794,1.796,1.798,1.8,1.802,1.804,1.806,1.808,1.81,1.812,1.814,1.816,1.818,1.82,1.822,1.824,1.826,1.828,1.83,1.832,1.834,1.836,1.838,1.84,1.842,1.844,1.846,1.848,1.85,1.852,1.854,1.856,1.858,1.86,1.862,1.864,1.866,1.868,1.87,1.872,1.874,1.876,1.878,1.88,1.882,1.884,1.886,1.888,1.89,1.892,1.894,1.896,1.898,1.9,1.902,1.904,1.906,1.908,1.91,1.912,1.914,1.916,1.918,1.92,1.922,1.924,1.926,1.928,1.93,1.932,1.934,1.936,1.938,1.94,1.942,1.944,1.946,1.948,1.95,1.952,1.954,1.956,1.958,1.96,1.962,1.964,1.966,1.968,1.97,1.972,1.974,1.976,1.978,1.98,1.982,1.984,1.986,1.988,1.99,1.992,1.994,1.996,1.998,2.0,2.002,2.004,2.006,2.008,2.01,2.012,2.014,2.016,2.018,2.02,2.022,2.024,2.026,2.028,2.03,2.032,2.034,2.036,2.038,2.04,2.042,2.044,2.046,2.048,2.05,2.052,2.054,2.056,2.058,2.06,2.062,2.064,2.066,2.068,2.07,2.072,2.074,2.076,2.078,2.08,2.082,2.084,2.086,2.088,2.09,2.092,2.094,2.096,2.098,2.1,2.102,2.104,2.106,2.108,2.11,2.112,2.114,2.116,2.118,2.12,2.122,2.124,2.126,2.128,2.13,2.132,2.134,2.136,2.138,2.14,2.142,2.144,2.146,2.148,2.15,2.152,2.154,2.156,2.158,2.16,2.162,2.164,2.166,2.168,2.17,2.172,2.174,2.176,2.178,2.18,2.182,2.184,2.186,2.188,2.19,2.192,2.194,2.196,2.198,2.2,2.202,2.204,2.206,2.208,2.21,2.212,2.214,2.216,2.218,2.22,2.222,2.224,2.226,2.228,2.23,2.232,2.234,2.236,2.238,2.24,2.242,2.244,2.246,2.248,2.25,2.252,2.254,2.256,2.258,2.26,2.262,2.264,2.266,2.268,2.27,2.272,2.274,2.276,2.278,2.28,2.282,2.284,2.286,2.288,2.29,2.292,2.294,2.296,2.298,2.3,2.302,2.304,2.306,2.308,2.31,2.312,2.314,2.316,2.318,2.32,2.322,2.324,2.326,2.328,2.33,2.332,2.334,2.336,2.338,2.34,2.342,2.344,2.346,2.348,2.35,2.352,2.354,2.356,2.358,2.36,2.362,2.364,2.366,2.368,2.37,2.372,2.374,2.376,2.378,2.38,2.382,2.384,2.386,2.388,2.39,2.392,2.394,2.396,2.398,2.4,2.402,2.404,2.406,2.408,2.41,2.412,2.414,2.416,2.418,2.42,2.422,2.424,2.426,2.428,2.43,2.432,2.434,2.436,2.438,2.44,2.442,2.444,2.446,2.448,2.45,2.452,2.454,2.456,2.458,2.46,2.462,2.464,2.466,2.468,2.47,2.472,2.474,2.476,2.478,2.48,2.482,2.484,2.486,2.488,2.49,2.492,2.494,2.496,2.498,2.5,2.502,2.504,2.506,2.508,2.51,2.512,2.514,2.516,2.518,2.52,2.522,2.524,2.526,2.528,2.53,2.532,2.534,2.536,2.538,2.54,2.542,2.544,2.546,2.548,2.55,2.552,2.554,2.556,2.558,2.56,2.562,2.564,2.566,2.568,2.57,2.572,2.574,2.576,2.578,2.58,2.582,2.584,2.586,2.588,2.59,2.592,2.594,2.596,2.598,2.6,2.602,2.604,2.606,2.608,2.61,2.612,2.614,2.616,2.618,2.62,2.622,2.624,2.626,2.628,2.63,2.632,2.634,2.636,2.638,2.64,2.642,2.644,2.646,2.648,2.65,2.652,2.654,2.656,2.658,2.66,2.662,2.664,2.666,2.668,2.67,2.672,2.674,2.676,2.678,2.68,2.682,2.684,2.686,2.688,2.69,2.692,2.694,2.696,2.698,2.7,2.702,2.704,2.706,2.708,2.71,2.712,2.714,2.716,2.718,2.72,2.722,2.724,2.726,2.728,2.73,2.732,2.734,2.736,2.738,2.74,2.742,2.744,2.746,2.748,2.75,2.752,2.754,2.756,2.758,2.76,2.762,2.764,2.766,2.768,2.77,2.772,2.774,2.776,2.778,2.78,2.782,2.784,2.786,2.788,2.79,2.792,2.794,2.796,2.798,2.8,2.802,2.804,2.806,2.808,2.81,2.812,2.814,2.816,2.818,2.82,2.822,2.824,2.826,2.828,2.83,2.832,2.834,2.836,2.838,2.84,2.842,2.844,2.846,2.848,2.85,2.852,2.854,2.856,2.858,2.86,2.862,2.864,2.866,2.868,2.87,2.872,2.874,2.876,2.878,2.88,2.882,2.884,2.886,2.888,2.89,2.892,2.894,2.896,2.898,2.9,2.902,2.904,2.906,2.908,2.91,2.912,2.914,2.916,2.918,2.92,2.922,2.924,2.926,2.928,2.93,2.932,2.934,2.936,2.938,2.94,2.942,2.944,2.946,2.948,2.95,2.952,2.954,2.956,2.958,2.96,2.962,2.964,2.966,2.968,2.97,2.972,2.974,2.976,2.978,2.98,2.982,2.984,2.986,2.988,2.99,2.992,2.994,2.996,2.998,3.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/very_large_positive.json b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/very_large_positive.json new file mode 100644 index 000000000000..b0cffa4566eb --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/fixtures/julia/very_large_positive.json @@ -0,0 +1 @@ +{"expected":[37591.145,38017.258,38443.867,38870.965,39298.55,39726.613,40155.156,40584.168,41013.65,41443.594,41873.992,42304.85,42736.156,43167.91,43600.105,44032.74,44465.81,44899.31,45333.234,45767.586,46202.355,46637.543,47073.145,47509.156,47945.574,48382.395,48819.613,49257.23,49695.242,50133.645,50572.434,51011.605,51451.16,51891.094,52331.406,52772.086,53213.14,53654.562,54096.348,54538.496,54981.004,55423.867,55867.09,56310.66,56754.582,57198.85,57643.465,58088.418,58533.715,58979.348,59425.316,59871.62,60318.254,60765.215,61212.504,61660.12,62108.055,62556.312,63004.89,63453.78,63902.99,64352.508,64802.336,65252.473,65702.92,66153.664,66604.72,67056.08,67507.73,67959.68,68411.92,68864.47,69317.3,69770.42,70223.836,70677.54,71131.52,71585.79,72040.34,72495.18,72950.29,73405.68,73861.34,74317.29,74773.5,75229.99,75686.74,76143.77,76601.06,77058.625,77516.445,77974.53,78432.88,78891.49,79350.36,79809.484,80268.86,80728.5,81188.39,81648.53,82108.93],"x":[5000.0,5050.0,5100.0,5150.0,5200.0,5250.0,5300.0,5350.0,5400.0,5450.0,5500.0,5550.0,5600.0,5650.0,5700.0,5750.0,5800.0,5850.0,5900.0,5950.0,6000.0,6050.0,6100.0,6150.0,6200.0,6250.0,6300.0,6350.0,6400.0,6450.0,6500.0,6550.0,6600.0,6650.0,6700.0,6750.0,6800.0,6850.0,6900.0,6950.0,7000.0,7050.0,7100.0,7150.0,7200.0,7250.0,7300.0,7350.0,7400.0,7450.0,7500.0,7550.0,7600.0,7650.0,7700.0,7750.0,7800.0,7850.0,7900.0,7950.0,8000.0,8050.0,8100.0,8150.0,8200.0,8250.0,8300.0,8350.0,8400.0,8450.0,8500.0,8550.0,8600.0,8650.0,8700.0,8750.0,8800.0,8850.0,8900.0,8950.0,9000.0,9050.0,9100.0,9150.0,9200.0,9250.0,9300.0,9350.0,9400.0,9450.0,9500.0,9550.0,9600.0,9650.0,9700.0,9750.0,9800.0,9850.0,9900.0,9950.0,10000.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/test.js b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/test.js new file mode 100644 index 000000000000..ef31d7ad2b30 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/test.js @@ -0,0 +1,168 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var factorial = require( '@stdlib/math/base/special/factorial' ); +var incrspace = require( '@stdlib/array/base/incrspace' ); +var lnf = require( '@stdlib/math/base/special/lnf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var factoriallnf = require( './../lib' ); + + +// FIXTURES // + +var veryLargePositive = require( './fixtures/julia/very_large_positive.json' ); +var largePositive = require( './fixtures/julia/large_positive.json' ); +var mediumPositive = require( './fixtures/julia/medium_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factoriallnf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided a negative integer, the function returns `NaN`', function test( t ) { + var values; + var v; + var i; + + values = incrspace( -1.0, -500.0, -1.0 ); + for ( i = 0; i < values.length; i++ ) { + v = factoriallnf( f32( values[ i ] ) ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'if provided negative infinity, the function returns `NaN`', function test( t ) { + var v = factoriallnf( NINF ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided positive infinity, the function returns `+infinity`', function test( t ) { + var v = factoriallnf( PINF ); + t.strictEqual( v, PINF, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) { + var v = factoriallnf( NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (very large positive integers)', function test( t ) { + var expected; + var x; + var y; + var i; + + expected = veryLargePositive.expected; + x = veryLargePositive.x; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (large positive integers)', function test( t ) { + var expected; + var x; + var y; + var i; + + expected = largePositive.expected; + x = largePositive.x; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (medium positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + + expected = mediumPositive.expected; + x = mediumPositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 3, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (small positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + + expected = smallPositive.expected; + x = smallPositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a value almost equal to `lnf( factorial( x )` for `x` in `[0,34]`', function test( t ) { + var expected; + var values; + var v; + var i; + + values = incrspace( 0.0, 34.0, 0.5 ); + for ( i = 0; i < values.length; i++ ) { + values[ i ] = f32( values[ i ] ); + v = factoriallnf( values[ i ] ); + + // TODO: replace with `factorialf` when available + expected = lnf( f32( factorial( values[ i ] ) ) ); + t.strictEqual( ulpdiff( v, expected ) <= 4, true, 'returns expected value' ); + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/test.native.js new file mode 100644 index 000000000000..6e35f632daa9 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/factoriallnf/test/test.native.js @@ -0,0 +1,177 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var factorial = require( '@stdlib/math/base/special/factorial' ); +var incrspace = require( '@stdlib/array/base/incrspace' ); +var lnf = require( '@stdlib/math/base/special/lnf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var veryLargePositive = require( './fixtures/julia/very_large_positive.json' ); +var largePositive = require( './fixtures/julia/large_positive.json' ); +var mediumPositive = require( './fixtures/julia/medium_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); + + +// VARIABLES // + +var factoriallnf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( factoriallnf instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factoriallnf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided a negative integer, the function returns `NaN`', opts, function test( t ) { + var values; + var v; + var i; + + values = incrspace( -1.0, -500.0, -1.0 ); + for ( i = 0; i < values.length; i++ ) { + v = factoriallnf( f32( values[ i ] ) ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'if provided negative infinity, the function returns `NaN`', opts, function test( t ) { + var v = factoriallnf( NINF ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided positive infinity, the function returns `+infinity`', opts, function test( t ) { + var v = factoriallnf( PINF ); + t.strictEqual( v, PINF, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `NaN`, the function returns `NaN`', opts, function test( t ) { + var v = factoriallnf( NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (very large positive integers)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + + expected = veryLargePositive.expected; + x = veryLargePositive.x; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (large positive integers)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + + expected = largePositive.expected; + x = largePositive.x; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (medium positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + + expected = mediumPositive.expected; + x = mediumPositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 3, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the natural logarithm of the factorial of `x` (small positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + + expected = smallPositive.expected; + x = smallPositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = factoriallnf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a value almost equal to `lnf( factorial( x )` for `x` in `[0,34]`', opts, function test( t ) { + var expected; + var values; + var v; + var i; + + values = incrspace( 0.0, 34.0, 0.5 ); + for ( i = 0; i < values.length; i++ ) { + values[ i ] = f32( values[ i ] ); + v = factoriallnf( values[ i ] ); + + // TODO: replace with `factorialf` when available + expected = lnf( f32( factorial( values[ i ] ) ) ); + t.strictEqual( ulpdiff( v, expected ) <= 4, true, 'returns expected value' ); + } + t.end(); +});