From 37f44fc42226955811bdfddca75fa0c0036f668a Mon Sep 17 00:00:00 2001 From: ShabiShett07 Date: Thu, 30 Jan 2025 01:19:19 +0530 Subject: [PATCH] feat: add C implementation math/base/special/logitf --- .../math/base/special/logitf/README.md | 213 ++++++++++++++++++ .../special/logitf/benchmark/benchmark.js | 51 +++++ .../logitf/benchmark/benchmark.native.js | 60 +++++ .../base/special/logitf/benchmark/c/Makefile | 146 ++++++++++++ .../special/logitf/benchmark/c/benchmark.c | 131 +++++++++++ .../math/base/special/logitf/binding.gyp | 170 ++++++++++++++ .../math/base/special/logitf/docs/repl.txt | 35 +++ .../base/special/logitf/docs/types/index.d.ts | 57 +++++ .../base/special/logitf/docs/types/test.ts | 44 ++++ .../base/special/logitf/examples/c/Makefile | 146 ++++++++++++ .../base/special/logitf/examples/c/example.c | 33 +++ .../base/special/logitf/examples/index.js | 30 +++ .../math/base/special/logitf/include.gypi | 53 +++++ .../include/stdlib/math/base/special/logitf.h | 38 ++++ .../math/base/special/logitf/lib/index.js | 52 +++++ .../math/base/special/logitf/lib/main.js | 78 +++++++ .../math/base/special/logitf/lib/native.js | 62 +++++ .../math/base/special/logitf/manifest.json | 84 +++++++ .../math/base/special/logitf/package.json | 66 ++++++ .../math/base/special/logitf/src/Makefile | 70 ++++++ .../math/base/special/logitf/src/addon.c | 23 ++ .../math/base/special/logitf/src/main.c | 50 ++++ .../logitf/test/fixtures/python/large.json | 1 + .../logitf/test/fixtures/python/medium.json | 1 + .../logitf/test/fixtures/python/runner.py | 78 +++++++ .../logitf/test/fixtures/python/small.json | 1 + .../math/base/special/logitf/test/test.js | 140 ++++++++++++ .../base/special/logitf/test/test.native.js | 152 +++++++++++++ 28 files changed, 2065 insertions(+) create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/README.md create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/benchmark/benchmark.js create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/benchmark/benchmark.native.js create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/benchmark/c/Makefile create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/benchmark/c/benchmark.c create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/binding.gyp create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/docs/repl.txt create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/docs/types/index.d.ts create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/docs/types/test.ts create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/examples/c/Makefile create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/examples/c/example.c create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/examples/index.js create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/include.gypi create mode 100644 lib/node_modules/@stdlib/math/base/special/logitf/include/stdlib/math/base/special/logitf.h create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/lib/index.js create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/lib/main.js create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/lib/native.js create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/manifest.json create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/package.json create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/src/Makefile create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/src/addon.c create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/src/main.c create mode 100644 lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/large.json create mode 100644 lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/medium.json create mode 100644 lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/runner.py create mode 100644 lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/small.json create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/test/test.js create mode 100755 lib/node_modules/@stdlib/math/base/special/logitf/test/test.native.js diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/README.md b/lib/node_modules/@stdlib/math/base/special/logitf/README.md new file mode 100755 index 000000000000..603c7cb9431e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/README.md @@ -0,0 +1,213 @@ + + +# logitf + +> Compute the [logit][logit] function. of single-precision floating-point number. + +
+ +The [logit][logit] function is defined as the logarithm of the odds `p / (1-p)`; i.e., + + + +```math +\mathop{\mathrm{logit}}(p)=\log \left({\frac {p}{1-p}}\right) +``` + + + + + +The [logit][logit] function is the inverse of the [standard logistic][standard-logistic] function, sometimes also called the sigmoid function. + +
+ + + +
+ +## Usage + +```javascript +var logitf = require( '@stdlib/math/base/special/logitf' ); +``` + +#### logitf( p ) + +Computes the [logit][logit] function of single-precision floating-point number. + +```javascript +var v = logitf( 0.2 ); +// returns ~-1.386 + +v = logitf( 0.9 ); +// returns ~2.197 +``` + +If `p < 0` or `p > 1`, the function returns `NaN`. + +```javascript +var v = logitf( 1.3 ); +// returns NaN + +v = logitf( -0.2 ); +// returns NaN +``` + +
+ + + +
+ +## Examples + + + +```javascript +var randu = require( '@stdlib/random/base/randu' ); +var logitf = require( '@stdlib/math/base/special/logitf' ); + +var p; +var i; + +for ( i = 0; i < 100; i++ ) { + p = randu(); + console.log( 'logitf(%d) = %d', p, logitf( p ) ); +} +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/logitf.h" +``` + +#### stdlib_base_logitf( p ) + +Computes the [logit][logit] function of single-precision floating-point number. + +```c +float out = stdlib_base_logitf( 0.2 ); +// returns ~-1.386 + +out = stdlib_base_logitf( 0.9 ); +// returns ~2.197 +``` + +The function accepts the following arguments: + +- **p**: `[in] float` input value. + +```c +float stdlib_base_logitf( const float p ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/logitf.h" +#include +#include + +int main( void ) { + float x; + float v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = (float)rand() / (float)RAND_MAX; + v = stdlib_base_logitf( x ); + printf( "logitf(%f) = %f\n", x, v ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/benchmark.js new file mode 100755 index 000000000000..ed4375912f70 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/benchmark.js @@ -0,0 +1,51 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pkg = require( './../package.json' ).name; +var logitf = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var x; + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x = randu(); + y = logitf( 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/logitf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/benchmark.native.js new file mode 100755 index 000000000000..9bef55bb186b --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/benchmark.native.js @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2022 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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var logitf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( logitf 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 = randu(); + y = logitf( 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/logitf/benchmark/c/Makefile b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/c/Makefile new file mode 100755 index 000000000000..7f6bbc4c205c --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2021 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/logitf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/c/benchmark.c new file mode 100755 index 000000000000..92ccdc62e69a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/benchmark/c/benchmark.c @@ -0,0 +1,131 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2022 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/logitf.h" +#include +#include +#include +#include +#include + +#define NAME "logitf" +#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 y; + double t; + int i; + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + y = stdlib_base_logitf( rand_float() ); + 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/logitf/binding.gyp b/lib/node_modules/@stdlib/math/base/special/logitf/binding.gyp new file mode 100755 index 000000000000..f2b466aef5c4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2023 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/logitf/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/logitf/docs/repl.txt new file mode 100755 index 000000000000..f07b4bfe9c21 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/docs/repl.txt @@ -0,0 +1,35 @@ + +{{alias}}( p ) + Evaluates the logit function of single-precision floating point number. + + Let `p` be the probability of some event. The logit function is defined as + the logarithm of the odds `p / (1-p)`. + + If `p < 0` or `p > 1`, the function returns `NaN`. + + Parameters + ---------- + p: number + Input value. + + Returns + ------- + y: number + Function value. + + Examples + -------- + > var y = {{alias}}( 0.2 ) + ~-1.386 + > y = {{alias}}( 0.9 ) + ~2.197 + > y = {{alias}}( -4.0 ) + NaN + > y = {{alias}}( 1.5 ) + NaN + > y = {{alias}}( NaN ) + NaN + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/logitf/docs/types/index.d.ts new file mode 100755 index 000000000000..832680efc7c8 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/docs/types/index.d.ts @@ -0,0 +1,57 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2019 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 logit function of single-precision floating-point number. +* +* ## Notes +* +* - Let `p` be the probability of some event. The logit function is defined as the logarithm of the odds `p / (1-p)`. +* - If `p < 0` or `p > 1`, the function returns `NaN`. +* +* @param p - input value +* @returns function value +* +* @example +* var y = logitf( 0.2 ); +* // returns ~-1.386 +* +* @example +* var y = logitf( 0.9 ); +* // returns ~2.197 +* +* @example +* var y = logitf( -4.0 ); +* // returns NaN +* +* @example +* var y = logitf( 1.5 ); +* // returns NaN +* +* @example +* var y = logitf( NaN ); +* // returns NaN +*/ +declare function logitf( p: number ): number; + + +// EXPORTS // + +export = logitf; diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/logitf/docs/types/test.ts new file mode 100755 index 000000000000..0bedb0974a58 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2019 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 logitf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + logitf( 8 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + logitf( true ); // $ExpectError + logitf( false ); // $ExpectError + logitf( null ); // $ExpectError + logitf( undefined ); // $ExpectError + logitf( '5' ); // $ExpectError + logitf( [] ); // $ExpectError + logitf( {} ); // $ExpectError + logitf( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + logitf(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/examples/c/Makefile b/lib/node_modules/@stdlib/math/base/special/logitf/examples/c/Makefile new file mode 100755 index 000000000000..f0ae66fecf01 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2023 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/logitf/examples/c/example.c b/lib/node_modules/@stdlib/math/base/special/logitf/examples/c/example.c new file mode 100755 index 000000000000..52f0728384ff --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/examples/c/example.c @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2022 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/logitf.h" +#include +#include + +int main( void ) { + float x; + float v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = (float)rand() / (float)RAND_MAX; + v = stdlib_base_logitf( x ); + printf( "logitf(%f) = %f\n", x, v ); + } +} diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/examples/index.js b/lib/node_modules/@stdlib/math/base/special/logitf/examples/index.js new file mode 100755 index 000000000000..3a02c00f57c4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 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 randu = require( '@stdlib/random/base/randu' ); +var logitf = require( './../lib' ); + +var p; +var i; + +for ( i = 0; i < 100; i++ ) { + p = randu(); + console.log( 'logitf(%d) = %d', p, logitf( p ) ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/include.gypi b/lib/node_modules/@stdlib/math/base/special/logitf/include.gypi new file mode 100755 index 000000000000..78db9faf8c74 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2023 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", + "logitf", + "proportion", + "log-odds", + "logistic", + "sigmoid", + "special" + ] + } diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/src/Makefile b/lib/node_modules/@stdlib/math/base/special/logitf/src/Makefile new file mode 100755 index 000000000000..904c7dc4bd7a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2023 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/logitf/src/addon.c b/lib/node_modules/@stdlib/math/base/special/logitf/src/addon.c new file mode 100755 index 000000000000..4b0fe367a447 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/src/addon.c @@ -0,0 +1,23 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2022 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/logitf.h" +#include "stdlib/math/base/napi/unary.h" + +// cppcheck-suppress shadowFunction +STDLIB_MATH_BASE_NAPI_MODULE_F_F( stdlib_base_logitf ) diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/src/main.c b/lib/node_modules/@stdlib/math/base/special/logitf/src/main.c new file mode 100755 index 000000000000..2b8e7bb4a44e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/src/main.c @@ -0,0 +1,50 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2022 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/logitf.h" +#include "stdlib/math/base/assert/is_probabilityf.h" +#include "stdlib/math/base/assert/is_nanf.h" +#include "stdlib/math/base/special/lnf.h" +#include "stdlib/constants/float32/pinf.h" +#include "stdlib/constants/float32/ninf.h" + +/** +* Evaluates the logit function of single-precision floating-point number. +* +* @param x input value +* @return output value +* +* @example +* float out = stdlib_base_logitf( 0.2 ); +* // returns ~-1.386 +*/ +float stdlib_base_logitf( const float p ) { + if ( stdlib_base_is_nanf( p ) ) { + return 0.0f / 0.0f; // NaN + } + if ( !stdlib_base_is_probabilityf( p ) ) { + return 0.0f / 0.0f; // NaN + } + if ( p == 0.0f ) { + return STDLIB_CONSTANT_FLOAT32_NINF; + } + if ( p == 1.0f ) { + return STDLIB_CONSTANT_FLOAT32_PINF; + } + return stdlib_base_lnf( p / ( 1.0f - p ) ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/large.json b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/large.json new file mode 100644 index 000000000000..cd8ad3a03e71 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/large.json @@ -0,0 +1 @@ +{"x": [0.75, 0.7505007982254028, 0.7510015964508057, 0.7515023946762085, 0.7520031929016113, 0.7525039911270142, 0.753004789352417, 0.7535055875778198, 0.7540063858032227, 0.7545072436332703, 0.7550080418586731, 0.7555088400840759, 0.7560096383094788, 0.7565104365348816, 0.7570112347602844, 0.7575120329856873, 0.7580128312110901, 0.7585136294364929, 0.7590144276618958, 0.7595152258872986, 0.7600160241127014, 0.7605168223381042, 0.7610176205635071, 0.7615184187889099, 0.7620192170143127, 0.7625200152397156, 0.7630208134651184, 0.763521671295166, 0.7640224695205688, 0.7645232677459717, 0.7650240659713745, 0.7655248641967773, 0.7660256624221802, 0.766526460647583, 0.7670272588729858, 0.7675280570983887, 0.7680288553237915, 0.7685296535491943, 0.7690304517745972, 0.76953125, 0.7700320482254028, 0.7705328464508057, 0.7710336446762085, 0.7715344429016113, 0.7720352411270142, 0.7725360989570618, 0.7730368971824646, 0.7735376954078674, 0.7740384936332703, 0.7745392918586731, 0.7750400900840759, 0.7755408883094788, 0.7760416865348816, 0.7765424847602844, 0.7770432829856873, 0.7775440812110901, 0.7780448794364929, 0.7785456776618958, 0.7790464758872986, 0.7795472741127014, 0.7800480723381042, 0.7805488705635071, 0.7810497283935547, 0.7815505266189575, 0.7820513248443604, 0.7825521230697632, 0.783052921295166, 0.7835537195205688, 0.7840545177459717, 0.7845553159713745, 0.7850561141967773, 0.7855569124221802, 0.786057710647583, 0.7865585088729858, 0.7870593070983887, 0.7875601053237915, 0.7880609035491943, 0.7885617017745972, 0.7890625, 0.7895632982254028, 0.7900641560554504, 0.7905649542808533, 0.7910657525062561, 0.7915665507316589, 0.7920673489570618, 0.7925681471824646, 0.7930689454078674, 0.7935697436332703, 0.7940705418586731, 0.7945713400840759, 0.7950721383094788, 0.7955729365348816, 0.7960737347602844, 0.7965745329856873, 0.7970753312110901, 0.7975761294364929, 0.7980769276618958, 0.7985777258872986, 0.7990785837173462, 0.799579381942749, 0.8000801801681519, 0.8005809783935547, 0.8010817766189575, 0.8015825748443604, 0.8020833730697632, 0.802584171295166, 0.8030849695205688, 0.8035857677459717, 0.8040865659713745, 0.8045873641967773, 0.8050881624221802, 0.805588960647583, 0.8060897588729858, 0.8065905570983887, 0.8070913553237915, 0.8075922131538391, 0.8080930113792419, 0.8085938096046448, 0.8090946078300476, 0.8095954060554504, 0.8100962042808533, 0.8105970025062561, 0.8110978007316589, 0.8115985989570618, 0.8120993971824646, 0.8126001954078674, 0.8131009936332703, 0.8136017918586731, 0.8141025900840759, 0.8146033883094788, 0.8151041865348816, 0.8156049847602844, 0.8161057829856873, 0.8166066408157349, 0.8171074390411377, 0.8176082372665405, 0.8181090354919434, 0.8186098337173462, 0.819110631942749, 0.8196114301681519, 0.8201122283935547, 0.8206130266189575, 0.8211138248443604, 0.8216146230697632, 0.822115421295166, 0.8226162195205688, 0.8231170177459717, 0.8236178159713745, 0.8241186141967773, 0.8246194124221802, 0.8251202702522278, 0.8256210684776306, 0.8261218667030334, 0.8266226649284363, 0.8271234631538391, 0.8276242613792419, 0.8281250596046448, 0.8286258578300476, 0.8291266560554504, 0.8296274542808533, 0.8301282525062561, 0.8306290507316589, 0.8311298489570618, 0.8316306471824646, 0.8321314454078674, 0.8326322436332703, 0.8331330418586731, 0.8336338400840759, 0.8341346979141235, 0.8346354961395264, 0.8351362943649292, 0.835637092590332, 0.8361378908157349, 0.8366386890411377, 0.8371394872665405, 0.8376402854919434, 0.8381410837173462, 0.838641881942749, 0.8391426801681519, 0.8396434783935547, 0.8401442766189575, 0.8406450748443604, 0.8411458730697632, 0.841646671295166, 0.8421474695205688, 0.8426482677459717, 0.8431491255760193, 0.8436499238014221, 0.844150722026825, 0.8446515202522278, 0.8451523184776306, 0.8456531167030334, 0.8461539149284363, 0.8466547131538391, 0.8471555113792419, 0.8476563096046448, 0.8481571078300476, 0.8486579060554504, 0.8491587042808533, 0.8496595025062561, 0.8501603007316589, 0.8506610989570618, 0.8511618971824646, 0.8516627550125122, 0.852163553237915, 0.8526643514633179, 0.8531651496887207, 0.8536659479141235, 0.8541667461395264, 0.8546675443649292, 0.855168342590332, 0.8556691408157349, 0.8561699390411377, 0.8566707372665405, 0.8571715354919434, 0.8576723337173462, 0.858173131942749, 0.8586739301681519, 0.8591747283935547, 0.8596755266189575, 0.8601763248443604, 0.860677182674408, 0.8611779808998108, 0.8616787791252136, 0.8621795773506165, 0.8626803755760193, 0.8631811738014221, 0.863681972026825, 0.8641827702522278, 0.8646835684776306, 0.8651843667030334, 0.8656851649284363, 0.8661859631538391, 0.8666867613792419, 0.8671875596046448, 0.8676883578300476, 0.8681891560554504, 0.8686899542808533, 0.8691907525062561, 0.8696916103363037, 0.8701924085617065, 0.8706932067871094, 0.8711940050125122, 0.871694803237915, 0.8721956014633179, 0.8726963996887207, 0.8731971979141235, 0.8736979961395264, 0.8741987943649292, 0.874699592590332, 0.8752003908157349, 0.8757011890411377, 0.8762019872665405, 0.8767027854919434, 0.8772035837173462, 0.877704381942749, 0.8782052397727966, 0.8787060379981995, 0.8792068362236023, 0.8797076344490051, 0.880208432674408, 0.8807092308998108, 0.8812100291252136, 0.8817108273506165, 0.8822116255760193, 0.8827124238014221, 0.883213222026825, 0.8837140202522278, 0.8842148184776306, 0.8847156167030334, 0.8852164149284363, 0.8857172131538391, 0.8862180113792419, 0.8867188096046448, 0.8872196674346924, 0.8877204656600952, 0.888221263885498, 0.8887220621109009, 0.8892228603363037, 0.8897236585617065, 0.8902244567871094, 0.8907252550125122, 0.891226053237915, 0.8917268514633179, 0.8922276496887207, 0.8927284479141235, 0.8932292461395264, 0.8937300443649292, 0.894230842590332, 0.8947316408157349, 0.8952324390411377, 0.8957332372665405, 0.8962340950965881, 0.896734893321991, 0.8972356915473938, 0.8977364897727966, 0.8982372879981995, 0.8987380862236023, 0.8992388844490051, 0.899739682674408, 0.9002404808998108, 0.9007412791252136, 0.9012420773506165, 0.9017428755760193, 0.9022436738014221, 0.902744472026825, 0.9032452702522278, 0.9037460684776306, 0.9042468667030334, 0.904747724533081, 0.9052485227584839, 0.9057493209838867, 0.9062501192092896, 0.9067509174346924, 0.9072517156600952, 0.907752513885498, 0.9082533121109009, 0.9087541103363037, 0.9092549085617065, 0.9097557067871094, 0.9102565050125122, 0.910757303237915, 0.9112581014633179, 0.9117588996887207, 0.9122596979141235, 0.9127604961395264, 0.9132612943649292, 0.9137621521949768, 0.9142629504203796, 0.9147637486457825, 0.9152645468711853, 0.9157653450965881, 0.916266143321991, 0.9167669415473938, 0.9172677397727966, 0.9177685379981995, 0.9182693362236023, 0.9187701344490051, 0.919270932674408, 0.9197717308998108, 0.9202725291252136, 0.9207733273506165, 0.9212741255760193, 0.9217749238014221, 0.922275722026825, 0.9227765798568726, 0.9232773780822754, 0.9237781763076782, 0.924278974533081, 0.9247797727584839, 0.9252805709838867, 0.9257813692092896, 0.9262821674346924, 0.9267829656600952, 0.927283763885498, 0.9277845621109009, 0.9282853603363037, 0.9287861585617065, 0.9292869567871094, 0.9297877550125122, 0.930288553237915, 0.9307893514633179, 0.9312902092933655, 0.9317910075187683, 0.9322918057441711, 0.932792603969574, 0.9332934021949768, 0.9337942004203796, 0.9342949986457825, 0.9347957968711853, 0.9352965950965881, 0.935797393321991, 0.9362981915473938, 0.9367989897727966, 0.9372997879981995, 0.9378005862236023, 0.9383013844490051, 0.938802182674408, 0.9393029808998108, 0.9398037791252136, 0.9403046369552612, 0.9408054351806641, 0.9413062334060669, 0.9418070316314697, 0.9423078298568726, 0.9428086280822754, 0.9433094263076782, 0.943810224533081, 0.9443110227584839, 0.9448118209838867, 0.9453126192092896, 0.9458134174346924, 0.9463142156600952, 0.946815013885498, 0.9473158121109009, 0.9478166103363037, 0.9483174085617065, 0.9488182067871094, 0.949319064617157, 0.9498198628425598, 0.9503206610679626, 0.9508214592933655, 0.9513222575187683, 0.9518230557441711, 0.952323853969574, 0.9528246521949768, 0.9533254504203796, 0.9538262486457825, 0.9543270468711853, 0.9548278450965881, 0.955328643321991, 0.9558294415473938, 0.9563302397727966, 0.9568310379981995, 0.9573318362236023, 0.9578326940536499, 0.9583334922790527, 0.9588342905044556, 0.9593350887298584, 0.9598358869552612, 0.9603366851806641, 0.9608374834060669, 0.9613382816314697, 0.9618390798568726, 0.9623398780822754, 0.9628406763076782, 0.963341474533081, 0.9638422727584839, 0.9643430709838867, 0.9648438692092896, 0.9653446674346924, 0.9658454656600952, 0.966346263885498, 0.9668471217155457, 0.9673479199409485, 0.9678487181663513, 0.9683495163917542, 0.968850314617157, 0.9693511128425598, 0.9698519110679626, 0.9703527092933655, 0.9708535075187683, 0.9713543057441711, 0.971855103969574, 0.9723559021949768, 0.9728567004203796, 0.9733574986457825, 0.9738582968711853, 0.9743590950965881, 0.974859893321991, 0.9753607511520386, 0.9758615493774414, 0.9763623476028442, 0.9768631458282471, 0.9773639440536499, 0.9778647422790527, 0.9783655405044556, 0.9788663387298584, 0.9793671369552612, 0.9798679351806641, 0.9803687334060669, 0.9808695316314697, 0.9813703298568726, 0.9818711280822754, 0.9823719263076782, 0.982872724533081, 0.9833735227584839, 0.9838743209838867, 0.9843751788139343, 0.9848759770393372, 0.98537677526474, 0.9858775734901428, 0.9863783717155457, 0.9868791699409485, 0.9873799681663513, 0.9878807663917542, 0.988381564617157, 0.9888823628425598, 0.9893831610679626, 0.9898839592933655, 0.9903847575187683, 0.9908855557441711, 0.991386353969574, 0.9918871521949768, 0.9923879504203796, 0.9928887486457825, 0.9933896064758301, 0.9938904047012329, 0.9943912029266357, 0.9948920011520386, 0.9953927993774414, 0.9958935976028442, 0.9963943958282471, 0.9968951940536499, 0.9973959922790527, 0.9978967905044556, 0.9983975887298584, 0.9988983869552612, 0.9993991851806641, 0.9998999834060669], "expected": [1.0986123085021973, 1.1012849807739258, 1.1039612293243408, 1.106641173362732, 1.1093246936798096, 1.1120117902755737, 1.114702582359314, 1.1173970699310303, 1.1200952529907227, 1.1227973699569702, 1.1255030632019043, 1.128212332725525, 1.1309254169464111, 1.1336421966552734, 1.136362910270691, 1.1390873193740845, 1.1418156623840332, 1.144547700881958, 1.147283673286438, 1.1500235795974731, 1.1527674198150635, 1.1555150747299194, 1.1582666635513306, 1.1610223054885864, 1.1637818813323975, 1.1665453910827637, 1.1693130731582642, 1.172084927558899, 1.1748605966567993, 1.1776403188705444, 1.1804242134094238, 1.183212161064148, 1.1860042810440063, 1.1888004541397095, 1.1916009187698364, 1.194405436515808, 1.1972142457962036, 1.200027346611023, 1.2028447389602661, 1.2056663036346436, 1.2084921598434448, 1.21132230758667, 1.2141568660736084, 1.2169958353042603, 1.219839096069336, 1.2226872444152832, 1.2255393266677856, 1.228395938873291, 1.2312569618225098, 1.2341225147247314, 1.2369924783706665, 1.239867091178894, 1.242746353149414, 1.2456300258636475, 1.2485183477401733, 1.2514114379882812, 1.2543089389801025, 1.2572113275527954, 1.2601183652877808, 1.2630300521850586, 1.2659465074539185, 1.26886785030365, 1.2717941999435425, 1.274725079536438, 1.2776607275009155, 1.2806013822555542, 1.283546805381775, 1.2864972352981567, 1.2894525527954102, 1.2924128770828247, 1.2953782081604004, 1.2983485460281372, 1.3013238906860352, 1.3043043613433838, 1.3072898387908936, 1.3102805614471436, 1.3132764101028442, 1.3162775039672852, 1.3192836046218872, 1.322295069694519, 1.3253121376037598, 1.3283342123031616, 1.3313615322113037, 1.3343942165374756, 1.3374321460723877, 1.3404756784439087, 1.34352445602417, 1.34657883644104, 1.3496387004852295, 1.3527039289474487, 1.3557748794555664, 1.3588513135910034, 1.3619333505630493, 1.365020990371704, 1.3681143522262573, 1.371213436126709, 1.374318242073059, 1.3774287700653076, 1.3805454969406128, 1.3836675882339478, 1.3867955207824707, 1.3899294137954712, 1.3930692672729492, 1.3962149620056152, 1.3993667364120483, 1.4025243520736694, 1.4056881666183472, 1.408858060836792, 1.412034034729004, 1.415216088294983, 1.418404459953308, 1.4215989112854004, 1.4247997999191284, 1.4280067682266235, 1.4312200546264648, 1.4344402551651, 1.437666416168213, 1.4408988952636719, 1.4441379308700562, 1.4473834037780762, 1.4506354331970215, 1.453894019126892, 1.457159161567688, 1.4604310989379883, 1.4637097120285034, 1.4669948816299438, 1.4702869653701782, 1.473585844039917, 1.4768913984298706, 1.4802039861679077, 1.4835233688354492, 1.4868499040603638, 1.4901833534240723, 1.493524193763733, 1.4968717098236084, 1.500226378440857, 1.5035881996154785, 1.5069572925567627, 1.51033353805542, 1.5137171745300293, 1.5171079635620117, 1.5205062627792358, 1.5239120721817017, 1.52732515335083, 1.5307458639144897, 1.5341742038726807, 1.5376100540161133, 1.5410535335540771, 1.5445046424865723, 1.5479635000228882, 1.5514307022094727, 1.5549051761627197, 1.5583876371383667, 1.561877965927124, 1.5653762817382812, 1.568882703781128, 1.5723971128463745, 1.5759196281433105, 1.579450249671936, 1.58298921585083, 1.5865365266799927, 1.5900919437408447, 1.5936559438705444, 1.5972282886505127, 1.600809097290039, 1.604398488998413, 1.6079965829849243, 1.611603021621704, 1.6152188777923584, 1.6188429594039917, 1.6224758625030518, 1.6261175870895386, 1.6297682523727417, 1.6334278583526611, 1.637096643447876, 1.6407744884490967, 1.6444613933563232, 1.6481574773788452, 1.6518629789352417, 1.6555777788162231, 1.659301996231079, 1.66303551197052, 1.666778802871704, 1.6705315113067627, 1.674293875694275, 1.6780660152435303, 1.681848406791687, 1.6856400966644287, 1.6894416809082031, 1.6932532787322998, 1.6970748901367188, 1.7009066343307495, 1.7047486305236816, 1.7086007595062256, 1.7124632596969604, 1.7163361310958862, 1.7202194929122925, 1.7241133451461792, 1.728017807006836, 1.7319329977035522, 1.7358587980270386, 1.7397955656051636, 1.7437431812286377, 1.7477022409439087, 1.7516719102859497, 1.755652666091919, 1.759644627571106, 1.7636479139328003, 1.767662525177002, 1.7716885805130005, 1.7757261991500854, 1.7797755002975464, 1.7838364839553833, 1.7879091501235962, 1.7919937372207642, 1.7960902452468872, 1.8001987934112549, 1.8043195009231567, 1.8084524869918823, 1.812597632408142, 1.8167551755905151, 1.8209258317947388, 1.825108528137207, 1.8293038606643677, 1.8335120677947998, 1.8377330303192139, 1.841966986656189, 1.8462140560150146, 1.8504741191864014, 1.8547476530075073, 1.8590344190597534, 1.8633346557617188, 1.8676486015319824, 1.8719761371612549, 1.8763173818588257, 1.880672574043274, 1.8850417137145996, 1.8894249200820923, 1.8938225507736206, 1.8982347249984741, 1.9026610851287842, 1.9071018695831299, 1.9115573167800903, 1.9160276651382446, 1.9205126762390137, 1.9250129461288452, 1.9295282363891602, 1.9340589046478271, 1.9386048316955566, 1.9431663751602173, 1.947743535041809, 1.9523365497589111, 1.9569453001022339, 1.961570143699646, 1.966211199760437, 1.970868706703186, 1.9755429029464722, 1.9802333116531372, 1.9849404096603394, 1.9896644353866577, 1.9944055080413818, 1.9991636276245117, 2.003938913345337, 2.0087318420410156, 2.013542413711548, 2.0183706283569336, 2.023216724395752, 2.028080940246582, 2.032963514328003, 2.0378642082214355, 2.042783737182617, 2.0477218627929688, 2.0526788234710693, 2.057654857635498, 2.062650680541992, 2.0676653385162354, 2.072699546813965, 2.0777535438537598, 2.08282732963562, 2.087921619415283, 2.093035936355591, 2.098170757293701, 2.1033263206481934, 2.1085026264190674, 2.1137001514434814, 2.1189188957214355, 2.124159336090088, 2.1294212341308594, 2.134705066680908, 2.1400110721588135, 2.145339250564575, 2.1506900787353516, 2.156064033508301, 2.1614606380462646, 2.1668803691864014, 2.172323703765869, 2.177790641784668, 2.183281421661377, 2.188796281814575, 2.194335460662842, 2.199899435043335, 2.2054882049560547, 2.211102247238159, 2.2167415618896484, 2.2224066257476807, 2.228097677230835, 2.2338149547576904, 2.239558696746826, 2.2453291416168213, 2.251127243041992, 2.2569520473480225, 2.2628045082092285, 2.2686848640441895, 2.2745935916900635, 2.2805306911468506, 2.286496639251709, 2.292491912841797, 2.2985165119171143, 2.3045711517333984, 2.3106558322906494, 2.3167707920074463, 2.3229167461395264, 2.3290939331054688, 2.3353028297424316, 2.341543436050415, 2.347816228866577, 2.354121685028076, 2.3604612350463867, 2.366833209991455, 2.373239040374756, 2.379678964614868, 2.3861536979675293, 2.3926634788513184, 2.3992085456848145, 2.405789852142334, 2.412407159805298, 2.4190614223480225, 2.425753116607666, 2.4324822425842285, 2.4392495155334473, 2.4460556507110596, 2.4529008865356445, 2.4597856998443604, 2.4667108058929443, 2.4736764430999756, 2.480684280395508, 2.4877331256866455, 2.494824171066284, 2.501958131790161, 2.5091354846954346, 2.516356945037842, 2.523622989654541, 2.5309340953826904, 2.5382912158966064, 2.5456948280334473, 2.55314564704895, 2.5606443881988525, 2.5681912899017334, 2.5757875442504883, 2.5834336280822754, 2.591130256652832, 2.5988781452178955, 2.6066792011260986, 2.614532232284546, 2.622438669204712, 2.630399465560913, 2.638415813446045, 2.6464879512786865, 2.6546170711517334, 2.662804126739502, 2.6710498332977295, 2.6793551445007324, 2.687721014022827, 2.69614839553833, 2.7046384811401367, 2.7131917476654053, 2.7218096256256104, 2.7304933071136475, 2.739243507385254, 2.748061418533325, 2.7569494247436523, 2.765906572341919, 2.774935007095337, 2.7840359210968018, 2.793210506439209, 2.802460193634033, 2.811786413192749, 2.821190357208252, 2.8306734561920166, 2.8402369022369385, 2.8498826026916504, 2.859611988067627, 2.8694264888763428, 2.8793275356292725, 2.889317274093628, 2.8993966579437256, 2.9095683097839355, 2.9198334217071533, 2.9301950931549072, 2.940653085708618, 2.9512102603912354, 2.96186900138855, 2.9726309776306152, 2.9834985733032227, 2.994473934173584, 3.0055594444274902, 3.0167572498321533, 3.0280699729919434, 3.0395002365112305, 3.0510501861572266, 3.06272292137146, 3.074521064758301, 3.0864474773406982, 3.0985050201416016, 3.110697031021118, 3.123028039932251, 3.135498285293579, 3.1481125354766846, 3.160874843597412, 3.17378830909729, 3.186857223510742, 3.200085163116455, 3.2134764194488525, 3.2270352840423584, 3.2407658100128174, 3.2546732425689697, 3.2687618732452393, 3.283036947250366, 3.297503709793091, 3.312167167663574, 3.327033519744873, 3.3421084880828857, 3.35739803314209, 3.372910976409912, 3.3886497020721436, 3.404623508453369, 3.420839786529541, 3.4373059272766113, 3.4540305137634277, 3.471021890640259, 3.4882888793945312, 3.505841016769409, 3.5236880779266357, 3.5418407917022705, 3.560309648513794, 3.579106569290161, 3.5982437133789062, 3.617733955383301, 3.6375908851623535, 3.6578292846679688, 3.678466796875, 3.699514627456665, 3.7209928035736084, 3.742919921875, 3.765315055847168, 3.7881996631622314, 3.811595916748047, 3.8355281352996826, 3.8600213527679443, 3.885103940963745, 3.9108052253723145, 3.937157154083252, 3.9641942977905273, 3.9919543266296387, 4.020477294921875, 4.049807548522949, 4.079992771148682, 4.111085414886475, 4.143146514892578, 4.176231384277344, 4.210412979125977, 4.245768070220947, 4.282381057739258, 4.320346355438232, 4.359769821166992, 4.400768280029297, 4.443475723266602, 4.48804235458374, 4.534640312194824, 4.583465576171875, 4.634744167327881, 4.688738822937012, 4.74575662612915, 4.8061604499816895, 4.870381832122803, 4.938940525054932, 5.012479782104492, 5.091766357421875, 5.177794456481934, 5.271826267242432, 5.375516891479492, 5.491093158721924, 5.621654033660889, 5.771694660186768, 5.94809627532959, 6.162185192108154, 6.4346418380737305, 6.809877395629883, 7.416622638702393, 9.210074424743652]} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/medium.json b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/medium.json new file mode 100644 index 000000000000..db7c64bba01e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/medium.json @@ -0,0 +1 @@ +{"x": [0.25, 0.2510020136833191, 0.2520039975643158, 0.2530060112476349, 0.254008024930954, 0.2550100088119507, 0.2560120224952698, 0.25701403617858887, 0.25801602005958557, 0.25901803374290466, 0.26002004742622375, 0.26102203130722046, 0.26202404499053955, 0.26302605867385864, 0.26402804255485535, 0.26503005623817444, 0.26603206992149353, 0.26703405380249023, 0.2680360674858093, 0.2690380811691284, 0.2700400948524475, 0.2710420787334442, 0.2720440924167633, 0.2730461061000824, 0.2740480899810791, 0.2750501036643982, 0.2760521173477173, 0.277054101228714, 0.2780561149120331, 0.2790581285953522, 0.2800601124763489, 0.28106212615966797, 0.28206413984298706, 0.28306612372398376, 0.28406813740730286, 0.28507015109062195, 0.28607213497161865, 0.28707414865493774, 0.28807616233825684, 0.28907814621925354, 0.29008015990257263, 0.2910821735858917, 0.2920841574668884, 0.2930861711502075, 0.2940881848335266, 0.2950901687145233, 0.2960921823978424, 0.2970941960811615, 0.2980961799621582, 0.2990981936454773, 0.3001002073287964, 0.3011021912097931, 0.3021042048931122, 0.3031062185764313, 0.304108202457428, 0.30511021614074707, 0.30611222982406616, 0.30711421370506287, 0.30811622738838196, 0.30911824107170105, 0.31012025475502014, 0.31112223863601685, 0.31212425231933594, 0.31312626600265503, 0.31412824988365173, 0.3151302635669708, 0.3161322772502899, 0.3171342611312866, 0.3181362748146057, 0.3191382884979248, 0.3201402723789215, 0.3211422860622406, 0.3221442997455597, 0.3231462836265564, 0.3241482973098755, 0.3251503109931946, 0.3261522948741913, 0.3271543085575104, 0.32815632224082947, 0.32915830612182617, 0.33016031980514526, 0.33116233348846436, 0.33216431736946106, 0.33316633105278015, 0.33416834473609924, 0.33517032861709595, 0.33617234230041504, 0.33717435598373413, 0.33817633986473083, 0.3391783535480499, 0.340180367231369, 0.3411823511123657, 0.3421843647956848, 0.3431863784790039, 0.3441883623600006, 0.3451903760433197, 0.3461923897266388, 0.3471944034099579, 0.3481963872909546, 0.3491984009742737, 0.3502004146575928, 0.3512023985385895, 0.35220441222190857, 0.35320642590522766, 0.35420840978622437, 0.35521042346954346, 0.35621243715286255, 0.35721442103385925, 0.35821643471717834, 0.35921844840049744, 0.36022043228149414, 0.36122244596481323, 0.3622244596481323, 0.36322644352912903, 0.3642284572124481, 0.3652304708957672, 0.3662324547767639, 0.367234468460083, 0.3682364821434021, 0.3692384660243988, 0.3702404797077179, 0.371242493391037, 0.3722444772720337, 0.3732464909553528, 0.3742485046386719, 0.3752504885196686, 0.37625250220298767, 0.37725451588630676, 0.37825649976730347, 0.37925851345062256, 0.38026052713394165, 0.38126251101493835, 0.38226452469825745, 0.38326653838157654, 0.38426852226257324, 0.38527053594589233, 0.3862725496292114, 0.3872745633125305, 0.3882765471935272, 0.3892785608768463, 0.3902805745601654, 0.3912825584411621, 0.3922845721244812, 0.3932865858078003, 0.394288569688797, 0.3952905833721161, 0.3962925970554352, 0.3972945809364319, 0.398296594619751, 0.39929860830307007, 0.4003005921840668, 0.40130260586738586, 0.40230461955070496, 0.40330660343170166, 0.40430861711502075, 0.40531063079833984, 0.40631261467933655, 0.40731462836265564, 0.40831664204597473, 0.40931862592697144, 0.4103206396102905, 0.4113226532936096, 0.4123246371746063, 0.4133266508579254, 0.4143286645412445, 0.4153306484222412, 0.4163326621055603, 0.4173346757888794, 0.4183366596698761, 0.4193386733531952, 0.4203406870365143, 0.421342670917511, 0.4223446846008301, 0.42334669828414917, 0.42434871196746826, 0.42535069584846497, 0.42635270953178406, 0.42735472321510315, 0.42835670709609985, 0.42935872077941895, 0.43036073446273804, 0.43136271834373474, 0.43236473202705383, 0.4333667457103729, 0.43436872959136963, 0.4353707432746887, 0.4363727569580078, 0.4373747408390045, 0.4383767545223236, 0.4393787682056427, 0.4403807520866394, 0.4413827657699585, 0.4423847794532776, 0.4433867633342743, 0.4443887770175934, 0.4453907907009125, 0.4463927745819092, 0.44739478826522827, 0.44839680194854736, 0.44939878582954407, 0.45040079951286316, 0.45140281319618225, 0.45240479707717896, 0.45340681076049805, 0.45440882444381714, 0.45541080832481384, 0.45641282200813293, 0.457414835691452, 0.45841681957244873, 0.4594188332557678, 0.4604208469390869, 0.4614228308200836, 0.4624248445034027, 0.4634268581867218, 0.4644288718700409, 0.4654308557510376, 0.4664328694343567, 0.4674348831176758, 0.4684368669986725, 0.4694388806819916, 0.47044089436531067, 0.4714428782463074, 0.47244489192962646, 0.47344690561294556, 0.47444888949394226, 0.47545090317726135, 0.47645291686058044, 0.47745490074157715, 0.47845691442489624, 0.47945892810821533, 0.48046091198921204, 0.48146292567253113, 0.4824649393558502, 0.4834669232368469, 0.484468936920166, 0.4854709506034851, 0.4864729344844818, 0.4874749481678009, 0.48847696185112, 0.4894789457321167, 0.4904809594154358, 0.4914829730987549, 0.4924849569797516, 0.4934869706630707, 0.49448898434638977, 0.4954909682273865, 0.49649298191070557, 0.49749499559402466, 0.49849697947502136, 0.49949899315834045, 0.5005009770393372, 0.5015029907226562, 0.5025050044059753, 0.5035070180892944, 0.5045090317726135, 0.5055110454559326, 0.5065129995346069, 0.507515013217926, 0.5085170269012451, 0.5095190405845642, 0.5105210542678833, 0.5115230679512024, 0.5125250220298767, 0.5135270357131958, 0.5145290493965149, 0.515531063079834, 0.5165330767631531, 0.5175350904464722, 0.5185370445251465, 0.5195390582084656, 0.5205410718917847, 0.5215430855751038, 0.5225450992584229, 0.5235471129417419, 0.524549126625061, 0.5255510807037354, 0.5265530943870544, 0.5275551080703735, 0.5285571217536926, 0.5295591354370117, 0.5305611491203308, 0.5315631031990051, 0.5325651168823242, 0.5335671305656433, 0.5345691442489624, 0.5355711579322815, 0.5365731716156006, 0.5375751256942749, 0.538577139377594, 0.5395791530609131, 0.5405811667442322, 0.5415831804275513, 0.5425851941108704, 0.5435871481895447, 0.5445891618728638, 0.5455911755561829, 0.546593189239502, 0.547595202922821, 0.5485972166061401, 0.5495991706848145, 0.5506011843681335, 0.5516031980514526, 0.5526052117347717, 0.5536072254180908, 0.5546092391014099, 0.5556111931800842, 0.5566132068634033, 0.5576152205467224, 0.5586172342300415, 0.5596192479133606, 0.5606212615966797, 0.5616232752799988, 0.5626252293586731, 0.5636272430419922, 0.5646292567253113, 0.5656312704086304, 0.5666332840919495, 0.5676352977752686, 0.5686372518539429, 0.569639265537262, 0.570641279220581, 0.5716432929039001, 0.5726453065872192, 0.5736473202705383, 0.5746492743492126, 0.5756512880325317, 0.5766533017158508, 0.5776553153991699, 0.578657329082489, 0.5796593427658081, 0.5806612968444824, 0.5816633105278015, 0.5826653242111206, 0.5836673378944397, 0.5846693515777588, 0.5856713652610779, 0.5866733193397522, 0.5876753330230713, 0.5886773467063904, 0.5896793603897095, 0.5906813740730286, 0.5916833877563477, 0.592685341835022, 0.5936873555183411, 0.5946893692016602, 0.5956913828849792, 0.5966933965682983, 0.5976954102516174, 0.5986974239349365, 0.5996993780136108, 0.6007013916969299, 0.601703405380249, 0.6027054190635681, 0.6037074327468872, 0.6047094464302063, 0.6057114005088806, 0.6067134141921997, 0.6077154278755188, 0.6087174415588379, 0.609719455242157, 0.6107214689254761, 0.6117234230041504, 0.6127254366874695, 0.6137274503707886, 0.6147294640541077, 0.6157314777374268, 0.6167334914207458, 0.6177354454994202, 0.6187374591827393, 0.6197394728660583, 0.6207414865493774, 0.6217435002326965, 0.6227455139160156, 0.6237474679946899, 0.624749481678009, 0.6257514953613281, 0.6267535090446472, 0.6277555227279663, 0.6287575364112854, 0.6297594904899597, 0.6307615041732788, 0.6317635178565979, 0.632765531539917, 0.6337675452232361, 0.6347695589065552, 0.6357715725898743, 0.6367735266685486, 0.6377755403518677, 0.6387775540351868, 0.6397795677185059, 0.640781581401825, 0.641783595085144, 0.6427855491638184, 0.6437875628471375, 0.6447895765304565, 0.6457915902137756, 0.6467936038970947, 0.6477956175804138, 0.6487975716590881, 0.6497995853424072, 0.6508015990257263, 0.6518036127090454, 0.6528056263923645, 0.6538076400756836, 0.6548095941543579, 0.655811607837677, 0.6568136215209961, 0.6578156352043152, 0.6588176488876343, 0.6598196625709534, 0.6608216166496277, 0.6618236303329468, 0.6628256440162659, 0.663827657699585, 0.664829671382904, 0.6658316850662231, 0.6668336391448975, 0.6678356528282166, 0.6688376665115356, 0.6698396801948547, 0.6708416938781738, 0.6718437075614929, 0.6728456616401672, 0.6738476753234863, 0.6748496890068054, 0.6758517026901245, 0.6768537163734436, 0.6778557300567627, 0.6788577437400818, 0.6798596978187561, 0.6808617115020752, 0.6818637251853943, 0.6828657388687134, 0.6838677525520325, 0.6848697662353516, 0.6858717203140259, 0.686873733997345, 0.6878757476806641, 0.6888777613639832, 0.6898797750473022, 0.6908817887306213, 0.6918837428092957, 0.6928857564926147, 0.6938877701759338, 0.6948897838592529, 0.695891797542572, 0.6968938112258911, 0.6978957653045654, 0.6988977789878845, 0.6998997926712036, 0.7009018063545227, 0.7019038200378418, 0.7029058337211609, 0.7039077877998352, 0.7049098014831543, 0.7059118151664734, 0.7069138288497925, 0.7079158425331116, 0.7089178562164307, 0.709919810295105, 0.7109218239784241, 0.7119238376617432, 0.7129258513450623, 0.7139278650283813, 0.7149298787117004, 0.7159318923950195, 0.7169338464736938, 0.7179358601570129, 0.718937873840332, 0.7199398875236511, 0.7209419012069702, 0.7219439148902893, 0.7229458689689636, 0.7239478826522827, 0.7249498963356018, 0.7259519100189209, 0.72695392370224, 0.7279559373855591, 0.7289578914642334, 0.7299599051475525, 0.7309619188308716, 0.7319639325141907, 0.7329659461975098, 0.7339679598808289, 0.7349699139595032, 0.7359719276428223, 0.7369739413261414, 0.7379759550094604, 0.7389779686927795, 0.7399799823760986, 0.740981936454773, 0.741983950138092, 0.7429859638214111, 0.7439879775047302, 0.7449899911880493, 0.7459920048713684, 0.7469939589500427, 0.7479959726333618, 0.7489979863166809, 0.75], "expected": [-1.0986123085021973, -1.0932753086090088, -1.0879526138305664, -1.082643985748291, -1.0773489475250244, -1.0720679759979248, -1.0668004751205444, -1.0615464448928833, -1.056306004524231, -1.0510785579681396, -1.0458643436431885, -1.040663242340088, -1.0354750156402588, -1.030299425125122, -1.0251367092132568, -1.0199863910675049, -1.0148484706878662, -1.0097230672836304, -1.0046097040176392, -0.9995084404945374, -0.9944191575050354, -0.9893418550491333, -0.9842763543128967, -0.9792223572731018, -0.9741801619529724, -0.9691492319107056, -0.9641297459602356, -0.9591216444969177, -0.9541244506835938, -0.9491384625434875, -0.94416344165802, -0.9391992688179016, -0.934245765209198, -0.9293030500411987, -0.9243709444999695, -0.9194490909576416, -0.9145379662513733, -0.9096368551254272, -0.9047460556030273, -0.8998655080795288, -0.8949947357177734, -0.8901340365409851, -0.8852832317352295, -0.8804421424865723, -0.8756106495857239, -0.8707888722419739, -0.8659765720367432, -0.8611736297607422, -0.8563801646232605, -0.8515958786010742, -0.8468207120895386, -0.8420548439025879, -0.8372977375984192, -0.8325497508049011, -0.8278105854988098, -0.8230801820755005, -0.8183584213256836, -0.8136454224586487, -0.8089410066604614, -0.8042448163032532, -0.7995572090148926, -0.7948779463768005, -0.7902069091796875, -0.7855439782142639, -0.7808892726898193, -0.7762425541877747, -0.7716037034988403, -0.7669730186462402, -0.7623499631881714, -0.7577347159385681, -0.7531273365020752, -0.7485272288322449, -0.7439349293708801, -0.7393500804901123, -0.7347725629806519, -0.7302023768424988, -0.7256396412849426, -0.7210840582847595, -0.7165355682373047, -0.7119943499565125, -0.7074600458145142, -0.7029327154159546, -0.6984124183654785, -0.6938987374305725, -0.6893919706344604, -0.6848919987678528, -0.6803986430168152, -0.6759117841720581, -0.6714316010475159, -0.6669579744338989, -0.6624905467033386, -0.6580297350883484, -0.6535750031471252, -0.6491265892982483, -0.6446845531463623, -0.6402483582496643, -0.6358184814453125, -0.6313945055007935, -0.6269766688346863, -0.6225645542144775, -0.6181584000587463, -0.6137581467628479, -0.6093633770942688, -0.6049745082855225, -0.6005913615226746, -0.596213698387146, -0.5918415188789368, -0.5874748826026917, -0.5831137895584106, -0.5787578821182251, -0.5744075179100037, -0.5700623393058777, -0.5657222867012024, -0.5613877177238464, -0.5570579171180725, -0.5527334213256836, -0.5484139919281006, -0.5440993905067444, -0.5397897362709045, -0.5354852080345154, -0.5311853885650635, -0.5268900990486145, -0.522599995136261, -0.5183142423629761, -0.5140332579612732, -0.5097570419311523, -0.5054851174354553, -0.5012179017066956, -0.4969550669193268, -0.4926966428756714, -0.488442599773407, -0.48419293761253357, -0.479947566986084, -0.4757062494754791, -0.47146934270858765, -0.4672364592552185, -0.46300768852233887, -0.45878303050994873, -0.4545624554157257, -0.45034587383270264, -0.4461328983306885, -0.44192418456077576, -0.4377191662788391, -0.4335179626941681, -0.42932069301605225, -0.4251268208026886, -0.42093685269355774, -0.4167505204677582, -0.41256770491600037, -0.4083884060382843, -0.40421274304389954, -0.40004056692123413, -0.395871639251709, -0.39170628786087036, -0.3875442445278168, -0.38338544964790344, -0.3792301118373871, -0.3750776946544647, -0.37092867493629456, -0.36678287386894226, -0.3626400828361511, -0.35850027203559875, -0.3543636202812195, -0.35023003816604614, -0.3460991382598877, -0.3419714868068695, -0.3378466069698334, -0.3337244987487793, -0.3296053409576416, -0.32548877596855164, -0.3213750422000885, -0.31726399064064026, -0.3131555914878845, -0.3090497851371765, -0.30494657158851624, -0.3008459806442261, -0.29674774408340454, -0.29265207052230835, -0.28855887055397034, -0.28446802496910095, -0.2803795039653778, -0.27629339694976807, -0.2722095847129822, -0.2681278884410858, -0.26404857635498047, -0.25997141003608704, -0.25589630007743835, -0.2518234848976135, -0.24775250256061554, -0.24368374049663544, -0.23961693048477173, -0.23555202782154083, -0.23148909211158752, -0.227428138256073, -0.22336909174919128, -0.21931160986423492, -0.2152562439441681, -0.211202472448349, -0.207150399684906, -0.20310021936893463, -0.1990513950586319, -0.195004403591156, -0.19095900654792786, -0.18691504001617432, -0.18287262320518494, -0.1788317859172821, -0.17479245364665985, -0.1707543134689331, -0.16671784222126007, -0.16268251836299896, -0.1586485207080841, -0.15461599826812744, -0.15058448910713196, -0.1465543955564499, -0.14252522587776184, -0.13849756121635437, -0.13447079062461853, -0.13044509291648865, -0.12642066180706024, -0.12239699810743332, -0.11837449669837952, -0.11435294151306152, -0.11033225059509277, -0.10631241649389267, -0.10229349136352539, -0.09827546030282974, -0.09425798803567886, -0.09024158865213394, -0.086225725710392, -0.08221052587032318, -0.07819623500108719, -0.07418227195739746, -0.07016906887292862, -0.06615643203258514, -0.06214423477649689, -0.0581325888633728, -0.054121434688568115, -0.05011076107621193, -0.046100255101919174, -0.042090412229299545, -0.03808073699474335, -0.034071408212184906, -0.030062485486268997, -0.026053544133901596, -0.022045010700821877, -0.01803664304316044, -0.014028319157660007, -0.010020103305578232, -0.006012058351188898, -0.0020040671806782484, 0.002003925619646907, 0.006011974532157183, 0.010020074434578419, 0.01402827724814415, 0.01803663559257984, 0.022045083343982697, 0.02605343982577324, 0.03006233461201191, 0.03407135605812073, 0.03808077424764633, 0.042090415954589844, 0.0461004339158535, 0.05011054128408432, 0.054121341556310654, 0.05813254043459892, 0.06214429810643196, 0.06615642458200455, 0.07016918808221817, 0.0741821825504303, 0.07819601148366928, 0.08221058547496796, 0.08622574061155319, 0.09024160355329514, 0.09425821900367737, 0.09827551990747452, 0.10229342430830002, 0.10631240159273148, 0.11033226549625397, 0.11435294151306152, 0.11837456375360489, 0.12239716202020645, 0.12642055749893188, 0.13044510781764984, 0.13447080552577972, 0.1384975016117096, 0.14252541959285736, 0.14655445516109467, 0.1505843698978424, 0.1546158641576767, 0.1586485654115677, 0.16268250346183777, 0.1667177826166153, 0.17075443267822266, 0.17479227483272552, 0.17883172631263733, 0.1828726828098297, 0.1869150847196579, 0.19095894694328308, 0.19500446319580078, 0.19905127584934235, 0.2031000554561615, 0.20715034008026123, 0.2112024426460266, 0.21525625884532928, 0.21931178867816925, 0.22336888313293457, 0.22742809355258942, 0.2314891368150711, 0.23555204272270203, 0.2396169751882553, 0.24368377029895782, 0.2477526068687439, 0.2518233060836792, 0.25589632987976074, 0.25997141003608704, 0.26404860615730286, 0.26812803745269775, 0.27220970392227173, 0.2762933075428009, 0.2803794741630554, 0.28446802496910095, 0.2885589003562927, 0.2926521897315979, 0.2967478632926941, 0.30084583163261414, 0.30494654178619385, 0.3090497851371765, 0.3131555914878845, 0.31726405024528503, 0.32137516140937805, 0.3254886269569397, 0.32960522174835205, 0.3337244987487793, 0.3378466069698334, 0.3419715166091919, 0.3460994064807892, 0.3502298593521118, 0.3543635904788971, 0.35850027203559875, 0.36263999342918396, 0.3667828142642975, 0.3709287941455841, 0.37507760524749756, 0.37922996282577515, 0.38338541984558105, 0.3875442445278168, 0.39170631766319275, 0.39587175846099854, 0.4000406265258789, 0.40421271324157715, 0.4083884656429291, 0.412567675113678, 0.41675055027008057, 0.4209369719028473, 0.4251269996166229, 0.42932048439979553, 0.4335179328918457, 0.4377192258834839, 0.4419242739677429, 0.4461331367492676, 0.45034584403038025, 0.45456233620643616, 0.45878300070762634, 0.46300771832466125, 0.4672364592552185, 0.47146937251091003, 0.47570642828941345, 0.47994735836982727, 0.48419278860092163, 0.4884425699710846, 0.492696613073349, 0.49695509672164917, 0.5012179613113403, 0.5054850578308105, 0.509756863117218, 0.514033317565918, 0.5183143019676208, 0.5225999355316162, 0.5268903374671936, 0.5311852097511292, 0.535485029220581, 0.5397897958755493, 0.5440994501113892, 0.5484139323234558, 0.5527335405349731, 0.5570580959320068, 0.5613874793052673, 0.5657223463058472, 0.5700623393058777, 0.5744075775146484, 0.5787580013275146, 0.5831138491630554, 0.5874748826026917, 0.5918415188789368, 0.596213698387146, 0.6005913615226746, 0.6049746870994568, 0.6093636155128479, 0.6137579679489136, 0.6181583404541016, 0.6225646138191223, 0.6269766688346863, 0.631394624710083, 0.635818600654602, 0.6402483582496643, 0.6446844339370728, 0.6491265892982483, 0.6535750031471252, 0.6580297350883484, 0.6624906659126282, 0.6669577360153198, 0.6714315414428711, 0.6759117841720581, 0.6803985834121704, 0.6848920583724976, 0.6893921494483948, 0.693898618221283, 0.6984122395515442, 0.7029327154159546, 0.7074599862098694, 0.7119943499565125, 0.716535747051239, 0.7210839986801147, 0.7256395220756531, 0.7302024364471436, 0.7347725033760071, 0.7393500804901123, 0.7439349293708801, 0.748527467250824, 0.7531271576881409, 0.7577347159385681, 0.7623499631881714, 0.7669730186462402, 0.7716038823127747, 0.776242733001709, 0.7808891534805298, 0.7855439782142639, 0.790206789970398, 0.7948779463768005, 0.7995573282241821, 0.8042449951171875, 0.8089407682418823, 0.8136453628540039, 0.8183583617210388, 0.8230801820755005, 0.8278106451034546, 0.8325498700141907, 0.8372976779937744, 0.8420546650886536, 0.8468207120895386, 0.8515958189964294, 0.8563801646232605, 0.8611738085746765, 0.8659764528274536, 0.8707888126373291, 0.8756106495857239, 0.8804421424865723, 0.8852832317352295, 0.8901340961456299, 0.8949946165084839, 0.8998653292655945, 0.9047459959983826, 0.909636914730072, 0.9145379662513733, 0.9194492697715759, 0.9243710041046143, 0.929302990436554, 0.9342457056045532, 0.9391991496086121, 0.94416344165802, 0.9491385817527771, 0.9541245698928833, 0.9591214060783386, 0.9641297459602356, 0.9691492319107056, 0.9741802215576172, 0.9792225360870361, 0.9842764735221863, 0.9893417954444885, 0.9944191575050354, 0.9995084404945374, 1.0046097040176392, 1.0097230672836304, 1.0148485898971558, 1.0199862718582153, 1.0251365900039673, 1.030299425125122, 1.0354750156402588, 1.0406633615493774, 1.0458645820617676, 1.05107843875885, 1.0563057661056519, 1.0615464448928833, 1.0668004751205444, 1.0720679759979248, 1.0773491859436035, 1.082643747329712, 1.0879524946212769, 1.0932753086090088, 1.0986123085021973]} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/runner.py new file mode 100644 index 000000000000..b357fdba0d57 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/runner.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python +# +# @license Apache-2.0 +# +# Copyright (c) 2018 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. + +"""Generate fixtures.""" + +import os +import json +import numpy as np +from scipy.special import logit + +# Get the file path: +FILE = os.path.realpath(__file__) + +# Extract the directory in which this file resides: +DIR = os.path.dirname(FILE) + + +def gen(x, name): + """Generate fixture data and writes them to file. + + # Arguments + + * `x`: domain + * `name::str`: output filename + + # Examples + + ``` python + python> x = linspace(0.0, 1.0, 2001) + python> gen(x, './data.json') + ``` + """ + x = x.astype(np.float32) + y = logit(x).astype(np.float32) + + # Store data to be written to file as a dictionary: + data = { + "x": x.tolist(), + "expected": y.tolist() + } + + # Based on the script directory, create an output filepath: + filepath = os.path.join(DIR, name) + + # Write the data to the output filepath as JSON: + with open(filepath, "w", encoding="utf-8") as outfile: + json.dump(data, outfile) + + +def main(): + """Generate fixture data.""" + x = np.linspace(0.0001, 0.25, 500) + gen(x, "small.json") + + x = np.linspace(0.25, 0.75, 500) + gen(x, "medium.json") + + x = np.linspace(0.75, 0.9999, 500) + gen(x, "large.json") + + +if __name__ == "__main__": + main() diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/small.json b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/small.json new file mode 100644 index 000000000000..759b8db2ec09 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/test/fixtures/python/small.json @@ -0,0 +1 @@ +{"x": [9.999999747378752e-05, 0.0006008016061969101, 0.0011016031494364142, 0.001602404867298901, 0.002103206468746066, 0.0026040079537779093, 0.003104809671640396, 0.0036056111566722393, 0.0041064126417040825, 0.004607214592397213, 0.005108016077429056, 0.005608817562460899, 0.0061096190474927425, 0.006610420998185873, 0.007111222483217716, 0.007612023968249559, 0.008112825453281403, 0.008613627403974533, 0.009114428423345089, 0.00961523037403822, 0.01011603232473135, 0.010616833344101906, 0.011117635294795036, 0.011618437245488167, 0.012119238264858723, 0.012620040215551853, 0.013120841234922409, 0.01362164318561554, 0.01412244513630867, 0.014623246155679226, 0.015124048106372356, 0.015624850057065487, 0.016125651076436043, 0.016626453027129173, 0.017127254977822304, 0.017628056928515434, 0.018128857016563416, 0.018629658967256546, 0.019130460917949677, 0.019631262868642807, 0.020132064819335938, 0.02063286490738392, 0.02113366685807705, 0.02163446880877018, 0.02213527075946331, 0.02263607271015644, 0.02313687466084957, 0.023637674748897552, 0.024138476699590683, 0.024639278650283813, 0.025140080600976944, 0.025640882551670074, 0.026141682639718056, 0.026642484590411186, 0.027143286541104317, 0.027644088491797447, 0.028144890442490578, 0.02864569053053856, 0.02914649248123169, 0.02964729443192482, 0.03014809638261795, 0.03064889833331108, 0.03114970028400421, 0.03165050223469734, 0.03215130418539047, 0.032652102410793304, 0.033152904361486435, 0.033653706312179565, 0.034154508262872696, 0.034655310213565826, 0.03515611216425896, 0.03565691411495209, 0.03615771606564522, 0.03665851801633835, 0.03715931996703148, 0.03766012191772461, 0.03816092014312744, 0.03866172209382057, 0.0391625240445137, 0.03966332599520683, 0.04016412794589996, 0.040664929896593094, 0.041165731847286224, 0.041666533797979355, 0.042167335748672485, 0.042668137699365616, 0.043168939650058746, 0.04366973787546158, 0.04417053982615471, 0.04467134177684784, 0.04517214372754097, 0.0456729456782341, 0.04617374762892723, 0.04667454957962036, 0.04717535153031349, 0.04767615348100662, 0.04817695543169975, 0.048677753657102585, 0.049178555607795715, 0.049679357558488846, 0.050180159509181976, 0.05068096145987511, 0.05118176341056824, 0.05168256536126137, 0.0521833673119545, 0.05268416926264763, 0.05318497121334076, 0.05368577316403389, 0.05418657138943672, 0.05468737334012985, 0.05518817529082298, 0.05568897724151611, 0.056189779192209244, 0.056690581142902374, 0.057191383093595505, 0.057692185044288635, 0.058192986994981766, 0.058693788945674896, 0.05919459089636803, 0.05969538912177086, 0.06019619107246399, 0.06069699302315712, 0.06119779497385025, 0.06169859692454338, 0.06219939887523651, 0.06270019710063934, 0.06320100277662277, 0.0637018010020256, 0.06420260667800903, 0.06470340490341187, 0.0652042105793953, 0.06570500880479813, 0.06620581448078156, 0.06670661270618439, 0.06720741838216782, 0.06770821660757065, 0.06820901483297348, 0.06870982050895691, 0.06921061873435974, 0.06971142441034317, 0.070212222635746, 0.07071302831172943, 0.07121382653713226, 0.07171463221311569, 0.07221543043851852, 0.07271623611450195, 0.07321703433990479, 0.07371783256530762, 0.07421863824129105, 0.07471943646669388, 0.07522024214267731, 0.07572104036808014, 0.07622184604406357, 0.0767226442694664, 0.07722344994544983, 0.07772424817085266, 0.0782250463962555, 0.07872585207223892, 0.07922665029764175, 0.07972745597362518, 0.08022825419902802, 0.08072905987501144, 0.08122985810041428, 0.0817306637763977, 0.08223146200180054, 0.08273226767778397, 0.0832330659031868, 0.08373386412858963, 0.08423466980457306, 0.08473546802997589, 0.08523627370595932, 0.08573707193136215, 0.08623787760734558, 0.08673867583274841, 0.08723948150873184, 0.08774027973413467, 0.0882410854101181, 0.08874188363552094, 0.08924268186092377, 0.0897434875369072, 0.09024428576231003, 0.09074509143829346, 0.09124588966369629, 0.09174669533967972, 0.09224749356508255, 0.09274829924106598, 0.09324909746646881, 0.09374990314245224, 0.09425070136785507, 0.0947514995932579, 0.09525230526924133, 0.09575310349464417, 0.0962539091706276, 0.09675470739603043, 0.09725551307201385, 0.09775631129741669, 0.09825711697340012, 0.09875791519880295, 0.09925872087478638, 0.09975951910018921, 0.10026031732559204, 0.10076112300157547, 0.1012619212269783, 0.10176272690296173, 0.10226352512836456, 0.10276433080434799, 0.10326512902975082, 0.10376593470573425, 0.10426673293113708, 0.10476753860712051, 0.10526833683252335, 0.10576913505792618, 0.1062699407339096, 0.10677073895931244, 0.10727154463529587, 0.1077723428606987, 0.10827314853668213, 0.10877394676208496, 0.10927475243806839, 0.10977555066347122, 0.11027635633945465, 0.11077715456485748, 0.11127795279026031, 0.11177875846624374, 0.11227955669164658, 0.11278036236763, 0.11328116059303284, 0.11378196626901627, 0.1142827644944191, 0.11478357017040253, 0.11528436839580536, 0.11578516662120819, 0.11628597229719162, 0.11678677052259445, 0.11728757619857788, 0.11778837442398071, 0.11828918009996414, 0.11878997832536697, 0.1192907840013504, 0.11979158222675323, 0.12029238790273666, 0.1207931861281395, 0.12129398435354233, 0.12179479002952576, 0.12229558825492859, 0.12279639393091202, 0.12329719215631485, 0.12379799783229828, 0.12429879605770111, 0.12479960173368454, 0.12530040740966797, 0.1258012056350708, 0.12630200386047363, 0.12680280208587646, 0.1273036003112793, 0.12780441343784332, 0.12830521166324615, 0.128806009888649, 0.12930680811405182, 0.12980762124061584, 0.13030841946601868, 0.1308092176914215, 0.13131001591682434, 0.13181082904338837, 0.1323116272687912, 0.13281242549419403, 0.13331322371959686, 0.1338140219449997, 0.13431483507156372, 0.13481563329696655, 0.13531643152236938, 0.13581722974777222, 0.13631804287433624, 0.13681884109973907, 0.1373196393251419, 0.13782043755054474, 0.13832123577594757, 0.1388220489025116, 0.13932284712791443, 0.13982364535331726, 0.1403244435787201, 0.14082525670528412, 0.14132605493068695, 0.14182685315608978, 0.14232765138149261, 0.14282844960689545, 0.14332926273345947, 0.1438300609588623, 0.14433085918426514, 0.14483165740966797, 0.145332470536232, 0.14583326876163483, 0.14633406698703766, 0.1468348652124405, 0.14733567833900452, 0.14783647656440735, 0.14833727478981018, 0.148838073015213, 0.14933887124061584, 0.14983968436717987, 0.1503404825925827, 0.15084128081798553, 0.15134207904338837, 0.1518428921699524, 0.15234369039535522, 0.15284448862075806, 0.1533452868461609, 0.15384608507156372, 0.15434689819812775, 0.15484769642353058, 0.1553484946489334, 0.15584929287433624, 0.15635010600090027, 0.1568509042263031, 0.15735170245170593, 0.15785250067710876, 0.1583533138036728, 0.15885411202907562, 0.15935491025447845, 0.1598557084798813, 0.16035650670528412, 0.16085731983184814, 0.16135811805725098, 0.1618589162826538, 0.16235971450805664, 0.16286052763462067, 0.1633613258600235, 0.16386212408542633, 0.16436292231082916, 0.164863720536232, 0.16536453366279602, 0.16586533188819885, 0.16636613011360168, 0.16686692833900452, 0.16736774146556854, 0.16786853969097137, 0.1683693379163742, 0.16887013614177704, 0.16937094926834106, 0.1698717474937439, 0.17037254571914673, 0.17087334394454956, 0.1713741421699524, 0.17187495529651642, 0.17237575352191925, 0.17287655174732208, 0.17337734997272491, 0.17387816309928894, 0.17437896132469177, 0.1748797595500946, 0.17538055777549744, 0.17588135600090027, 0.1763821691274643, 0.17688296735286713, 0.17738376557826996, 0.1778845638036728, 0.17838537693023682, 0.17888617515563965, 0.17938697338104248, 0.1798877716064453, 0.18038856983184814, 0.18088938295841217, 0.181390181183815, 0.18189097940921783, 0.18239177763462067, 0.1828925907611847, 0.18339338898658752, 0.18389418721199036, 0.1843949854373932, 0.18489579856395721, 0.18539659678936005, 0.18589739501476288, 0.1863981932401657, 0.18689899146556854, 0.18739980459213257, 0.1879006028175354, 0.18840140104293823, 0.18890219926834106, 0.1894030123949051, 0.18990381062030792, 0.19040460884571075, 0.1909054070711136, 0.19140620529651642, 0.19190701842308044, 0.19240781664848328, 0.1929086148738861, 0.19340941309928894, 0.19391022622585297, 0.1944110244512558, 0.19491182267665863, 0.19541262090206146, 0.1959134340286255, 0.19641423225402832, 0.19691503047943115, 0.19741582870483398, 0.19791662693023682, 0.19841744005680084, 0.19891823828220367, 0.1994190365076065, 0.19991983473300934, 0.20042064785957336, 0.2009214460849762, 0.20142224431037903, 0.20192304253578186, 0.2024238407611847, 0.20292465388774872, 0.20342545211315155, 0.20392625033855438, 0.20442704856395721, 0.20492786169052124, 0.20542865991592407, 0.2059294581413269, 0.20643025636672974, 0.20693106949329376, 0.2074318677186966, 0.20793266594409943, 0.20843346416950226, 0.2089342623949051, 0.20943507552146912, 0.20993587374687195, 0.21043667197227478, 0.2109374701976776, 0.21143828332424164, 0.21193908154964447, 0.2124398797750473, 0.21294067800045013, 0.21344147622585297, 0.213942289352417, 0.21444308757781982, 0.21494388580322266, 0.2154446840286255, 0.21594549715518951, 0.21644629538059235, 0.21694709360599518, 0.217447891831398, 0.21794869005680084, 0.21844950318336487, 0.2189503014087677, 0.21945109963417053, 0.21995189785957336, 0.2204527109861374, 0.22095350921154022, 0.22145430743694305, 0.2219551056623459, 0.2224559187889099, 0.22295671701431274, 0.22345751523971558, 0.2239583134651184, 0.22445911169052124, 0.22495992481708527, 0.2254607230424881, 0.22596152126789093, 0.22646231949329376, 0.2269631326198578, 0.22746393084526062, 0.22796472907066345, 0.22846552729606628, 0.22896632552146912, 0.22946713864803314, 0.22996793687343597, 0.2304687350988388, 0.23096953332424164, 0.23147034645080566, 0.2319711446762085, 0.23247194290161133, 0.23297274112701416, 0.23347355425357819, 0.23397435247898102, 0.23447515070438385, 0.23497594892978668, 0.23547674715518951, 0.23597756028175354, 0.23647835850715637, 0.2369791567325592, 0.23747995495796204, 0.23798076808452606, 0.2384815663099289, 0.23898236453533173, 0.23948316276073456, 0.2399839609861374, 0.24048477411270142, 0.24098557233810425, 0.24148637056350708, 0.2419871687889099, 0.24248798191547394, 0.24298878014087677, 0.2434895783662796, 0.24399037659168243, 0.24449118971824646, 0.2449919879436493, 0.24549278616905212, 0.24599358439445496, 0.2464943826198578, 0.24699519574642181, 0.24749599397182465, 0.24799679219722748, 0.2484975904226303, 0.24899840354919434, 0.24949920177459717, 0.25], "expected": [-9.210240364074707, -7.41664457321167, -6.809886455535889, -6.434646129608154, -6.162186622619629, -5.94809627532959, -5.771693229675293, -5.621652126312256, -5.491090774536133, -5.375514030456543, -5.271822929382324, -5.177790641784668, -5.091762542724609, -5.012475490570068, -4.938944339752197, -4.87038516998291, -4.806163311004639, -4.745759010314941, -4.688740253448486, -4.634745121002197, -4.583466053009033, -4.534640789031982, -4.488042831420898, -4.443475723266602, -4.400767803192139, -4.359768867492676, -4.320345878601074, -4.282380104064941, -4.245766639709473, -4.210411548614502, -4.176229476928711, -4.143144607543945, -4.111086845397949, -4.079994201660156, -4.049808502197266, -4.020478248596191, -3.991955041885376, -3.9641950130462646, -3.93715763092041, -3.9108054637908936, -3.885103940963745, -3.8600213527679443, -3.8355276584625244, -3.8115954399108887, -3.7881991863250732, -3.7653143405914307, -3.7429189682006836, -3.720991849899292, -3.6995136737823486, -3.6784656047821045, -3.657830238342285, -3.63759183883667, -3.617734670639038, -3.5982444286346436, -3.5791070461273193, -3.560309886932373, -3.5418407917022705, -3.523688316345215, -3.505841016769409, -3.488288640975952, -3.4710216522216797, -3.4540300369262695, -3.437305450439453, -3.4208390712738037, -3.404622793197632, -3.3886489868164062, -3.3729100227355957, -3.3573989868164062, -3.342109203338623, -3.3270342350006104, -3.3121678829193115, -3.29750394821167, -3.2830371856689453, -3.2687621116638184, -3.2546732425689697, -3.2407658100128174, -3.2270352840423584, -3.2134764194488525, -3.200084924697876, -3.186856985092163, -3.173788070678711, -3.160874366760254, -3.1481120586395264, -3.135497570037842, -3.1230273246765137, -3.1106977462768555, -3.0985054969787598, -3.0864479541778564, -3.074521541595459, -3.062723159790039, -3.0510504245758057, -3.0395002365112305, -3.0280702114105225, -3.0167572498321533, -3.0055594444274902, -2.994473934173584, -2.9834983348846436, -2.972630739212036, -2.9618687629699707, -2.9512100219726562, -2.94065260887146, -2.930194616317749, -2.9198338985443115, -2.9095687866210938, -2.899397134780884, -2.889317512512207, -2.8793277740478516, -2.869426727294922, -2.859612226486206, -2.8498828411102295, -2.8402371406555176, -2.8306734561920166, -2.821190118789673, -2.81178617477417, -2.802460193634033, -2.79321026802063, -2.7840354442596436, -2.7749345302581787, -2.7659060955047607, -2.7569491863250732, -2.7480621337890625, -2.739243984222412, -2.7304935455322266, -2.7218101024627686, -2.7131919860839844, -2.704638719558716, -2.696148633956909, -2.6877212524414062, -2.6793551445007324, -2.6710498332977295, -2.662804126739502, -2.6546170711517334, -2.6464877128601074, -2.638415575027466, -2.630399227142334, -2.622438430786133, -2.6145317554473877, -2.6066787242889404, -2.5988786220550537, -2.591130495071411, -2.5834338665008545, -2.5757877826690674, -2.5681915283203125, -2.5606443881988525, -2.5531458854675293, -2.5456948280334473, -2.5382914543151855, -2.5309340953826904, -2.523622751235962, -2.5163567066192627, -2.5091352462768555, -2.501957893371582, -2.494823932647705, -2.4877328872680664, -2.4806840419769287, -2.473676919937134, -2.4667112827301025, -2.4597859382629395, -2.4529011249542236, -2.4460558891296387, -2.4392497539520264, -2.4324822425842285, -2.425753116607666, -2.4190614223480225, -2.412407159805298, -2.405789613723755, -2.3992085456848145, -2.3926634788513184, -2.38615345954895, -2.379678964614868, -2.3732388019561768, -2.366832971572876, -2.3604607582092285, -2.3541221618652344, -2.3478164672851562, -2.341543674468994, -2.3353028297424316, -2.329094171524048, -2.3229169845581055, -2.3167710304260254, -2.3106558322906494, -2.3045711517333984, -2.2985167503356934, -2.292491912841797, -2.286496639251709, -2.2805304527282715, -2.2745933532714844, -2.2686846256256104, -2.2628042697906494, -2.2569518089294434, -2.251127004623413, -2.2453293800354004, -2.239558696746826, -2.2338151931762695, -2.228097915649414, -2.2224068641662598, -2.2167418003082275, -2.211102247238159, -2.2054882049560547, -2.199899435043335, -2.194335460662842, -2.188796043395996, -2.183281183242798, -2.177790403366089, -2.17232346534729, -2.1668803691864014, -2.1614606380462646, -2.1560637950897217, -2.1506903171539307, -2.1453394889831543, -2.1400110721588135, -2.1347053050994873, -2.1294212341308594, -2.124159336090088, -2.1189188957214355, -2.1137001514434814, -2.1085026264190674, -2.1033263206481934, -2.098170757293701, -2.093035936355591, -2.087921380996704, -2.08282732963562, -2.0777533054351807, -2.0726993083953857, -2.0676651000976562, -2.062650442123413, -2.057655096054077, -2.0526790618896484, -2.0477218627929688, -2.042783737182617, -2.0378644466400146, -2.032963514328003, -2.028080940246582, -2.023216962814331, -2.0183706283569336, -2.013542413711548, -2.0087318420410156, -2.003938913345337, -1.9991635084152222, -1.9944052696228027, -1.9896643161773682, -1.9849402904510498, -1.9802331924438477, -1.975542664527893, -1.9708689451217651, -1.9662114381790161, -1.961570382118225, -1.9569454193115234, -1.9523365497589111, -1.9477436542510986, -1.9431663751602173, -1.9386048316955566, -1.9340589046478271, -1.9295282363891602, -1.9250129461288452, -1.9205126762390137, -1.9160274267196655, -1.9115571975708008, -1.9071017503738403, -1.902660846710205, -1.8982346057891846, -1.8938227891921997, -1.889425277709961, -1.8850418329238892, -1.8806726932525635, -1.8763175010681152, -1.8719762563705444, -1.867648720741272, -1.8633347749710083, -1.859034538269043, -1.8547476530075073, -1.850474238395691, -1.846213936805725, -1.8419668674468994, -1.8377329111099243, -1.8335119485855103, -1.8293037414550781, -1.825108289718628, -1.8209255933761597, -1.8167554140090942, -1.8125978708267212, -1.8084524869918823, -1.8043195009231567, -1.8001989126205444, -1.7960902452468872, -1.7919938564300537, -1.7879091501235962, -1.7838363647460938, -1.7797755002975464, -1.775726318359375, -1.7716885805130005, -1.7676624059677124, -1.7636477947235107, -1.7596445083618164, -1.7556524276733398, -1.7516716718673706, -1.7477020025253296, -1.7437434196472168, -1.7397958040237427, -1.7358589172363281, -1.7319331169128418, -1.7280179262161255, -1.7241134643554688, -1.7202194929122925, -1.7163361310958862, -1.7124632596969604, -1.7086007595062256, -1.7047486305236816, -1.7009066343307495, -1.6970747709274292, -1.6932531595230103, -1.6894415616989136, -1.6856398582458496, -1.6818480491638184, -1.6780661344528198, -1.674294114112854, -1.6705316305160522, -1.6667789220809937, -1.6630357503890991, -1.659301996231079, -1.6555778980255127, -1.6518629789352417, -1.6481575965881348, -1.6444613933563232, -1.6407743692398071, -1.6370965242385864, -1.6334278583526611, -1.6297681331634521, -1.626117467880249, -1.6224757432937622, -1.6188427209854126, -1.6152187585830688, -1.6116033792495728, -1.6079967021942139, -1.6043986082077026, -1.6008092164993286, -1.5972284078598022, -1.593656063079834, -1.5900920629501343, -1.5865365266799927, -1.58298921585083, -1.5794503688812256, -1.5759196281433105, -1.572396993637085, -1.5688825845718384, -1.5653762817382812, -1.5618778467178345, -1.5583873987197876, -1.5549050569534302, -1.5514304637908936, -1.5479637384414673, -1.5445047616958618, -1.5410535335540771, -1.5376100540161133, -1.5341742038726807, -1.5307459831237793, -1.5273252725601196, -1.523911952972412, -1.5205062627792358, -1.5171079635620117, -1.5137170553207397, -1.5103334188461304, -1.5069571733474731, -1.5035881996154785, -1.500226378440857, -1.4968715906143188, -1.4935239553451538, -1.4901835918426514, -1.4868500232696533, -1.4835234880447388, -1.4802039861679077, -1.4768915176391602, -1.473585844039917, -1.4702869653701782, -1.4669948816299438, -1.4637095928192139, -1.4604310989379883, -1.4571592807769775, -1.453894019126892, -1.450635313987732, -1.4473832845687866, -1.4441378116607666, -1.4408987760543823, -1.4376660585403442, -1.434440016746521, -1.431220293045044, -1.428006887435913, -1.4247997999191284, -1.42159903049469, -1.4184045791625977, -1.4152162075042725, -1.412034034729004, -1.408858060836792, -1.4056881666183472, -1.402524471282959, -1.3993667364120483, -1.3962148427963257, -1.3930691480636597, -1.3899294137954712, -1.3867955207824707, -1.3836674690246582, -1.3805452585220337, -1.3774290084838867, -1.3743184804916382, -1.371213674545288, -1.3681144714355469, -1.3650211095809937, -1.3619333505630493, -1.3588513135910034, -1.3557748794555664, -1.3527039289474487, -1.34963858127594, -1.34657883644104, -1.34352445602417, -1.3404755592346191, -1.3374321460723877, -1.334394097328186, -1.3313614130020142, -1.3283339738845825, -1.3253120183944702, -1.3222953081130981, -1.3192838430404663, -1.3162775039672852, -1.3132765293121338, -1.310280680656433, -1.307289958000183, -1.3043043613433838, -1.3013238906860352, -1.2983485460281372, -1.2953782081604004, -1.2924128770828247, -1.2894525527954102, -1.2864971160888672, -1.283546805381775, -1.2806012630462646, -1.2776607275009155, -1.2747249603271484, -1.271794080734253, -1.2688679695129395, -1.2659467458724976, -1.2630301713943481, -1.2601183652877808, -1.257211446762085, -1.254309058189392, -1.2514114379882812, -1.2485183477401733, -1.2456300258636475, -1.2427462339401245, -1.2398672103881836, -1.2369924783706665, -1.234122395515442, -1.2312568426132202, -1.2283958196640015, -1.2255390882492065, -1.222687005996704, -1.2198392152786255, -1.2169959545135498, -1.214156985282898, -1.2113224267959595, -1.2084922790527344, -1.205666422843933, -1.2028447389602661, -1.200027346611023, -1.1972143650054932, -1.1944055557250977, -1.1916009187698364, -1.1888004541397095, -1.1860041618347168, -1.183212161064148, -1.1804242134094238, -1.1776403188705444, -1.1748604774475098, -1.1720848083496094, -1.1693131923675537, -1.1665456295013428, -1.1637818813323975, -1.161022424697876, -1.1582667827606201, -1.155515193939209, -1.1527674198150635, -1.1500235795974731, -1.1472837924957275, -1.144547700881958, -1.1418156623840332, -1.1390873193740845, -1.136362910270691, -1.1336421966552734, -1.1309252977371216, -1.1282120943069458, -1.1255028247833252, -1.1227972507476807, -1.1200953722000122, -1.1173971891403198, -1.1147027015686035, -1.1120119094848633, -1.1093248128890991, -1.106641173362732, -1.1039612293243408, -1.1012849807739258, -1.0986123085021973]} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/test/test.js b/lib/node_modules/@stdlib/math/base/special/logitf/test/test.js new file mode 100755 index 000000000000..729b5238f948 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/test/test.js @@ -0,0 +1,140 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 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 PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var logitf = require( './../lib' ); + + +// FIXTURES // + +var small = require( './fixtures/python/small.json' ); +var medium = require( './fixtures/python/medium.json' ); +var large = require( './fixtures/python/large.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logitf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns `NaN` when provided `NaN`', function test( t ) { + var y = logitf( NaN ); + t.equal( isnanf( y ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'the function returns `NaN` when provided a number outside `[0,1]`', function test( t ) { + var y = logitf( 1.2 ); + t.equal( isnanf( y ), true, 'returns NaN' ); + y = logitf( -0.1 ); + t.equal( isnanf( y ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'the function returns `-Infinity` when provided `0`', function test( t ) { + var y = logitf( 0.0 ); + t.equal( y, NINF, 'returns -Infinity' ); + t.end(); +}); + +tape( 'the function returns `+Infinity` when provided `1`', function test( t ) { + var y = logitf( 1.0 ); + t.equal( y, PINF, 'returns +Infinity' ); + t.end(); +}); + +tape( 'the function evaluates the logitf of `x` for the interval `(0,0.25]`', function test( t ) { + var expected; + var delta; + var tol; + var x; + var y; + var i; + + expected = small.expected; + x = small.x; + for ( i = 0; i < x.length; i++ ) { + y = logitf( x[i] ); + if ( y === expected[i] ) { + t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[i] ); + tol = EPS * abs( expected[i] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+y+'. E: '+expected[i]+' Δ: '+delta+'. tol: '+tol ); + } + } + t.end(); +}); + +tape( 'the function evaluates the logitf of `x` for the interval `[0.25,0.75]`', function test( t ) { + var expected; + var delta; + var tol; + var x; + var y; + var i; + + expected = medium.expected; + x = medium.x; + for ( i = 0; i < x.length; i++ ) { + y = logitf( x[i] ); + if ( y === expected[i] ) { + t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[i] ); + tol = EPS * abs( expected[i] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+y+'. E: '+expected[i]+' Δ: '+delta+'. tol: '+tol ); + } + } + t.end(); +}); + +tape( 'the function evaluates the logitf of `x` for the interval `[0.75,1)`', function test( t ) { + var expected; + var delta; + var tol; + var x; + var y; + var i; + + expected = large.expected; + x = large.x; + for ( i = 0; i < x.length; i++ ) { + y = logitf( x[i] ); + if ( y === expected[i] ) { + t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[i] ); + tol = EPS * abs( expected[i] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+y+'. E: '+expected[i]+' Δ: '+delta+'. tol: '+tol ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/logitf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/logitf/test/test.native.js new file mode 100755 index 000000000000..921019acaa06 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/logitf/test/test.native.js @@ -0,0 +1,152 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2022 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 PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var small = require( './fixtures/python/small.json' ); +var medium = require( './fixtures/python/medium.json' ); +var large = require( './fixtures/python/large.json' ); + + +// VARIABLES // + +var logitf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( logitf instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logitf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns `NaN` when provided `NaN`', opts, function test( t ) { + var y = logitf( NaN ); + t.equal( isnanf( y ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'the function returns `NaN` when provided a number outside `[0,1]`', opts, function test( t ) { + var y = logitf( 1.2 ); + t.equal( isnanf( y ), true, 'returns NaN' ); + y = logitf( -0.1 ); + t.equal( isnanf( y ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'the function returns `-Infinity` when provided `0`', opts, function test( t ) { + var y = logitf( 0.0 ); + t.equal( y, NINF, 'returns -Infinity' ); + t.end(); +}); + +tape( 'the function returns `+Infinity` when provided `1`', opts, function test( t ) { + var y = logitf( 1.0 ); + t.equal( y, PINF, 'returns +Infinity' ); + t.end(); +}); + +tape( 'the function evaluates the logitf of `x` for the interval `(0,0.25]`', opts, function test( t ) { + var expected; + var delta; + var tol; + var x; + var y; + var i; + + expected = small.expected; + x = small.x; + for ( i = 0; i < x.length; i++ ) { + y = logitf( x[i] ); + if ( y === expected[i] ) { + t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[i] ); + tol = EPS * abs( expected[i] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+y+'. E: '+expected[i]+' Δ: '+delta+'. tol: '+tol ); + } + } + t.end(); +}); + +tape( 'the function evaluates the logitf of `x` for the interval `[0.25,0.75]`', opts, function test( t ) { + var expected; + var delta; + var tol; + var x; + var y; + var i; + + expected = medium.expected; + x = medium.x; + for ( i = 0; i < x.length; i++ ) { + y = logitf( x[i] ); + if ( y === expected[i] ) { + t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[i] ); + tol = EPS * abs( expected[i] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+y+'. E: '+expected[i]+' Δ: '+delta+'. tol: '+tol ); + } + } + t.end(); +}); + +tape( 'the function evaluates the logitf of `x` for the interval `[0.75,1)`', opts, function test( t ) { + var expected; + var delta; + var tol; + var e; + var x; + var y; + var i; + + expected = large.expected; + x = large.x; + for ( i = 0; i < x.length; i++ ) { + y = logitf( float64ToFloat32( x[i] ) ); + e = float64ToFloat32( expected[i] ); + if ( y === expected[i] ) { + t.equal( y, e, 'x: '+x[i]+', y: '+y+', expected: '+e ); + } else { + delta = abs( y - e ); + tol = EPS * abs( e ); + t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. v: '+y+'. E: '+e+' Δ: '+delta+'. tol: '+tol ); + } + } + t.end(); +});