diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/README.md b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/README.md new file mode 100644 index 000000000000..191b3de344cd --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/README.md @@ -0,0 +1,249 @@ + + +# modifiedHuberGradient + +> Compute the [modified Huber loss gradient][modified-huber-loss-gradient] with respect to a model parameter for a single-precision floating-point number. + +
+ +The [modified Huber loss gradient][modified-huber-loss-gradient] is defined as + + + +```math +\frac{\partial \ell}{\partial w_i} = +\begin{cases} +-4yx_i & \text{if } yp < -1 \\ +-2y(1 - yp)x_i & \text{if } -1 \le yp \le 1 \\ +0 & \text{if } yp > 1 +\end{cases} +``` + + + +
+ + + +
+ +## Usage + +```javascript +var modifiedHuberGradient = require( '@stdlib/ml/base/loss/float32/modified-huber-gradient' ); +``` + +#### modifiedHuberGradient( x, y, p ) + +Computes the [modified Huber loss gradient][modified-huber-loss-gradient] with respect to a model parameter for a single-precision floating-point number. + +```javascript +var v = modifiedHuberGradient( 3.4, 1.0, 0.782 ); +// returns ~-1.482 + +v = modifiedHuberGradient( 2.3, 1.0, -0.999 ); +// returns ~-9.195 +``` + +The function accepts the following arguments: + +- **x**: input value. +- **y**: true target value. +- **p**: predicted value. + +If any argument is `NaN`, the function returns `NaN`. + +```javascript +var v = modifiedHuberGradient( NaN, 1.0, 0.782 ); +// returns NaN + +v = modifiedHuberGradient( 1.0, NaN, 0.782 ); +// returns NaN + +v = modifiedHuberGradient( 1.0, 1.0, NaN ); +// returns NaN + +v = modifiedHuberGradient( NaN, NaN, NaN ); +// returns NaN +``` + +If `y` is not +1 or -1, the function returns `NaN`. + +```javascript +var v = modifiedHuberGradient( 3.0, -0.9, 1.0 ); +// returns NaN + +v = modifiedHuberGradient( 4.0, 0.453, 0.76 ); +// returns NaN +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var modifiedHuberGradient = require( '@stdlib/ml/base/loss/float32/modified-huber-gradient' ); + +var x = uniform( 100, -10.0, 10.0, { + 'dtype': 'float32' +}); +var y = sample( [ -1.0, 1.0 ], { + 'size': 100 +}); +var p = uniform( 100, -5.0, 5.0, { + 'dtype': 'float32' +}); + +logEachMap( 'modifiedHuberGradient(%0.4f, %0.4f, %0.4f) = %0.4f', x, y, p, modifiedHuberGradient ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/ml/base/loss/float32/modified_huber_gradient.h" +``` + +#### stdlib_base_float32_modified_huber_gradient( x, y, p ) + +Computes the [modified Huber loss gradient][modified-huber-loss-gradient] with respect to a model parameter for a single-precision floating-point number. + +```c +float out = stdlib_base_float32_modified_huber_gradient( 3.4f, 1.0f, 0.782f ); +// returns ~-1.482f +``` + +The function accepts the following arguments: + +- **x**: `[in] float` input value. +- **y**: `[in] float` true target value. +- **p**: `[in] float` predicted value. + +```c +float stdlib_base_float32_modified_huber_gradient( const float x, const float y, const float p ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/ml/base/loss/float32/modified_huber_gradient.h" +#include + +int main( void ) { + const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; + const float y[] = { -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; + const float p[] = { -5.0f, -3.89f, -2.78f, -1.67f, -0.56f, 0.56f, 1.67f, 2.78f, 3.89f, 5.0f }; + + float v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_float32_modified_huber_gradient( x[ i ], y[ i ], p[ i ] ); + printf( "modifiedHuberGradient(%f, %f, %f) = %f\n", x[ i ], y[ i ], p[ i ], v ); + } +} +``` + +
+ + + +
+ + + +
+ +## References + +- Zhang, Tong. 2004. "Solving Large Scale Linear Prediction Problems Using Stochastic Gradient Descent Algorithms." In _Proceedings of the Twenty-First International Conference on Machine Learning_, 116. New York, NY, USA: Association for Computing Machinery. doi:[10.1145/1015330.1015332][@zhang:2004a]. + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/benchmark.js b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/benchmark.js new file mode 100644 index 000000000000..83a84b013df9 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/benchmark.js @@ -0,0 +1,65 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pkg = require( './../package.json' ).name; +var modifiedHuberGradient = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var len; + var x; + var y; + var p; + var v; + var i; + + len = 100; + y = sample( [ -1.0, 1.0 ], { + 'size': len + }); + x = uniform( len, -10.0, 10.0, { + 'dtype': 'float32' + }); + p = uniform( len, -2.0, 2.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = modifiedHuberGradient( x[ i%x.length ], y[ i%y.length ], p[ i%p.length ] ); + if ( isnanf( v ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( v ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/benchmark.native.js new file mode 100644 index 000000000000..a1d66be1f594 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/benchmark.native.js @@ -0,0 +1,75 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var modifiedHuberGradient = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( modifiedHuberGradient instanceof Error ) +}; + + +// MAIN // + +bench( format( '%s::native', pkg ), opts, function benchmark( b ) { + var len; + var x; + var y; + var p; + var v; + var i; + + len = 100; + y = sample( [ -1.0, 1.0 ], { + 'size': len + }); + x = uniform( len, -10.0, 10.0, { + 'dtype': 'float32' + }); + p = uniform( len, -2.0, 2.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = modifiedHuberGradient( x[ i%x.length ], y[ i%y.length ], p[ i%p.length ] ); + if ( isnanf( v ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( v ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/c/native/Makefile new file mode 100644 index 000000000000..979768abbcec --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/c/native/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 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/ml/base/loss/float32/modified-huber-gradient/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/c/native/benchmark.c new file mode 100644 index 000000000000..539ba48f0d9e --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/benchmark/c/native/benchmark.c @@ -0,0 +1,161 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/ml/base/loss/float32/modified_huber_gradient.h" +#include +#include +#include +#include +#include + +#define NAME "modified_huber_gradient" +#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 [min,max). +* +* @param min minimum value (inclusive) +* @param max maximum value (exclusive) +* @return random number +*/ +static float random_uniform( const float min, const float max ) { + float v = (float)rand() / ( (float)RAND_MAX + 1.0f ); + return min + ( v*(max-min) ); +} + +/** +* Randomly samples either +1 or -1. +* +* @return randomly sampled value (+1 or -1) +*/ +static float random_sample( void ) { + float v = (float)rand() / ( (float)RAND_MAX ); + if ( v >= 0.5f ) { + return 1.0f; + } + return -1.0f; +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + double elapsed; + float *x; + float *y; + float *p; + float v; + double t; + int i; + + x = (float *) malloc( 100 * sizeof( float ) ); + y = (float *) malloc( 100 * sizeof( float ) ); + p = (float *) malloc( 100 * sizeof( float ) ); + for ( i = 0; i < 100; i++ ) { + y[ i ] = random_sample(); + x[ i ] = random_uniform( -10.0f, 10.0f ); + p[ i ] = random_uniform( -2.0f, 2.0f ); + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + v = stdlib_base_float32_modified_huber_gradient( x[ i % 100 ], y[ i % 100 ], p[ i % 100 ] ); + if ( v != v ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( v != v ) { + printf( "should not return NaN\n" ); + } + free( x ); + free( y ); + free( p ); + 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/ml/base/loss/float32/modified-huber-gradient/binding.gyp b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 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/ml/base/loss/float32/modified-huber-gradient/docs/repl.txt b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/repl.txt new file mode 100644 index 000000000000..f1f1cb6e25cd --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/repl.txt @@ -0,0 +1,41 @@ + +{{alias}}( x, y, p ) + Computes the modified Huber loss gradient with respect to a model parameter + for a single-precision floating-point number. + + If any argument is `NaN`, the function returns `NaN`. + + If `y` is not +1 or -1, the function returns `NaN`. + + Parameters + ---------- + x: number + Input value. + + y: number + True target value. + + p: number + Predicted value. + + Returns + ------- + v: number + Modified Huber loss gradient. + + Examples + -------- + > var v = {{alias}}( 3.4, 1.0, 0.782 ) + ~-1.482 + > v = {{alias}}( -5.0, 1.0, 0.202 ) + ~7.98 + > v = {{alias}}( 2.3, 1.0, -0.999 ) + ~-9.195 + > v = {{alias}}( 1.0, -1.0, 0.2 ) + ~2.4 + > v = {{alias}}( NaN, 1.0, 0.987 ) + NaN + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/types/index.d.ts b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/types/index.d.ts new file mode 100644 index 000000000000..3cac8f822d17 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/types/index.d.ts @@ -0,0 +1,62 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Computes the modified Huber loss gradient with respect to a model parameter for a single-precision floating-point number. +* +* ## Notes +* +* - If `y` is not +1 or -1, the function returns `NaN`. +* +* @param x - input value +* @param y - true target value +* @param p - predicted value +* @returns modified Huber loss gradient +* +* @example +* var v = modifiedHuberGradient( 3.4, 1.0, 0.782 ); +* // returns ~-1.482 +* +* @example +* var v = modifiedHuberGradient( -5.0, 1.0, 0.202 ); +* // returns ~7.98 +* +* @example +* var v = modifiedHuberGradient( 2.3, 1.0, -0.999 ); +* // returns ~-9.195 +* +* @example +* var v = modifiedHuberGradient( 4.4, -1.0, 0.234 ); +* // returns ~10.859 +* +* @example +* var v = modifiedHuberGradient( 1.0, -1.0, 0.2 ); +* // returns ~2.4 +* +* @example +* var v = modifiedHuberGradient( -5.1, 1.0, -0.9 ); +* // returns ~19.38 +*/ +declare function modifiedHuberGradient( x: number, y: number, p: number ): number; + + +// EXPORTS // + +export = modifiedHuberGradient; diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/types/test.ts b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/types/test.ts new file mode 100644 index 000000000000..2942931bf5e5 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/docs/types/test.ts @@ -0,0 +1,71 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 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 modifiedHuberGradient = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + modifiedHuberGradient( 3.4, 1.0, 0.782 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + modifiedHuberGradient( true, 1.0, 0.782 ); // $ExpectError + modifiedHuberGradient( false, 1.0, 0.782 ); // $ExpectError + modifiedHuberGradient( null, 1.0, 0.782 ); // $ExpectError + modifiedHuberGradient( undefined, 1.0, 0.782 ); // $ExpectError + modifiedHuberGradient( '5', 1.0, 0.782 ); // $ExpectError + modifiedHuberGradient( [], 1.0, 0.782 ); // $ExpectError + modifiedHuberGradient( {}, 1.0, 0.782 ); // $ExpectError + modifiedHuberGradient( ( x: number ): number => x, 1.0, 0.782 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + modifiedHuberGradient( 1.0, true, 0.782 ); // $ExpectError + modifiedHuberGradient( 1.0, false, 0.782 ); // $ExpectError + modifiedHuberGradient( 1.0, null, 0.782 ); // $ExpectError + modifiedHuberGradient( 1.0, undefined, 0.782 ); // $ExpectError + modifiedHuberGradient( 1.0, '5', 0.782 ); // $ExpectError + modifiedHuberGradient( 1.0, [], 0.782 ); // $ExpectError + modifiedHuberGradient( 1.0, {}, 0.782 ); // $ExpectError + modifiedHuberGradient( 1.0, ( x: number ): number => x, 0.782 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + modifiedHuberGradient( 3.4, 1.0, true ); // $ExpectError + modifiedHuberGradient( 3.4, 1.0, false ); // $ExpectError + modifiedHuberGradient( 3.4, 1.0, null ); // $ExpectError + modifiedHuberGradient( 3.4, 1.0, undefined ); // $ExpectError + modifiedHuberGradient( 3.4, 1.0, '5' ); // $ExpectError + modifiedHuberGradient( 3.4, 1.0, [] ); // $ExpectError + modifiedHuberGradient( 3.4, 1.0, {} ); // $ExpectError + modifiedHuberGradient( 3.4, 1.0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + modifiedHuberGradient(); // $ExpectError + modifiedHuberGradient( 1.0 ); // $ExpectError + modifiedHuberGradient( 1.0, 0.900 ); // $ExpectError + modifiedHuberGradient( 1.0, 0.900, 3.4, 0.7873 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/c/Makefile b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 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/ml/base/loss/float32/modified-huber-gradient/examples/c/example.c b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/c/example.c new file mode 100644 index 000000000000..a01195a12d22 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/c/example.c @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/ml/base/loss/float32/modified_huber_gradient.h" +#include + +int main( void ) { + const float x[] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f }; + const float y[] = { -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; + const float p[] = { -5.0f, -3.89f, -2.78f, -1.67f, -0.56f, 0.56f, 1.67f, 2.78f, 3.89f, 5.0f }; + + float v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_float32_modified_huber_gradient( x[ i ], y[ i ], p[ i ] ); + printf( "modifiedHuberGradient(%f, %f, %f) = %f\n", x[ i ], y[ i ], p[ i ], v ); + } +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/index.js b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/index.js new file mode 100644 index 000000000000..64800a1b12a3 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/examples/index.js @@ -0,0 +1,36 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var uniform = require( '@stdlib/random/array/uniform' ); +var sample = require( '@stdlib/random/sample' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var modifiedHuberGradient = require( './../lib' ); + +var x = uniform( 100, -10.0, 10.0, { + 'dtype': 'float32' +}); +var y = sample( [ -1.0, 1.0 ], { + 'size': 100 +}); +var p = uniform( 100, -5.0, 5.0, { + 'dtype': 'float32' +}); + +logEachMap( 'modifiedHuberGradient(%0.4f, %0.4f, %0.4f) = %0.4f', x, y, p, modifiedHuberGradient ); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/include.gypi b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 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': [ + '= 1.0 ) { + return 0.0; + } + if ( z >= -1.0 ) { + return f32( f32( f32( -2.0 * f32( 1.0 - z ) ) * y ) * x ); + } + return f32( f32( -4.0 * y ) * x ); +} + + +// EXPORTS // + +module.exports = modifiedHuberGradient; diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/lib/native.js b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/lib/native.js new file mode 100644 index 000000000000..3dd665a6a537 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/lib/native.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Computes the modified Huber loss gradient with respect to a model parameter for a single-precision floating-point number. +* +* @private +* @param {number} x - input value +* @param {number} y - true target value +* @param {number} p - predicted value +* @returns {number} modified Huber loss gradient +* +* @example +* var v = modifiedHuberGradient( 3.4, 1.0, 0.782 ); +* // returns ~-1.482 +* +* @example +* var v = modifiedHuberGradient( -5.0, 1.0, 0.202 ); +* // returns ~7.98 +* +* @example +* var v = modifiedHuberGradient( 2.3, 1.0, -0.999 ); +* // returns ~-9.195 +* +* @example +* var v = modifiedHuberGradient( 4.4, -1.0, 0.234 ); +* // returns ~10.859 +* +* @example +* var v = modifiedHuberGradient( 1.0, -1.0, 0.2 ); +* // returns ~2.4 +* +* @example +* var v = modifiedHuberGradient( -5.1, 1.0, -0.9 ); +* // returns ~19.38 +*/ +function modifiedHuberGradient( x, y, p ) { + return addon( x, y, p ); +} + + +// EXPORTS // + +module.exports = modifiedHuberGradient; diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/manifest.json b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/manifest.json new file mode 100644 index 000000000000..341dddf519b0 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/manifest.json @@ -0,0 +1,75 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/napi/ternary", + "@stdlib/math/base/assert/is-nanf", + "@stdlib/constants/float32/nan" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nanf", + "@stdlib/constants/float32/nan" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nanf", + "@stdlib/constants/float32/nan" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/package.json b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/package.json new file mode 100644 index 000000000000..a1028c7423da --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/ml/base/loss/float32/modified-huber-gradient", + "version": "0.0.0", + "description": "Compute the modified Huber loss gradient with respect to a model parameter for a single-precision floating-point number.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "machine learning", + "ml", + "loss", + "float32", + "huber", + "modified huber", + "gradient", + "single-precision", + "single", + "float" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/Makefile b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 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/ml/base/loss/float32/modified-huber-gradient/src/addon.c b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/addon.c new file mode 100644 index 000000000000..baab326e7568 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/addon.c @@ -0,0 +1,22 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/ml/base/loss/float32/modified_huber_gradient.h" +#include "stdlib/math/base/napi/ternary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_FFF_F( stdlib_base_float32_modified_huber_gradient ) diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/main.c b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/main.c new file mode 100644 index 000000000000..f30d428c24ce --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/src/main.c @@ -0,0 +1,49 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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/ml/base/loss/float32/modified_huber_gradient.h" +#include "stdlib/math/base/assert/is_nanf.h" +#include "stdlib/constants/float32/nan.h" + +/** +* Computes the modified Huber loss gradient with respect to a model parameter for a single-precision floating-point number. +* +* @param x input value +* @param y true target value +* @param p predicted value +* @return modified Huber loss gradient +* +* @example +* float out = stdlib_base_float32_modified_huber_gradient( -5.0f, 1.0f, 0.202f ); +* // returns ~7.98f +*/ +float stdlib_base_float32_modified_huber_gradient( const float x, const float y, const float p ) { + float z; + + if ( stdlib_base_is_nanf( x ) || stdlib_base_is_nanf( y ) || stdlib_base_is_nanf( p ) || ( y != -1.0f && y != 1.0f ) ) { + return STDLIB_CONSTANT_FLOAT32_NAN; + } + z = y * p; + if ( z >= 1.0f ) { + return 0.0f; + } + if ( z >= -1.0f ) { + return -2.0f * ( 1.0f - z ) * y * x; + } + return -4.0f * y * x; +} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..7c8193c06e65 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/REQUIRE @@ -0,0 +1,2 @@ +julia 1.4.2 +JSON 0.21.0 diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/runner.jl new file mode 100644 index 000000000000..5f430027f477 --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/runner.jl @@ -0,0 +1,112 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import JSON + +""" + modifiedHuberGradient( x, y, p ) + +Compute the modified Huber loss gradient with respect to a model parameter for a single-precision floating-point number. +""" +function modifiedHuberGradient( x, y, p ) + z = y * p; + if z >= 1.0f0 + return 0.0f0; + end + if z >= -1.0f0 + return -2.0f0 * ( 1.0f0 - z ) * y * x; + end + return -4.0f0 * y * x; +end + +""" + gen( x, y, p, name ) + +Generate fixture data and write to file. + +# Arguments + +* `x`: input domain +* `y`: response domain +* `p`: prediction domain +* `name::AbstractString`: output filename + +# Examples + +``` julia +julia> x = Float32.( range( -1000.0, 1000.0, 2001 ) ); +julia> y = Float32.( rand( [-1.0, 1.0], 2001 ) ); +julia> p = Float32.( range( -1000.0, 1000.0, 2001 ) ); +julia> gen( x, y, p, "data.json" ); +``` +""" +function gen( x, y, p, name ) + x = Float32.( x ); + y = Float32.( y ); + p = Float32.( p ); + + # Compute expected gradient values element-wise: + v = modifiedHuberGradient.( x, y, p ); + + # Store data to be written to file as a collection: + data = Dict([ + ("x", x), + ("y", y), + ("p", p), + ("expected", v) + ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: + outfile = open( filepath, "w" ); + write( outfile, JSON.json(data) ); + write( outfile, "\n" ); + close( outfile ); +end + +# Get the filename: +file = @__FILE__; + +# Extract the directory in which this file resides: +dir = dirname(file); + +# Positive tiny values: +x = Float32.( range( 0.0, stop=1e-20, length=503 ) ); +y = Float32.( rand( [ -1.0, 1.0 ], 503 ) ); +p = Float32.( range( 0.0, stop=1e-20, length=503 ) ); +gen( x, y, p, "tiny_positive.json" ); + +# Small positive values: +x = Float32.( range( 0.0, stop=2.0, length=503 ) ); +y = Float32.( rand( [ -1.0, 1.0 ], 503 ) ); +p = Float32.( range( 0.0, stop=2.0, length=503 ) ); +gen( x, y, p, "small_positive.json" ); + +# Negative tiny values: +x = Float32.( range( -1e-20, stop=0.0, length=503 ) ); +y = Float32.( rand( [ -1.0, 1.0 ], 503 ) ); +p = Float32.( range( -1e-20, stop=0.0, length=503 ) ); +gen( x, y, p, "tiny_negative.json" ); + +# Small negative values: +x = Float32.( range( -2.0, stop=0.0, length=503 ) ); +y = Float32.( rand( [ -1.0, 1.0 ], 503 ) ); +p = Float32.( range( -2.0, stop=0.0, length=503 ) ); +gen( x, y, p, "small_negative.json" ); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/small_negative.json b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/small_negative.json new file mode 100644 index 000000000000..5dfba90c18ea --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/small_negative.json @@ -0,0 +1 @@ +{"x":[-2,-1.9960159063339233,-1.9920319318771362,-1.9880478382110596,-1.984063744544983,-1.9800796508789062,-1.9760956764221191,-1.9721115827560425,-1.9681274890899658,-1.9641433954238892,-1.960159420967102,-1.9561753273010254,-1.9521912336349487,-1.948207139968872,-1.944223165512085,-1.9402390718460083,-1.9362549781799316,-1.932270884513855,-1.9282869100570679,-1.9243028163909912,-1.9203187227249146,-1.916334629058838,-1.9123506546020508,-1.9083665609359741,-1.9043824672698975,-1.9003983736038208,-1.8964143991470337,-1.892430305480957,-1.8884462118148804,-1.8844621181488037,-1.8804781436920166,-1.87649405002594,-1.8725099563598633,-1.8685258626937866,-1.8645418882369995,-1.8605577945709229,-1.8565737009048462,-1.8525896072387695,-1.8486056327819824,-1.8446215391159058,-1.840637445449829,-1.8366533517837524,-1.8326693773269653,-1.8286852836608887,-1.824701189994812,-1.8207170963287354,-1.8167331218719482,-1.8127490282058716,-1.808764934539795,-1.8047808408737183,-1.8007968664169312,-1.7968127727508545,-1.7928286790847778,-1.7888445854187012,-1.784860610961914,-1.7808765172958374,-1.7768924236297607,-1.772908329963684,-1.768924355506897,-1.7649402618408203,-1.7609561681747437,-1.756972074508667,-1.7529881000518799,-1.7490040063858032,-1.7450199127197266,-1.74103581905365,-1.7370518445968628,-1.7330677509307861,-1.7290836572647095,-1.7250995635986328,-1.7211155891418457,-1.717131495475769,-1.7131474018096924,-1.7091633081436157,-1.7051793336868286,-1.701195240020752,-1.6972111463546753,-1.6932270526885986,-1.6892430782318115,-1.6852589845657349,-1.6812748908996582,-1.6772907972335815,-1.6733068227767944,-1.6693227291107178,-1.6653386354446411,-1.6613545417785645,-1.6573705673217773,-1.6533864736557007,-1.649402379989624,-1.6454182863235474,-1.6414343118667603,-1.6374502182006836,-1.633466124534607,-1.6294820308685303,-1.6254980564117432,-1.6215139627456665,-1.6175298690795898,-1.6135457754135132,-1.609561800956726,-1.6055777072906494,-1.6015936136245728,-1.597609519958496,-1.593625545501709,-1.5896414518356323,-1.5856573581695557,-1.581673264503479,-1.577689290046692,-1.5737051963806152,-1.5697211027145386,-1.565737009048462,-1.5617530345916748,-1.5577689409255981,-1.5537848472595215,-1.5498007535934448,-1.5458167791366577,-1.541832685470581,-1.5378485918045044,-1.5338644981384277,-1.5298805236816406,-1.525896430015564,-1.5219123363494873,-1.5179282426834106,-1.5139442682266235,-1.5099601745605469,-1.5059760808944702,-1.5019919872283936,-1.4980080127716064,-1.4940239191055298,-1.4900398254394531,-1.4860557317733765,-1.4820717573165894,-1.4780876636505127,-1.474103569984436,-1.4701194763183594,-1.4661355018615723,-1.4621514081954956,-1.458167314529419,-1.4541832208633423,-1.4501992464065552,-1.4462151527404785,-1.4422310590744019,-1.4382469654083252,-1.434262990951538,-1.4302788972854614,-1.4262948036193848,-1.422310709953308,-1.418326735496521,-1.4143426418304443,-1.4103585481643677,-1.406374454498291,-1.402390480041504,-1.3984063863754272,-1.3944222927093506,-1.390438199043274,-1.3864542245864868,-1.3824701309204102,-1.3784860372543335,-1.3745019435882568,-1.3705179691314697,-1.366533875465393,-1.3625497817993164,-1.3585656881332397,-1.3545817136764526,-1.350597620010376,-1.3466135263442993,-1.3426294326782227,-1.3386454582214355,-1.3346613645553589,-1.3306772708892822,-1.3266931772232056,-1.3227092027664185,-1.3187251091003418,-1.3147410154342651,-1.3107569217681885,-1.3067729473114014,-1.3027888536453247,-1.298804759979248,-1.2948206663131714,-1.2908366918563843,-1.2868525981903076,-1.282868504524231,-1.2788844108581543,-1.2749004364013672,-1.2709163427352905,-1.2669322490692139,-1.2629481554031372,-1.25896418094635,-1.2549800872802734,-1.2509959936141968,-1.2470118999481201,-1.243027925491333,-1.2390438318252563,-1.2350597381591797,-1.231075644493103,-1.227091670036316,-1.2231075763702393,-1.2191234827041626,-1.215139389038086,-1.2111554145812988,-1.2071713209152222,-1.2031872272491455,-1.1992031335830688,-1.1952191591262817,-1.191235065460205,-1.1872509717941284,-1.1832668781280518,-1.1792829036712646,-1.175298810005188,-1.1713147163391113,-1.1673306226730347,-1.1633466482162476,-1.159362554550171,-1.1553784608840942,-1.1513943672180176,-1.1474103927612305,-1.1434262990951538,-1.1394422054290771,-1.1354581117630005,-1.1314741373062134,-1.1274900436401367,-1.12350594997406,-1.1195218563079834,-1.1155378818511963,-1.1115537881851196,-1.107569694519043,-1.1035856008529663,-1.0996016263961792,-1.0956175327301025,-1.0916334390640259,-1.0876493453979492,-1.083665370941162,-1.0796812772750854,-1.0756971836090088,-1.0717130899429321,-1.067729115486145,-1.0637450218200684,-1.0597609281539917,-1.055776834487915,-1.051792860031128,-1.0478087663650513,-1.0438246726989746,-1.039840579032898,-1.0358566045761108,-1.0318725109100342,-1.0278884172439575,-1.0239043235778809,-1.0199203491210938,-1.015936255455017,-1.0119521617889404,-1.0079680681228638,-1.0039840936660767,-1,-0.9960159659385681,-0.9920318722724915,-0.9880478382110596,-0.9840637445449829,-0.980079710483551,-0.9760956168174744,-0.9721115827560425,-0.9681274890899658,-0.9641434550285339,-0.9601593613624573,-0.9561753273010254,-0.9521912336349487,-0.9482071995735168,-0.9442231059074402,-0.9402390718460083,-0.9362549781799316,-0.9322709441184998,-0.9282868504524231,-0.9243028163909912,-0.9203187227249146,-0.9163346886634827,-0.912350594997406,-0.9083665609359741,-0.9043824672698975,-0.9003984332084656,-0.8964143395423889,-0.892430305480957,-0.8884462118148804,-0.8844621777534485,-0.8804780840873718,-0.8764940500259399,-0.8725099563598633,-0.8685259222984314,-0.8645418286323547,-0.8605577945709229,-0.8565737009048462,-0.8525896668434143,-0.8486055731773376,-0.8446215391159058,-0.8406374454498291,-0.8366534113883972,-0.8326693177223206,-0.8286852836608887,-0.824701189994812,-0.8207171559333801,-0.8167330622673035,-0.8127490282058716,-0.8087649345397949,-0.804780900478363,-0.8007968068122864,-0.7968127727508545,-0.7928286790847778,-0.788844645023346,-0.7848605513572693,-0.7808765172958374,-0.7768924236297607,-0.7729083895683289,-0.7689242959022522,-0.7649402618408203,-0.7609561681747437,-0.7569721341133118,-0.7529880404472351,-0.7490040063858032,-0.7450199127197266,-0.7410358786582947,-0.737051784992218,-0.7330677509307861,-0.7290836572647095,-0.7250996232032776,-0.7211155295372009,-0.717131495475769,-0.7131474018096924,-0.7091633677482605,-0.7051792740821838,-0.701195240020752,-0.6972111463546753,-0.6932271122932434,-0.6892430186271667,-0.6852589845657349,-0.6812748908996582,-0.6772908568382263,-0.6733067631721497,-0.6693227291107178,-0.6653386354446411,-0.6613546013832092,-0.6573705077171326,-0.6533864736557007,-0.649402379989624,-0.6454183459281921,-0.6414342522621155,-0.6374502182006836,-0.6334661245346069,-0.629482090473175,-0.6254979968070984,-0.6215139627456665,-0.6175298690795898,-0.613545835018158,-0.6095617413520813,-0.6055777072906494,-0.6015936136245728,-0.5976095795631409,-0.5936254858970642,-0.5896414518356323,-0.5856573581695557,-0.5816733241081238,-0.5776892304420471,-0.5737051963806152,-0.5697211027145386,-0.5657370686531067,-0.56175297498703,-0.5577689409255981,-0.5537848472595215,-0.5498008131980896,-0.5458167195320129,-0.541832685470581,-0.5378485918045044,-0.5338645577430725,-0.5298804640769958,-0.525896430015564,-0.5219123363494873,-0.5179283022880554,-0.5139442086219788,-0.5099601745605469,-0.5059760808944702,-0.5019920468330383,-0.49800798296928406,-0.4940239191055298,-0.4900398552417755,-0.48605579137802124,-0.48207172751426697,-0.4780876636505127,-0.4741035997867584,-0.47011953592300415,-0.4661354720592499,-0.4621514081954956,-0.45816734433174133,-0.45418328046798706,-0.4501992166042328,-0.4462151527404785,-0.44223108887672424,-0.43824702501296997,-0.4342629611492157,-0.4302788972854614,-0.42629483342170715,-0.4223107695579529,-0.4183267056941986,-0.41434264183044434,-0.41035857796669006,-0.4063745141029358,-0.4023904502391815,-0.39840638637542725,-0.394422322511673,-0.3904382586479187,-0.38645419478416443,-0.38247013092041016,-0.3784860670566559,-0.3745020031929016,-0.37051793932914734,-0.36653387546539307,-0.3625498116016388,-0.3585657477378845,-0.35458168387413025,-0.350597620010376,-0.3466135561466217,-0.34262949228286743,-0.33864542841911316,-0.3346613645553589,-0.3306773006916046,-0.32669323682785034,-0.32270917296409607,-0.3187251091003418,-0.3147410452365875,-0.31075698137283325,-0.306772917509079,-0.3027888536453247,-0.29880478978157043,-0.29482072591781616,-0.2908366620540619,-0.2868525981903076,-0.28286853432655334,-0.2788844704627991,-0.2749004065990448,-0.2709163427352905,-0.26693227887153625,-0.262948215007782,-0.2589641511440277,-0.25498008728027344,-0.25099602341651917,-0.2470119595527649,-0.24302789568901062,-0.23904383182525635,-0.23505976796150208,-0.2310757040977478,-0.22709164023399353,-0.22310757637023926,-0.21912351250648499,-0.2151394486427307,-0.21115538477897644,-0.20717132091522217,-0.2031872570514679,-0.19920319318771362,-0.19521912932395935,-0.19123506546020508,-0.1872510015964508,-0.18326693773269653,-0.17928287386894226,-0.175298810005188,-0.17131474614143372,-0.16733068227767944,-0.16334661841392517,-0.1593625545501709,-0.15537849068641663,-0.15139442682266235,-0.14741036295890808,-0.1434262990951538,-0.13944223523139954,-0.13545817136764526,-0.131474107503891,-0.12749004364013672,-0.12350597977638245,-0.11952191591262817,-0.1155378520488739,-0.11155378818511963,-0.10756972432136536,-0.10358566045761108,-0.09960159659385681,-0.09561753273010254,-0.09163346886634827,-0.087649405002594,-0.08366534113883972,-0.07968127727508545,-0.07569721341133118,-0.0717131495475769,-0.06772908568382263,-0.06374502182006836,-0.05976095795631409,-0.055776894092559814,-0.05179283022880554,-0.04780876636505127,-0.043824702501297,-0.039840638637542725,-0.03585657477378845,-0.03187251091003418,-0.027888447046279907,-0.023904383182525635,-0.019920319318771362,-0.01593625545501709,-0.011952191591262817,-0.007968127727508545,-0.0039840638637542725,0],"y":[1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,-1,-1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1,1,-1,-1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,-1,1,1,1,-1,1,-1,-1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,1,-1,-1,-1,1,-1,1,-1,1,-1,1,1,1,1,-1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,-1,-1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,-1,1,1,-1,-1,-1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,1,-1,-1,1,-1,-1,-1,1,1,1,1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,1,1,-1,1,-1,1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,1,1,1,1,1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,1,-1,-1,-1,1,1,1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,1,-1,1,1,-1,1,-1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,-1,-1,1,1,1,-1,-1,-1,-1,1,1,-1,1,1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,1,1,1,-1,1,1,-1,-1,-1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,1,1,-1,1,-1,1,1,-1,1,1,1,1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,-1,-1,-1,1,1,1,1],"p":[-2,-1.9960159063339233,-1.9920319318771362,-1.9880478382110596,-1.984063744544983,-1.9800796508789062,-1.9760956764221191,-1.9721115827560425,-1.9681274890899658,-1.9641433954238892,-1.960159420967102,-1.9561753273010254,-1.9521912336349487,-1.948207139968872,-1.944223165512085,-1.9402390718460083,-1.9362549781799316,-1.932270884513855,-1.9282869100570679,-1.9243028163909912,-1.9203187227249146,-1.916334629058838,-1.9123506546020508,-1.9083665609359741,-1.9043824672698975,-1.9003983736038208,-1.8964143991470337,-1.892430305480957,-1.8884462118148804,-1.8844621181488037,-1.8804781436920166,-1.87649405002594,-1.8725099563598633,-1.8685258626937866,-1.8645418882369995,-1.8605577945709229,-1.8565737009048462,-1.8525896072387695,-1.8486056327819824,-1.8446215391159058,-1.840637445449829,-1.8366533517837524,-1.8326693773269653,-1.8286852836608887,-1.824701189994812,-1.8207170963287354,-1.8167331218719482,-1.8127490282058716,-1.808764934539795,-1.8047808408737183,-1.8007968664169312,-1.7968127727508545,-1.7928286790847778,-1.7888445854187012,-1.784860610961914,-1.7808765172958374,-1.7768924236297607,-1.772908329963684,-1.768924355506897,-1.7649402618408203,-1.7609561681747437,-1.756972074508667,-1.7529881000518799,-1.7490040063858032,-1.7450199127197266,-1.74103581905365,-1.7370518445968628,-1.7330677509307861,-1.7290836572647095,-1.7250995635986328,-1.7211155891418457,-1.717131495475769,-1.7131474018096924,-1.7091633081436157,-1.7051793336868286,-1.701195240020752,-1.6972111463546753,-1.6932270526885986,-1.6892430782318115,-1.6852589845657349,-1.6812748908996582,-1.6772907972335815,-1.6733068227767944,-1.6693227291107178,-1.6653386354446411,-1.6613545417785645,-1.6573705673217773,-1.6533864736557007,-1.649402379989624,-1.6454182863235474,-1.6414343118667603,-1.6374502182006836,-1.633466124534607,-1.6294820308685303,-1.6254980564117432,-1.6215139627456665,-1.6175298690795898,-1.6135457754135132,-1.609561800956726,-1.6055777072906494,-1.6015936136245728,-1.597609519958496,-1.593625545501709,-1.5896414518356323,-1.5856573581695557,-1.581673264503479,-1.577689290046692,-1.5737051963806152,-1.5697211027145386,-1.565737009048462,-1.5617530345916748,-1.5577689409255981,-1.5537848472595215,-1.5498007535934448,-1.5458167791366577,-1.541832685470581,-1.5378485918045044,-1.5338644981384277,-1.5298805236816406,-1.525896430015564,-1.5219123363494873,-1.5179282426834106,-1.5139442682266235,-1.5099601745605469,-1.5059760808944702,-1.5019919872283936,-1.4980080127716064,-1.4940239191055298,-1.4900398254394531,-1.4860557317733765,-1.4820717573165894,-1.4780876636505127,-1.474103569984436,-1.4701194763183594,-1.4661355018615723,-1.4621514081954956,-1.458167314529419,-1.4541832208633423,-1.4501992464065552,-1.4462151527404785,-1.4422310590744019,-1.4382469654083252,-1.434262990951538,-1.4302788972854614,-1.4262948036193848,-1.422310709953308,-1.418326735496521,-1.4143426418304443,-1.4103585481643677,-1.406374454498291,-1.402390480041504,-1.3984063863754272,-1.3944222927093506,-1.390438199043274,-1.3864542245864868,-1.3824701309204102,-1.3784860372543335,-1.3745019435882568,-1.3705179691314697,-1.366533875465393,-1.3625497817993164,-1.3585656881332397,-1.3545817136764526,-1.350597620010376,-1.3466135263442993,-1.3426294326782227,-1.3386454582214355,-1.3346613645553589,-1.3306772708892822,-1.3266931772232056,-1.3227092027664185,-1.3187251091003418,-1.3147410154342651,-1.3107569217681885,-1.3067729473114014,-1.3027888536453247,-1.298804759979248,-1.2948206663131714,-1.2908366918563843,-1.2868525981903076,-1.282868504524231,-1.2788844108581543,-1.2749004364013672,-1.2709163427352905,-1.2669322490692139,-1.2629481554031372,-1.25896418094635,-1.2549800872802734,-1.2509959936141968,-1.2470118999481201,-1.243027925491333,-1.2390438318252563,-1.2350597381591797,-1.231075644493103,-1.227091670036316,-1.2231075763702393,-1.2191234827041626,-1.215139389038086,-1.2111554145812988,-1.2071713209152222,-1.2031872272491455,-1.1992031335830688,-1.1952191591262817,-1.191235065460205,-1.1872509717941284,-1.1832668781280518,-1.1792829036712646,-1.175298810005188,-1.1713147163391113,-1.1673306226730347,-1.1633466482162476,-1.159362554550171,-1.1553784608840942,-1.1513943672180176,-1.1474103927612305,-1.1434262990951538,-1.1394422054290771,-1.1354581117630005,-1.1314741373062134,-1.1274900436401367,-1.12350594997406,-1.1195218563079834,-1.1155378818511963,-1.1115537881851196,-1.107569694519043,-1.1035856008529663,-1.0996016263961792,-1.0956175327301025,-1.0916334390640259,-1.0876493453979492,-1.083665370941162,-1.0796812772750854,-1.0756971836090088,-1.0717130899429321,-1.067729115486145,-1.0637450218200684,-1.0597609281539917,-1.055776834487915,-1.051792860031128,-1.0478087663650513,-1.0438246726989746,-1.039840579032898,-1.0358566045761108,-1.0318725109100342,-1.0278884172439575,-1.0239043235778809,-1.0199203491210938,-1.015936255455017,-1.0119521617889404,-1.0079680681228638,-1.0039840936660767,-1,-0.9960159659385681,-0.9920318722724915,-0.9880478382110596,-0.9840637445449829,-0.980079710483551,-0.9760956168174744,-0.9721115827560425,-0.9681274890899658,-0.9641434550285339,-0.9601593613624573,-0.9561753273010254,-0.9521912336349487,-0.9482071995735168,-0.9442231059074402,-0.9402390718460083,-0.9362549781799316,-0.9322709441184998,-0.9282868504524231,-0.9243028163909912,-0.9203187227249146,-0.9163346886634827,-0.912350594997406,-0.9083665609359741,-0.9043824672698975,-0.9003984332084656,-0.8964143395423889,-0.892430305480957,-0.8884462118148804,-0.8844621777534485,-0.8804780840873718,-0.8764940500259399,-0.8725099563598633,-0.8685259222984314,-0.8645418286323547,-0.8605577945709229,-0.8565737009048462,-0.8525896668434143,-0.8486055731773376,-0.8446215391159058,-0.8406374454498291,-0.8366534113883972,-0.8326693177223206,-0.8286852836608887,-0.824701189994812,-0.8207171559333801,-0.8167330622673035,-0.8127490282058716,-0.8087649345397949,-0.804780900478363,-0.8007968068122864,-0.7968127727508545,-0.7928286790847778,-0.788844645023346,-0.7848605513572693,-0.7808765172958374,-0.7768924236297607,-0.7729083895683289,-0.7689242959022522,-0.7649402618408203,-0.7609561681747437,-0.7569721341133118,-0.7529880404472351,-0.7490040063858032,-0.7450199127197266,-0.7410358786582947,-0.737051784992218,-0.7330677509307861,-0.7290836572647095,-0.7250996232032776,-0.7211155295372009,-0.717131495475769,-0.7131474018096924,-0.7091633677482605,-0.7051792740821838,-0.701195240020752,-0.6972111463546753,-0.6932271122932434,-0.6892430186271667,-0.6852589845657349,-0.6812748908996582,-0.6772908568382263,-0.6733067631721497,-0.6693227291107178,-0.6653386354446411,-0.6613546013832092,-0.6573705077171326,-0.6533864736557007,-0.649402379989624,-0.6454183459281921,-0.6414342522621155,-0.6374502182006836,-0.6334661245346069,-0.629482090473175,-0.6254979968070984,-0.6215139627456665,-0.6175298690795898,-0.613545835018158,-0.6095617413520813,-0.6055777072906494,-0.6015936136245728,-0.5976095795631409,-0.5936254858970642,-0.5896414518356323,-0.5856573581695557,-0.5816733241081238,-0.5776892304420471,-0.5737051963806152,-0.5697211027145386,-0.5657370686531067,-0.56175297498703,-0.5577689409255981,-0.5537848472595215,-0.5498008131980896,-0.5458167195320129,-0.541832685470581,-0.5378485918045044,-0.5338645577430725,-0.5298804640769958,-0.525896430015564,-0.5219123363494873,-0.5179283022880554,-0.5139442086219788,-0.5099601745605469,-0.5059760808944702,-0.5019920468330383,-0.49800798296928406,-0.4940239191055298,-0.4900398552417755,-0.48605579137802124,-0.48207172751426697,-0.4780876636505127,-0.4741035997867584,-0.47011953592300415,-0.4661354720592499,-0.4621514081954956,-0.45816734433174133,-0.45418328046798706,-0.4501992166042328,-0.4462151527404785,-0.44223108887672424,-0.43824702501296997,-0.4342629611492157,-0.4302788972854614,-0.42629483342170715,-0.4223107695579529,-0.4183267056941986,-0.41434264183044434,-0.41035857796669006,-0.4063745141029358,-0.4023904502391815,-0.39840638637542725,-0.394422322511673,-0.3904382586479187,-0.38645419478416443,-0.38247013092041016,-0.3784860670566559,-0.3745020031929016,-0.37051793932914734,-0.36653387546539307,-0.3625498116016388,-0.3585657477378845,-0.35458168387413025,-0.350597620010376,-0.3466135561466217,-0.34262949228286743,-0.33864542841911316,-0.3346613645553589,-0.3306773006916046,-0.32669323682785034,-0.32270917296409607,-0.3187251091003418,-0.3147410452365875,-0.31075698137283325,-0.306772917509079,-0.3027888536453247,-0.29880478978157043,-0.29482072591781616,-0.2908366620540619,-0.2868525981903076,-0.28286853432655334,-0.2788844704627991,-0.2749004065990448,-0.2709163427352905,-0.26693227887153625,-0.262948215007782,-0.2589641511440277,-0.25498008728027344,-0.25099602341651917,-0.2470119595527649,-0.24302789568901062,-0.23904383182525635,-0.23505976796150208,-0.2310757040977478,-0.22709164023399353,-0.22310757637023926,-0.21912351250648499,-0.2151394486427307,-0.21115538477897644,-0.20717132091522217,-0.2031872570514679,-0.19920319318771362,-0.19521912932395935,-0.19123506546020508,-0.1872510015964508,-0.18326693773269653,-0.17928287386894226,-0.175298810005188,-0.17131474614143372,-0.16733068227767944,-0.16334661841392517,-0.1593625545501709,-0.15537849068641663,-0.15139442682266235,-0.14741036295890808,-0.1434262990951538,-0.13944223523139954,-0.13545817136764526,-0.131474107503891,-0.12749004364013672,-0.12350597977638245,-0.11952191591262817,-0.1155378520488739,-0.11155378818511963,-0.10756972432136536,-0.10358566045761108,-0.09960159659385681,-0.09561753273010254,-0.09163346886634827,-0.087649405002594,-0.08366534113883972,-0.07968127727508545,-0.07569721341133118,-0.0717131495475769,-0.06772908568382263,-0.06374502182006836,-0.05976095795631409,-0.055776894092559814,-0.05179283022880554,-0.04780876636505127,-0.043824702501297,-0.039840638637542725,-0.03585657477378845,-0.03187251091003418,-0.027888447046279907,-0.023904383182525635,-0.019920319318771362,-0.01593625545501709,-0.011952191591262817,-0.007968127727508545,-0.0039840638637542725,0],"expected":[8,0,0,7.952191352844238,7.936254978179932,7.920318603515625,0,0,7.872509956359863,0,7.840637683868408,7.824701309204102,7.808764934539795,0,7.77689266204834,0,0,7.72908353805542,0,7.697211265563965,7.681274890899658,0,0,0,0,7.601593494415283,0,7.569721221923828,0,7.537848472595215,7.521912574768066,0,0,7.4741034507751465,7.458167552947998,0,7.426294803619385,0,7.39442253112793,0,0,0,7.330677509307861,0,0,7.282868385314941,0,0,7.23505973815918,0,0,7.187251091003418,7.171314716339111,0,7.139442443847656,7.12350606918335,0,0,7.075697422027588,0,7.043824672698975,7.027888298034668,0,0,6.980079650878906,6.9641432762146,6.948207378387451,6.9322710037231445,0,0,0,6.868525981903076,0,6.836653232574463,6.8207173347473145,6.804780960083008,6.788844585418701,0,0,0,0,6.709163188934326,0,0,6.6613545417785645,6.645418167114258,6.629482269287109,6.613545894622803,0,0,6.565737247467041,6.549800872802734,0,0,6.501992225646973,6.486055850982666,6.470119476318359,0,6.438247203826904,0,0,0,0,6.358565807342529,0,6.326693058013916,6.310757160186768,6.294820785522461,0,0,6.247012138366699,0,0,0,6.183267116546631,0,6.151394367218018,0,0,6.103585720062256,0,6.071712970733643,6.055777072906494,6.0398406982421875,0,0,0,5.976095676422119,0,5.944222927093506,0,5.912350654602051,0,5.8804779052734375,5.864542007446289,5.848605632781982,5.832669258117676,0,5.800796985626221,0,5.768924236297607,5.752987861633301,5.737051963806152,5.721115589141846,0,0,5.673306941986084,5.657370567321777,0,5.625497817993164,0,0,0,0,5.545816898345947,0,5.513944149017334,0,0,0,0,0,5.4183268547058105,0,0,5.370517730712891,5.354581832885742,0,5.322709083557129,0,5.290836811065674,5.274900436401367,0,5.243027687072754,0,5.211155414581299,5.195219039916992,0,0,0,5.131474018096924,0,5.099601745605469,5.083665370941162,5.0677289962768555,5.051792621612549,0,0,5.003983974456787,0,4.972111701965332,4.956175327301025,4.940238952636719,0,0,0,0,4.860557556152344,4.844621658325195,4.828685283660889,4.812748908996582,0,0,0,0,0,0,4.701195240020752,0,4.669322490692139,0,0,0,0,0,4.573705196380615,0,0,0,0,0,4.478087425231934,0,0,4.430278778076172,0,0,0,4.3665337562561035,4.350597381591797,4.334661483764648,4.318725109100342,4.302788734436035,4.2868523597717285,0,4.254980087280273,0,4.22310733795166,0,0,0,0,0,0,0,0,0,4.063745021820068,0,4.031872272491455,0,4,-0.007936323061585426,-0.015809273347258568,-0.02361861616373062,3.904890298843384,3.8812718391418457,-0.04666592553257942,-0.05422130599617958,3.8107967376708984,-0.06914170831441879,3.7641305923461914,-0.08380813896656036,3.7177188396453857,3.694607973098755,-0.1053316667675972,3.6485772132873535,-0.11936318874359131,3.602800130844116,3.5800065994262695,3.557276964187622,-0.1466643363237381,3.512007713317871,3.489468574523926,3.4669928550720215,3.444580316543579,3.422231674194336,-0.1857113391160965,3.3777244091033936,-0.19821907579898834,3.3334708213806152,-0.21047285199165344,-0.21650445461273193,-0.2224726676940918,-0.22837728261947632,3.2239487171173096,3.202234983444214,-0.24571038782596588,-0.25136104226112366,-0.256948322057724,-0.262472003698349,-0.267932265996933,-0.273328959941864,3.0520148277282715,-0.2839319705963135,-0.2891382873058319,-0.294281005859375,-0.29936033487319946,-0.30437609553337097,-0.30932843685150146,-0.314217209815979,-0.3190425634384155,2.8634467124938965,2.8428120613098145,-0.33313754200935364,-0.3377089202404022,2.7812893390655518,-0.34666118025779724,2.740591526031494,2.7203376293182373,2.7001476287841797,2.680020809173584,2.6599578857421875,2.639958143234253,-0.3759939968585968,-0.3799304962158203,-0.3838033974170685,-0.387612909078598,2.54091215133667,2.5212931632995605,-0.3986603319644928,2.4822463989257812,2.462818145751953,2.443453311920166,-0.41250136494636536,-0.415802925825119,-0.4190409481525421,-0.4222155213356018,2.3475818634033203,-0.42837417125701904,-0.4313582181930542,2.290820837020874,2.2720274925231934,2.2532973289489746,2.234631299972534,2.2160282135009766,-0.44792938232421875,2.1790130138397217,2.1606006622314453,-0.4553578495979309,-0.457707017660141,-0.4599927067756653,2.087585926055908,2.069490909576416,2.051459550857544,-0.4685004949569702,-0.4704686999320984,-0.47237345576286316,-0.47421467304229736,1.9622544050216675,1.9446041584014893,-0.4793574810028076,1.9094935655593872,1.8920334577560425,1.8746370077133179,-0.4853256344795227,1.8400344848632812,-0.4879287779331207,1.8056856393814087,1.7886065244674683,-0.4913572669029236,1.7546387910842896,-0.49332550168037415,1.720924973487854,-0.49503976106643677,1.6874651908874512,1.6708307266235352,1.654259443283081,1.637751817703247,-0.4982143044471741,-0.4986587464809418,-0.4990397095680237,1.572356104850769,1.5561656951904297,1.5400390625,1.5239757299423218,-0.4999920725822449,-0.4999920427799225,1.47616708278656,1.4603577852249146,1.4446121454238892,-0.499357134103775,-0.4990397095680237,-0.49865877628326416,-0.4982143044471741,1.3668354749679565,1.351470708847046,-0.49650007486343384,1.3209315538406372,1.3057571649551392,-0.49421438574790955,-0.49332553148269653,1.2606148719787598,-0.4913572669029236,1.2308377027511597,-0.48913511633872986,-0.4879287779331207,1.186647891998291,-0.4853256344795227,-0.4839288592338562,-0.48246854543685913,-0.4809447228908539,-0.4793574810028076,-0.4777067303657532,1.0857605934143066,-0.47421467304229736,-0.47237345576286316,1.0434755086898804,1.0295075178146362,1.015602946281433,-0.4643735885620117,0.9879843592643738,0.9742703437805176,-0.457707017660141,-0.4553578495979309,-0.4529452323913574,0.9200488924980164,0.9066523313522339,0.8933191895484924,-0.4426596760749817,-0.4399295449256897,0.8537007570266724,-0.43427881598472595,-0.4313582479953766,0.814653754234314,0.8017650842666626,0.788939893245697,0.7761781811714172,-0.415802925825119,0.7508452534675598,0.7382740378379822,0.7257662415504456,-0.402215838432312,0.7009413242340088,0.6886240243911743,0.6763702034950256,-0.387612909078598,0.65205317735672,-0.3799304962158203,0.6279900670051575,-0.37199410796165466,0.6041809320449829,0.5923715829849243,-0.3596133589744568,-0.35535943508148193,0.5573245286941528,0.5457691550254822,-0.342216819524765,-0.3377089202404022,0.5114839673042297,-0.32850271463394165,0.4889446198940277,-0.3190425634384155,-0.3142172396183014,0.45561182498931885,0.44462788105010986,-0.29936033487319946,0.42285045981407166,0.41205695271492004,-0.28393203020095825,-0.2786622643470764,0.3800574839115143,-0.267932265996933,-0.2624720335006714,0.3486293852329254,-0.25136107206344604,0.32799479365348816,0.3177727460861206,0.30761417746543884,-0.2283773273229599,0.2874875068664551,-0.2165045142173767,0.26761478185653687,0.2577736973762512,-0.19821907579898834,0.23828193545341492,0.22863131761550903,0.21904414892196655,0.20952048897743225,0.20006032288074493,0.1906636357307434,-0.15333089232444763,0.1720607727766037,0.16285455226898193,0.15371185541152954,0.14463263750076294,-0.11936318874359131,0.1266646534204483,0.11777590215206146,-0.09822066128253937,-0.09104617685079575,0.09149061143398285,0.08285583555698395,-0.06914176046848297,0.06577673554420471,0.05733242258429527,-0.04666592553257942,-0.0390469990670681,-0.03136458247900009,0.024190092459321022,0.01606323942542076,0.007999873720109463,0]} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/small_positive.json b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/small_positive.json new file mode 100644 index 000000000000..42d5bfc5b47e --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/small_positive.json @@ -0,0 +1 @@ +{"x":[0,0.0039840638637542725,0.007968127727508545,0.011952191591262817,0.01593625545501709,0.019920319318771362,0.023904383182525635,0.027888447046279907,0.03187251091003418,0.03585657477378845,0.039840638637542725,0.043824702501297,0.04780876636505127,0.05179283022880554,0.055776894092559814,0.05976095795631409,0.06374502182006836,0.06772908568382263,0.0717131495475769,0.07569721341133118,0.07968127727508545,0.08366534113883972,0.087649405002594,0.09163346886634827,0.09561753273010254,0.09960159659385681,0.10358566045761108,0.10756972432136536,0.11155378818511963,0.1155378520488739,0.11952191591262817,0.12350597977638245,0.12749004364013672,0.131474107503891,0.13545817136764526,0.13944223523139954,0.1434262990951538,0.14741036295890808,0.15139442682266235,0.15537849068641663,0.1593625545501709,0.16334661841392517,0.16733068227767944,0.17131474614143372,0.175298810005188,0.17928287386894226,0.18326693773269653,0.1872510015964508,0.19123506546020508,0.19521912932395935,0.19920319318771362,0.2031872570514679,0.20717132091522217,0.21115538477897644,0.2151394486427307,0.21912351250648499,0.22310757637023926,0.22709164023399353,0.2310757040977478,0.23505976796150208,0.23904383182525635,0.24302789568901062,0.2470119595527649,0.25099602341651917,0.25498008728027344,0.2589641511440277,0.262948215007782,0.26693227887153625,0.2709163427352905,0.2749004065990448,0.2788844704627991,0.28286853432655334,0.2868525981903076,0.2908366620540619,0.29482072591781616,0.29880478978157043,0.3027888536453247,0.306772917509079,0.31075698137283325,0.3147410452365875,0.3187251091003418,0.32270917296409607,0.32669323682785034,0.3306773006916046,0.3346613645553589,0.33864542841911316,0.34262949228286743,0.3466135561466217,0.350597620010376,0.35458168387413025,0.3585657477378845,0.3625498116016388,0.36653387546539307,0.37051793932914734,0.3745020031929016,0.3784860670566559,0.38247013092041016,0.38645419478416443,0.3904382586479187,0.394422322511673,0.39840638637542725,0.4023904502391815,0.4063745141029358,0.41035857796669006,0.41434264183044434,0.4183267056941986,0.4223107695579529,0.42629483342170715,0.4302788972854614,0.4342629611492157,0.43824702501296997,0.44223108887672424,0.4462151527404785,0.4501992166042328,0.45418328046798706,0.45816734433174133,0.4621514081954956,0.4661354720592499,0.47011953592300415,0.4741035997867584,0.4780876636505127,0.48207172751426697,0.48605579137802124,0.4900398552417755,0.4940239191055298,0.49800798296928406,0.5019920468330383,0.5059760808944702,0.5099601745605469,0.5139442086219788,0.5179283022880554,0.5219123363494873,0.525896430015564,0.5298804640769958,0.5338645577430725,0.5378485918045044,0.541832685470581,0.5458167195320129,0.5498008131980896,0.5537848472595215,0.5577689409255981,0.56175297498703,0.5657370686531067,0.5697211027145386,0.5737051963806152,0.5776892304420471,0.5816733241081238,0.5856573581695557,0.5896414518356323,0.5936254858970642,0.5976095795631409,0.6015936136245728,0.6055777072906494,0.6095617413520813,0.613545835018158,0.6175298690795898,0.6215139627456665,0.6254979968070984,0.629482090473175,0.6334661245346069,0.6374502182006836,0.6414342522621155,0.6454183459281921,0.649402379989624,0.6533864736557007,0.6573705077171326,0.6613546013832092,0.6653386354446411,0.6693227291107178,0.6733067631721497,0.6772908568382263,0.6812748908996582,0.6852589845657349,0.6892430186271667,0.6932271122932434,0.6972111463546753,0.701195240020752,0.7051792740821838,0.7091633677482605,0.7131474018096924,0.717131495475769,0.7211155295372009,0.7250996232032776,0.7290836572647095,0.7330677509307861,0.737051784992218,0.7410358786582947,0.7450199127197266,0.7490040063858032,0.7529880404472351,0.7569721341133118,0.7609561681747437,0.7649402618408203,0.7689242959022522,0.7729083895683289,0.7768924236297607,0.7808765172958374,0.7848605513572693,0.788844645023346,0.7928286790847778,0.7968127727508545,0.8007968068122864,0.804780900478363,0.8087649345397949,0.8127490282058716,0.8167330622673035,0.8207171559333801,0.824701189994812,0.8286852836608887,0.8326693177223206,0.8366534113883972,0.8406374454498291,0.8446215391159058,0.8486055731773376,0.8525896668434143,0.8565737009048462,0.8605577945709229,0.8645418286323547,0.8685259222984314,0.8725099563598633,0.8764940500259399,0.8804780840873718,0.8844621777534485,0.8884462118148804,0.892430305480957,0.8964143395423889,0.9003984332084656,0.9043824672698975,0.9083665609359741,0.912350594997406,0.9163346886634827,0.9203187227249146,0.9243028163909912,0.9282868504524231,0.9322709441184998,0.9362549781799316,0.9402390718460083,0.9442231059074402,0.9482071995735168,0.9521912336349487,0.9561753273010254,0.9601593613624573,0.9641434550285339,0.9681274890899658,0.9721115827560425,0.9760956168174744,0.980079710483551,0.9840637445449829,0.9880478382110596,0.9920318722724915,0.9960159659385681,1,1.0039840936660767,1.0079680681228638,1.0119521617889404,1.015936255455017,1.0199203491210938,1.0239043235778809,1.0278884172439575,1.0318725109100342,1.0358566045761108,1.039840579032898,1.0438246726989746,1.0478087663650513,1.051792860031128,1.055776834487915,1.0597609281539917,1.0637450218200684,1.067729115486145,1.0717130899429321,1.0756971836090088,1.0796812772750854,1.083665370941162,1.0876493453979492,1.0916334390640259,1.0956175327301025,1.0996016263961792,1.1035856008529663,1.107569694519043,1.1115537881851196,1.1155378818511963,1.1195218563079834,1.12350594997406,1.1274900436401367,1.1314741373062134,1.1354581117630005,1.1394422054290771,1.1434262990951538,1.1474103927612305,1.1513943672180176,1.1553784608840942,1.159362554550171,1.1633466482162476,1.1673306226730347,1.1713147163391113,1.175298810005188,1.1792829036712646,1.1832668781280518,1.1872509717941284,1.191235065460205,1.1952191591262817,1.1992031335830688,1.2031872272491455,1.2071713209152222,1.2111554145812988,1.215139389038086,1.2191234827041626,1.2231075763702393,1.227091670036316,1.231075644493103,1.2350597381591797,1.2390438318252563,1.243027925491333,1.2470118999481201,1.2509959936141968,1.2549800872802734,1.25896418094635,1.2629481554031372,1.2669322490692139,1.2709163427352905,1.2749004364013672,1.2788844108581543,1.282868504524231,1.2868525981903076,1.2908366918563843,1.2948206663131714,1.298804759979248,1.3027888536453247,1.3067729473114014,1.3107569217681885,1.3147410154342651,1.3187251091003418,1.3227092027664185,1.3266931772232056,1.3306772708892822,1.3346613645553589,1.3386454582214355,1.3426294326782227,1.3466135263442993,1.350597620010376,1.3545817136764526,1.3585656881332397,1.3625497817993164,1.366533875465393,1.3705179691314697,1.3745019435882568,1.3784860372543335,1.3824701309204102,1.3864542245864868,1.390438199043274,1.3944222927093506,1.3984063863754272,1.402390480041504,1.406374454498291,1.4103585481643677,1.4143426418304443,1.418326735496521,1.422310709953308,1.4262948036193848,1.4302788972854614,1.434262990951538,1.4382469654083252,1.4422310590744019,1.4462151527404785,1.4501992464065552,1.4541832208633423,1.458167314529419,1.4621514081954956,1.4661355018615723,1.4701194763183594,1.474103569984436,1.4780876636505127,1.4820717573165894,1.4860557317733765,1.4900398254394531,1.4940239191055298,1.4980080127716064,1.5019919872283936,1.5059760808944702,1.5099601745605469,1.5139442682266235,1.5179282426834106,1.5219123363494873,1.525896430015564,1.5298805236816406,1.5338644981384277,1.5378485918045044,1.541832685470581,1.5458167791366577,1.5498007535934448,1.5537848472595215,1.5577689409255981,1.5617530345916748,1.565737009048462,1.5697211027145386,1.5737051963806152,1.577689290046692,1.581673264503479,1.5856573581695557,1.5896414518356323,1.593625545501709,1.597609519958496,1.6015936136245728,1.6055777072906494,1.609561800956726,1.6135457754135132,1.6175298690795898,1.6215139627456665,1.6254980564117432,1.6294820308685303,1.633466124534607,1.6374502182006836,1.6414343118667603,1.6454182863235474,1.649402379989624,1.6533864736557007,1.6573705673217773,1.6613545417785645,1.6653386354446411,1.6693227291107178,1.6733068227767944,1.6772907972335815,1.6812748908996582,1.6852589845657349,1.6892430782318115,1.6932270526885986,1.6972111463546753,1.701195240020752,1.7051793336868286,1.7091633081436157,1.7131474018096924,1.717131495475769,1.7211155891418457,1.7250995635986328,1.7290836572647095,1.7330677509307861,1.7370518445968628,1.74103581905365,1.7450199127197266,1.7490040063858032,1.7529881000518799,1.756972074508667,1.7609561681747437,1.7649402618408203,1.768924355506897,1.772908329963684,1.7768924236297607,1.7808765172958374,1.784860610961914,1.7888445854187012,1.7928286790847778,1.7968127727508545,1.8007968664169312,1.8047808408737183,1.808764934539795,1.8127490282058716,1.8167331218719482,1.8207170963287354,1.824701189994812,1.8286852836608887,1.8326693773269653,1.8366533517837524,1.840637445449829,1.8446215391159058,1.8486056327819824,1.8525896072387695,1.8565737009048462,1.8605577945709229,1.8645418882369995,1.8685258626937866,1.8725099563598633,1.87649405002594,1.8804781436920166,1.8844621181488037,1.8884462118148804,1.892430305480957,1.8964143991470337,1.9003983736038208,1.9043824672698975,1.9083665609359741,1.9123506546020508,1.916334629058838,1.9203187227249146,1.9243028163909912,1.9282869100570679,1.932270884513855,1.9362549781799316,1.9402390718460083,1.944223165512085,1.948207139968872,1.9521912336349487,1.9561753273010254,1.960159420967102,1.9641433954238892,1.9681274890899658,1.9721115827560425,1.9760956764221191,1.9800796508789062,1.984063744544983,1.9880478382110596,1.9920319318771362,1.9960159063339233,2],"y":[-1,1,1,-1,1,-1,-1,1,-1,-1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,-1,-1,1,1,1,1,1,-1,-1,1,-1,1,1,-1,1,-1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,-1,1,1,1,1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,1,1,-1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1,-1,1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,1,-1,1,1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,-1,1,-1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,-1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,1,-1,1,-1,1,-1,-1,-1,1,1,-1,-1,-1,1,-1,1,1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,1,-1,-1,1,1,-1,-1,-1,1,1,-1,1,-1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,-1,1,1,1,1,1,-1,-1,-1,1,-1,1,-1,-1,1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,1,-1,1,1,1,-1,1,-1,1,1,1,1,-1,-1,1,-1,1,1,-1,1,1,-1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,-1,1,-1,1,1,-1,-1,-1,1,1,1,1,1,-1,1,1,1,-1,1,1,-1,1,-1,1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,1,1,-1,1,-1,1,1],"p":[0,0.0039840638637542725,0.007968127727508545,0.011952191591262817,0.01593625545501709,0.019920319318771362,0.023904383182525635,0.027888447046279907,0.03187251091003418,0.03585657477378845,0.039840638637542725,0.043824702501297,0.04780876636505127,0.05179283022880554,0.055776894092559814,0.05976095795631409,0.06374502182006836,0.06772908568382263,0.0717131495475769,0.07569721341133118,0.07968127727508545,0.08366534113883972,0.087649405002594,0.09163346886634827,0.09561753273010254,0.09960159659385681,0.10358566045761108,0.10756972432136536,0.11155378818511963,0.1155378520488739,0.11952191591262817,0.12350597977638245,0.12749004364013672,0.131474107503891,0.13545817136764526,0.13944223523139954,0.1434262990951538,0.14741036295890808,0.15139442682266235,0.15537849068641663,0.1593625545501709,0.16334661841392517,0.16733068227767944,0.17131474614143372,0.175298810005188,0.17928287386894226,0.18326693773269653,0.1872510015964508,0.19123506546020508,0.19521912932395935,0.19920319318771362,0.2031872570514679,0.20717132091522217,0.21115538477897644,0.2151394486427307,0.21912351250648499,0.22310757637023926,0.22709164023399353,0.2310757040977478,0.23505976796150208,0.23904383182525635,0.24302789568901062,0.2470119595527649,0.25099602341651917,0.25498008728027344,0.2589641511440277,0.262948215007782,0.26693227887153625,0.2709163427352905,0.2749004065990448,0.2788844704627991,0.28286853432655334,0.2868525981903076,0.2908366620540619,0.29482072591781616,0.29880478978157043,0.3027888536453247,0.306772917509079,0.31075698137283325,0.3147410452365875,0.3187251091003418,0.32270917296409607,0.32669323682785034,0.3306773006916046,0.3346613645553589,0.33864542841911316,0.34262949228286743,0.3466135561466217,0.350597620010376,0.35458168387413025,0.3585657477378845,0.3625498116016388,0.36653387546539307,0.37051793932914734,0.3745020031929016,0.3784860670566559,0.38247013092041016,0.38645419478416443,0.3904382586479187,0.394422322511673,0.39840638637542725,0.4023904502391815,0.4063745141029358,0.41035857796669006,0.41434264183044434,0.4183267056941986,0.4223107695579529,0.42629483342170715,0.4302788972854614,0.4342629611492157,0.43824702501296997,0.44223108887672424,0.4462151527404785,0.4501992166042328,0.45418328046798706,0.45816734433174133,0.4621514081954956,0.4661354720592499,0.47011953592300415,0.4741035997867584,0.4780876636505127,0.48207172751426697,0.48605579137802124,0.4900398552417755,0.4940239191055298,0.49800798296928406,0.5019920468330383,0.5059760808944702,0.5099601745605469,0.5139442086219788,0.5179283022880554,0.5219123363494873,0.525896430015564,0.5298804640769958,0.5338645577430725,0.5378485918045044,0.541832685470581,0.5458167195320129,0.5498008131980896,0.5537848472595215,0.5577689409255981,0.56175297498703,0.5657370686531067,0.5697211027145386,0.5737051963806152,0.5776892304420471,0.5816733241081238,0.5856573581695557,0.5896414518356323,0.5936254858970642,0.5976095795631409,0.6015936136245728,0.6055777072906494,0.6095617413520813,0.613545835018158,0.6175298690795898,0.6215139627456665,0.6254979968070984,0.629482090473175,0.6334661245346069,0.6374502182006836,0.6414342522621155,0.6454183459281921,0.649402379989624,0.6533864736557007,0.6573705077171326,0.6613546013832092,0.6653386354446411,0.6693227291107178,0.6733067631721497,0.6772908568382263,0.6812748908996582,0.6852589845657349,0.6892430186271667,0.6932271122932434,0.6972111463546753,0.701195240020752,0.7051792740821838,0.7091633677482605,0.7131474018096924,0.717131495475769,0.7211155295372009,0.7250996232032776,0.7290836572647095,0.7330677509307861,0.737051784992218,0.7410358786582947,0.7450199127197266,0.7490040063858032,0.7529880404472351,0.7569721341133118,0.7609561681747437,0.7649402618408203,0.7689242959022522,0.7729083895683289,0.7768924236297607,0.7808765172958374,0.7848605513572693,0.788844645023346,0.7928286790847778,0.7968127727508545,0.8007968068122864,0.804780900478363,0.8087649345397949,0.8127490282058716,0.8167330622673035,0.8207171559333801,0.824701189994812,0.8286852836608887,0.8326693177223206,0.8366534113883972,0.8406374454498291,0.8446215391159058,0.8486055731773376,0.8525896668434143,0.8565737009048462,0.8605577945709229,0.8645418286323547,0.8685259222984314,0.8725099563598633,0.8764940500259399,0.8804780840873718,0.8844621777534485,0.8884462118148804,0.892430305480957,0.8964143395423889,0.9003984332084656,0.9043824672698975,0.9083665609359741,0.912350594997406,0.9163346886634827,0.9203187227249146,0.9243028163909912,0.9282868504524231,0.9322709441184998,0.9362549781799316,0.9402390718460083,0.9442231059074402,0.9482071995735168,0.9521912336349487,0.9561753273010254,0.9601593613624573,0.9641434550285339,0.9681274890899658,0.9721115827560425,0.9760956168174744,0.980079710483551,0.9840637445449829,0.9880478382110596,0.9920318722724915,0.9960159659385681,1,1.0039840936660767,1.0079680681228638,1.0119521617889404,1.015936255455017,1.0199203491210938,1.0239043235778809,1.0278884172439575,1.0318725109100342,1.0358566045761108,1.039840579032898,1.0438246726989746,1.0478087663650513,1.051792860031128,1.055776834487915,1.0597609281539917,1.0637450218200684,1.067729115486145,1.0717130899429321,1.0756971836090088,1.0796812772750854,1.083665370941162,1.0876493453979492,1.0916334390640259,1.0956175327301025,1.0996016263961792,1.1035856008529663,1.107569694519043,1.1115537881851196,1.1155378818511963,1.1195218563079834,1.12350594997406,1.1274900436401367,1.1314741373062134,1.1354581117630005,1.1394422054290771,1.1434262990951538,1.1474103927612305,1.1513943672180176,1.1553784608840942,1.159362554550171,1.1633466482162476,1.1673306226730347,1.1713147163391113,1.175298810005188,1.1792829036712646,1.1832668781280518,1.1872509717941284,1.191235065460205,1.1952191591262817,1.1992031335830688,1.2031872272491455,1.2071713209152222,1.2111554145812988,1.215139389038086,1.2191234827041626,1.2231075763702393,1.227091670036316,1.231075644493103,1.2350597381591797,1.2390438318252563,1.243027925491333,1.2470118999481201,1.2509959936141968,1.2549800872802734,1.25896418094635,1.2629481554031372,1.2669322490692139,1.2709163427352905,1.2749004364013672,1.2788844108581543,1.282868504524231,1.2868525981903076,1.2908366918563843,1.2948206663131714,1.298804759979248,1.3027888536453247,1.3067729473114014,1.3107569217681885,1.3147410154342651,1.3187251091003418,1.3227092027664185,1.3266931772232056,1.3306772708892822,1.3346613645553589,1.3386454582214355,1.3426294326782227,1.3466135263442993,1.350597620010376,1.3545817136764526,1.3585656881332397,1.3625497817993164,1.366533875465393,1.3705179691314697,1.3745019435882568,1.3784860372543335,1.3824701309204102,1.3864542245864868,1.390438199043274,1.3944222927093506,1.3984063863754272,1.402390480041504,1.406374454498291,1.4103585481643677,1.4143426418304443,1.418326735496521,1.422310709953308,1.4262948036193848,1.4302788972854614,1.434262990951538,1.4382469654083252,1.4422310590744019,1.4462151527404785,1.4501992464065552,1.4541832208633423,1.458167314529419,1.4621514081954956,1.4661355018615723,1.4701194763183594,1.474103569984436,1.4780876636505127,1.4820717573165894,1.4860557317733765,1.4900398254394531,1.4940239191055298,1.4980080127716064,1.5019919872283936,1.5059760808944702,1.5099601745605469,1.5139442682266235,1.5179282426834106,1.5219123363494873,1.525896430015564,1.5298805236816406,1.5338644981384277,1.5378485918045044,1.541832685470581,1.5458167791366577,1.5498007535934448,1.5537848472595215,1.5577689409255981,1.5617530345916748,1.565737009048462,1.5697211027145386,1.5737051963806152,1.577689290046692,1.581673264503479,1.5856573581695557,1.5896414518356323,1.593625545501709,1.597609519958496,1.6015936136245728,1.6055777072906494,1.609561800956726,1.6135457754135132,1.6175298690795898,1.6215139627456665,1.6254980564117432,1.6294820308685303,1.633466124534607,1.6374502182006836,1.6414343118667603,1.6454182863235474,1.649402379989624,1.6533864736557007,1.6573705673217773,1.6613545417785645,1.6653386354446411,1.6693227291107178,1.6733068227767944,1.6772907972335815,1.6812748908996582,1.6852589845657349,1.6892430782318115,1.6932270526885986,1.6972111463546753,1.701195240020752,1.7051793336868286,1.7091633081436157,1.7131474018096924,1.717131495475769,1.7211155891418457,1.7250995635986328,1.7290836572647095,1.7330677509307861,1.7370518445968628,1.74103581905365,1.7450199127197266,1.7490040063858032,1.7529881000518799,1.756972074508667,1.7609561681747437,1.7649402618408203,1.768924355506897,1.772908329963684,1.7768924236297607,1.7808765172958374,1.784860610961914,1.7888445854187012,1.7928286790847778,1.7968127727508545,1.8007968664169312,1.8047808408737183,1.808764934539795,1.8127490282058716,1.8167331218719482,1.8207170963287354,1.824701189994812,1.8286852836608887,1.8326693773269653,1.8366533517837524,1.840637445449829,1.8446215391159058,1.8486056327819824,1.8525896072387695,1.8565737009048462,1.8605577945709229,1.8645418882369995,1.8685258626937866,1.8725099563598633,1.87649405002594,1.8804781436920166,1.8844621181488037,1.8884462118148804,1.892430305480957,1.8964143991470337,1.9003983736038208,1.9043824672698975,1.9083665609359741,1.9123506546020508,1.916334629058838,1.9203187227249146,1.9243028163909912,1.9282869100570679,1.932270884513855,1.9362549781799316,1.9402390718460083,1.944223165512085,1.948207139968872,1.9521912336349487,1.9561753273010254,1.960159420967102,1.9641433954238892,1.9681274890899658,1.9721115827560425,1.9760956764221191,1.9800796508789062,1.984063744544983,1.9880478382110596,1.9920319318771362,1.9960159063339233,2],"expected":[0,-0.007936381734907627,-0.015809273347258568,0.024190092459321022,-0.03136458247900009,0.04063427820801735,0.04895160347223282,-0.054221365600824356,0.06577673554420471,0.07428453862667084,-0.07650672644376755,-0.08380819857120514,0.10018888860940933,0.1089506596326828,0.11777590215206146,-0.11237917840480804,0.13561689853668213,0.14463263750076294,0.15371185541152954,-0.13993430137634277,0.1720607727766037,-0.15333089232444763,0.1906636357307434,0.20006032288074493,0.20952048897743225,0.21904414892196655,0.22863131761550903,-0.1919969618320465,0.24799607694149017,0.2577736973762512,-0.21047285199165344,-0.2165045142173767,-0.2224726676940918,-0.2283773273229599,-0.2342185080051422,0.3177727460861206,0.32799479365348816,-0.25136107206344604,0.3486293852329254,-0.2624720335006714,0.3695179522037506,0.3800574839115143,0.39066049456596375,0.4013269543647766,0.41205695271492004,0.42285045981407166,0.4337073862552643,-0.30437612533569336,0.45561182498931885,0.466659277677536,0.47777023911476135,-0.32380440831184387,0.500182569026947,0.5114839673042297,-0.3377089202404022,-0.342216819524765,0.5457691550254822,0.5573245286941528,0.5689433813095093,-0.3596133589744568,-0.3638037443161011,-0.36793065071105957,-0.37199410796165466,-0.3759940564632416,0.6399898529052734,0.65205317735672,-0.387612909078598,0.6763702034950256,-0.3950413465499878,-0.3986603319644928,0.7133219838142395,-0.40570786595344543,0.7382740378379822,-0.41250136494636536,-0.415802925825119,-0.4190409779548645,0.788939893245697,0.8017650842666626,0.814653754234314,-0.4313582479953766,0.8406215906143188,0.8537007570266724,0.8668434619903564,-0.4426596760749817,-0.4453262686729431,-0.44792938232421875,0.9200488924980164,-0.4529452323913574,-0.4553578495979309,-0.457707017660141,-0.4599927067756653,0.9879843592643738,-0.4643735885620117,-0.46646878123283386,1.0295075178146362,-0.47046875953674316,-0.47237345576286316,1.0716021060943604,-0.47599244117736816,1.099982500076294,1.1142680644989014,1.1286170482635498,1.1430294513702393,1.1575055122375488,-0.4853256344795227,1.186647891998291,-0.4879287779331207,1.2160441875457764,-0.4902779459953308,-0.4913572669029236,-0.49237313866615295,-0.49332553148269653,1.2906461954116821,-0.4950397312641144,-0.4958016574382782,1.3361692428588867,-0.4971349537372589,1.3668354749679565,1.3822637796401978,1.3977556228637695,1.4133110046386719,-0.499357134103775,-0.49961110949516296,1.4603577852249146,1.47616708278656,1.4920399188995361,-0.4999920725822449,-0.4999285638332367,-0.4998015761375427,1.5561656951904297,1.572356104850769,-0.4990397095680237,1.6049269437789917,-0.4982143044471741,-0.4977063834667206,-0.4971349537372589,1.6708307266235352,1.6874651908874512,-0.49503976106643677,1.720924973487854,1.7377502918243408,-0.49237313866615295,-0.4913572669029236,1.7886065244674683,-0.48913508653640747,1.8228280544281006,1.8400344848632812,1.8573038578033447,1.8746370077133179,1.8920334577560425,1.9094935655593872,-0.4793574810028076,-0.4777067005634308,1.9622544050216675,1.9799686670303345,-0.47237345576286316,-0.4704686999320984,2.033491611480713,-0.46646878123283386,2.069490909576416,-0.4622148871421814,2.1057441234588623,2.1239664554595947,2.14225172996521,2.1606006622314453,-0.450469046831131,-0.44792938232421875,-0.4453262686729431,2.234631299972534,-0.4399295449256897,2.2720274925231934,2.290820837020874,2.309677839279175,-0.42837417125701904,2.3475818634033203,2.366629123687744,2.385740041732788,-0.415802925825119,-0.41250136494636536,2.443453311920166,-0.40570783615112305,2.4822463989257812,2.5017380714416504,-0.3950413465499878,-0.3913588523864746,2.560594081878662,-0.3838033974170685,-0.3799304962158203,-0.3759939968585968,-0.37199410796165466,2.6599578857421875,-0.3638037443161011,-0.3596133291721344,2.7203376293182373,2.740591526031494,-0.34666118025779724,2.7812893390655518,2.8017332553863525,2.8222408294677734,-0.32850271463394165,-0.3238043487071991,-0.3190425634384155,2.9049065113067627,-0.30932843685150146,-0.30437609553337097,2.967571973800659,-0.294281005859375,3.0096664428710938,3.030809164047241,-0.2786622643470764,-0.273328959941864,-0.267932265996933,-0.262472003698349,3.1374740600585938,3.1589975357055664,3.18058443069458,-0.23999615013599396,3.2239487171173096,3.2457265853881836,-0.2224726676940918,3.2894716262817383,-0.21047285199165344,-0.2043776661157608,-0.19821907579898834,-0.19199691712856293,-0.1857113391160965,-0.1793621927499771,-0.1729496419429779,-0.16647350788116455,-0.15993396937847137,3.512007713317871,3.5346105098724365,-0.139934241771698,-0.13314074277877808,3.602800130844116,3.625656843185425,3.6485772132873535,3.671560764312744,3.694607973098755,3.7177188396453857,-0.08380813896656036,-0.07650672644376755,-0.06914170831441879,3.8107967376708984,-0.05422130599617958,3.8577165603637695,-0.03904694318771362,-0.03136458247900009,3.928572654724121,3.9523181915283203,-0.007936323061585426,4,0,4.031872272491455,4.047808647155762,4.063745021820068,0,0,0,4.127490043640137,4.143426418304443,0,4.175298690795898,4.191235065460205,0,4.22310733795166,4.239043712615967,4.254980087280273,0,4.2868523597717285,4.302788734436035,0,0,4.350597381591797,0,0,4.398406505584717,4.414342403411865,0,4.4462151527404785,0,4.478087425231934,4.49402379989624,4.509960174560547,0,4.541832447052002,4.557768821716309,0,4.589641571044922,4.60557746887207,0,4.637450218200684,4.65338659286499,4.669322490692139,0,4.701195240020752,4.717131614685059,0,0,4.76494026184082,0,0,4.812748908996582,0,4.844621658325195,4.860557556152344,4.87649393081665,0,4.908366680145264,0,4.940238952636719,0,4.972111701965332,0,5.003983974456787,5.019920349121094,5.0358567237854,0,0,5.083665370941162,5.099601745605469,5.115537643432617,0,5.1474103927612305,0,0,0,0,0,0,5.2589640617370605,0,0,5.306772708892822,5.322709083557129,0,5.354581832885742,5.370517730712891,0,0,5.4183268547058105,5.434262752532959,0,5.466135501861572,5.482071876525879,0,5.513944149017334,5.529880523681641,0,0,5.577689170837402,5.593625545501709,5.609561920166016,0,0,5.657370567321777,0,5.689242839813232,0,5.721115589141846,5.737051963806152,0,0,0,0,5.816732883453369,0,0,5.864542007446289,5.8804779052734375,0,0,0,0,5.9601593017578125,0,5.992032051086426,6.007967948913574,0,0,6.055777072906494,6.071712970733643,0,6.103585720062256,6.1195220947265625,0,0,6.167330741882324,0,6.199203014373779,6.215139389038086,0,6.247012138366699,6.262948036193848,0,0,0,0,0,6.358565807342529,6.374502182006836,6.390438079833984,0,6.422310829162598,0,6.454183101654053,6.470119476318359,0,6.501992225646973,0,0,6.549800872802734,0,0,0,0,6.629482269287109,6.645418167114258,6.6613545417785645,6.677290916442871,0,6.709163188934326,6.725099563598633,0,6.756972312927246,0,0,6.804780960083008,0,0,0,6.868525981903076,0,6.900398254394531,0,0,0,0,6.980079650878906,6.996016025543213,0,7.027888298034668,0,0,7.075697422027588,0,0,7.12350606918335,7.139442443847656,0,0,0,7.203187465667725,0,7.23505973815918,7.250996112823486,0,0,0,7.314741134643555,7.330677509307861,7.34661340713501,0,7.378486156463623,0,0,7.426294803619385,7.442231178283691,7.458167552947998,0,0,0,0,0,7.5537848472595215,0,0,0,7.61752986907959,0,0,7.665338516235352,0,7.697211265563965,0,7.72908353805542,0,7.760956287384033,0,0,7.808764934539795,0,7.840637683868408,7.856573581695557,7.872509956359863,0,0,0,7.936254978179932,0,7.968127727508545,0,0]} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/tiny_negative.json b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/tiny_negative.json new file mode 100644 index 000000000000..55972f4ce50d --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/tiny_negative.json @@ -0,0 +1 @@ +{"x":[-9.999999682655225e-21,-9.980079493294329e-21,-9.960159303933433e-21,-9.940239114572537e-21,-9.920318925211641e-21,-9.900398735850745e-21,-9.880477738696282e-21,-9.860557549335385e-21,-9.840637359974489e-21,-9.820717170613593e-21,-9.800796981252697e-21,-9.7808767918918e-21,-9.760955794737338e-21,-9.741035605376441e-21,-9.721115416015545e-21,-9.701195226654649e-21,-9.681275037293753e-21,-9.661354847932857e-21,-9.64143465857196e-21,-9.621513661417498e-21,-9.601593472056601e-21,-9.581673282695705e-21,-9.561753093334809e-21,-9.541832903973913e-21,-9.521912714613017e-21,-9.501991717458554e-21,-9.482071528097658e-21,-9.462151338736761e-21,-9.442231149375865e-21,-9.422310960014969e-21,-9.402390770654073e-21,-9.38246977349961e-21,-9.362549584138714e-21,-9.342629394777818e-21,-9.322709205416921e-21,-9.302789016056025e-21,-9.282868826695129e-21,-9.262947829540666e-21,-9.24302764017977e-21,-9.223107450818874e-21,-9.203187261457978e-21,-9.183267072097081e-21,-9.163346882736185e-21,-9.143426693375289e-21,-9.123505696220826e-21,-9.10358550685993e-21,-9.083665317499034e-21,-9.063745128138137e-21,-9.043824938777241e-21,-9.023904749416345e-21,-9.003983752261882e-21,-8.984063562900986e-21,-8.96414337354009e-21,-8.944223184179194e-21,-8.924302994818297e-21,-8.904382805457401e-21,-8.884461808302938e-21,-8.864541618942042e-21,-8.844621429581146e-21,-8.82470124022025e-21,-8.804781050859354e-21,-8.784860861498457e-21,-8.764939864343994e-21,-8.745019674983098e-21,-8.725099485622202e-21,-8.705179296261306e-21,-8.68525910690041e-21,-8.665338917539514e-21,-8.645418728178617e-21,-8.625497731024154e-21,-8.605577541663258e-21,-8.585657352302362e-21,-8.565737162941466e-21,-8.54581697358057e-21,-8.525896784219674e-21,-8.50597578706521e-21,-8.486055597704314e-21,-8.466135408343418e-21,-8.446215218982522e-21,-8.426295029621626e-21,-8.40637484026073e-21,-8.386453843106267e-21,-8.36653365374537e-21,-8.346613464384474e-21,-8.326693275023578e-21,-8.306773085662682e-21,-8.286852896301786e-21,-8.266931899147323e-21,-8.247011709786427e-21,-8.22709152042553e-21,-8.207171331064634e-21,-8.187251141703738e-21,-8.167330952342842e-21,-8.147409955188379e-21,-8.127489765827483e-21,-8.107569576466586e-21,-8.08764938710569e-21,-8.067729197744794e-21,-8.047809008383898e-21,-8.027888819023002e-21,-8.007967821868539e-21,-7.988047632507643e-21,-7.968127443146746e-21,-7.94820725378585e-21,-7.928287064424954e-21,-7.908366875064058e-21,-7.888445877909595e-21,-7.868525688548699e-21,-7.848605499187803e-21,-7.828685309826906e-21,-7.80876512046601e-21,-7.788844931105114e-21,-7.768923933950651e-21,-7.749003744589755e-21,-7.729083555228859e-21,-7.709163365867963e-21,-7.689243176507066e-21,-7.66932298714617e-21,-7.649401989991707e-21,-7.629481800630811e-21,-7.609561611269915e-21,-7.589641421909019e-21,-7.569721232548123e-21,-7.549801043187226e-21,-7.52988085382633e-21,-7.509959856671867e-21,-7.490039667310971e-21,-7.470119477950075e-21,-7.450199288589179e-21,-7.430279099228283e-21,-7.410358909867386e-21,-7.390437912712923e-21,-7.370517723352027e-21,-7.350597533991131e-21,-7.330677344630235e-21,-7.310757155269339e-21,-7.290836965908442e-21,-7.27091596875398e-21,-7.250995779393083e-21,-7.231075590032187e-21,-7.211155400671291e-21,-7.191235211310395e-21,-7.171315021949499e-21,-7.151394024795035e-21,-7.13147383543414e-21,-7.111553646073243e-21,-7.091633456712347e-21,-7.071713267351451e-21,-7.051793077990555e-21,-7.031872888629659e-21,-7.011951891475195e-21,-6.9920317021143e-21,-6.972111512753403e-21,-6.952191323392507e-21,-6.932271134031611e-21,-6.912350944670715e-21,-6.892429947516252e-21,-6.872509758155355e-21,-6.85258956879446e-21,-6.832669379433563e-21,-6.812749190072667e-21,-6.792829000711771e-21,-6.772908407454091e-21,-6.752988218093195e-21,-6.7330676248355154e-21,-6.713147435474619e-21,-6.693227246113723e-21,-6.6733066528560435e-21,-6.653386463495147e-21,-6.633466274134251e-21,-6.6135456808765715e-21,-6.5936254915156754e-21,-6.573705302154779e-21,-6.5537847088970996e-21,-6.5338645195362034e-21,-6.513944330175307e-21,-6.494023736917628e-21,-6.4741035475567315e-21,-6.454183358195835e-21,-6.434262764938156e-21,-6.4143425755772596e-21,-6.3944223862163634e-21,-6.374501792958684e-21,-6.354581603597788e-21,-6.3346614142368915e-21,-6.314741224875995e-21,-6.294820631618316e-21,-6.2749004422574195e-21,-6.2549802528965234e-21,-6.235059659638844e-21,-6.2151394702779476e-21,-6.1952192809170514e-21,-6.175298687659372e-21,-6.155378498298476e-21,-6.1354583089375795e-21,-6.1155377156799e-21,-6.095617526319004e-21,-6.0756973369581076e-21,-6.055776743700428e-21,-6.035856554339532e-21,-6.015936364978636e-21,-5.996015771720956e-21,-5.97609558236006e-21,-5.956175392999164e-21,-5.936254799741484e-21,-5.916334610380588e-21,-5.896414421019692e-21,-5.876493827762012e-21,-5.856573638401116e-21,-5.83665344904022e-21,-5.816733259679324e-21,-5.796812666421644e-21,-5.776892477060748e-21,-5.756972287699852e-21,-5.737051694442172e-21,-5.717131505081276e-21,-5.69721131572038e-21,-5.6772907224627e-21,-5.657370533101804e-21,-5.637450343740908e-21,-5.617529750483228e-21,-5.597609561122332e-21,-5.577689371761436e-21,-5.557768778503756e-21,-5.53784858914286e-21,-5.517928399781964e-21,-5.498007806524284e-21,-5.478087617163388e-21,-5.458167427802492e-21,-5.4382468345448124e-21,-5.418326645183916e-21,-5.39840645582302e-21,-5.3784858625653405e-21,-5.358565673204444e-21,-5.338645483843548e-21,-5.318725294482652e-21,-5.2988047012249724e-21,-5.278884511864076e-21,-5.25896432250318e-21,-5.2390437292455004e-21,-5.219123539884604e-21,-5.199203350523708e-21,-5.1792827572660285e-21,-5.159362567905132e-21,-5.139442378544236e-21,-5.1195217852865566e-21,-5.0996015959256604e-21,-5.079681406564764e-21,-5.059760813307085e-21,-5.0398406239461885e-21,-5.019920434585292e-21,-4.999999841327613e-21,-4.9800796519667165e-21,-4.9601594626058204e-21,-4.940238869348141e-21,-4.9203186799872446e-21,-4.9003984906263484e-21,-4.880477897368669e-21,-4.860557708007773e-21,-4.8406375186468765e-21,-4.82071732928598e-21,-4.800796736028301e-21,-4.7808765466674046e-21,-4.7609563573065084e-21,-4.741035764048829e-21,-4.721115574687933e-21,-4.7011953853270365e-21,-4.681274792069357e-21,-4.661354602708461e-21,-4.6414344133475645e-21,-4.621513820089885e-21,-4.601593630728989e-21,-4.5816734413680926e-21,-4.561752848110413e-21,-4.541832658749517e-21,-4.521912469388621e-21,-4.501991876130941e-21,-4.482071686770045e-21,-4.462151497409149e-21,-4.442230904151469e-21,-4.422310714790573e-21,-4.402390525429677e-21,-4.382469932171997e-21,-4.362549742811101e-21,-4.342629553450205e-21,-4.322709364089309e-21,-4.302788770831629e-21,-4.282868581470733e-21,-4.262948392109837e-21,-4.243027798852157e-21,-4.223107609491261e-21,-4.203187420130365e-21,-4.183266826872685e-21,-4.163346637511789e-21,-4.143426448150893e-21,-4.123505854893213e-21,-4.103585665532317e-21,-4.083665476171421e-21,-4.063744882913741e-21,-4.043824693552845e-21,-4.023904504191949e-21,-4.0039839109342694e-21,-3.984063721573373e-21,-3.964143532212477e-21,-3.9442229389547974e-21,-3.924302749593901e-21,-3.904382560233005e-21,-3.8844619669753255e-21,-3.864541777614429e-21,-3.844621588253533e-21,-3.8247009949958536e-21,-3.8047808056349574e-21,-3.784860616274061e-21,-3.764940426913165e-21,-3.7450198336554855e-21,-3.725099644294589e-21,-3.705179454933693e-21,-3.6852588616760135e-21,-3.6653386723151174e-21,-3.645418482954221e-21,-3.6254978896965416e-21,-3.6055777003356455e-21,-3.585657510974749e-21,-3.56573691771707e-21,-3.5458167283561735e-21,-3.525896538995277e-21,-3.505975945737598e-21,-3.4860557563767016e-21,-3.4661355670158054e-21,-3.446214973758126e-21,-3.42629478439723e-21,-3.4063745950363335e-21,-3.3864542037270456e-21,-3.3665338124177577e-21,-3.3466136230568615e-21,-3.3266932317475737e-21,-3.3067728404382858e-21,-3.2868526510773896e-21,-3.2669322597681017e-21,-3.247011868458814e-21,-3.2270916790979177e-21,-3.2071712877886298e-21,-3.187250896479342e-21,-3.1673307071184457e-21,-3.147410315809158e-21,-3.1274901264482617e-21,-3.1075697351389738e-21,-3.087649343829686e-21,-3.0677291544687898e-21,-3.047808763159502e-21,-3.027888371850214e-21,-3.007968182489318e-21,-2.98804779118003e-21,-2.968127399870742e-21,-2.948207210509846e-21,-2.928286819200558e-21,-2.908366629839662e-21,-2.888446238530374e-21,-2.868525847221086e-21,-2.84860565786019e-21,-2.828685266550902e-21,-2.808764875241614e-21,-2.788844685880718e-21,-2.76892429457143e-21,-2.749003903262142e-21,-2.729083713901246e-21,-2.709163322591958e-21,-2.6892429312826702e-21,-2.669322741921774e-21,-2.6494023506124862e-21,-2.62948216125159e-21,-2.609561769942302e-21,-2.5896413786330143e-21,-2.569721189272118e-21,-2.5498007979628302e-21,-2.5298804066535423e-21,-2.509960217292646e-21,-2.4900398259833583e-21,-2.4701194346740704e-21,-2.4501992453131742e-21,-2.4302788540038863e-21,-2.41035866464299e-21,-2.3904382733337023e-21,-2.3705178820244144e-21,-2.3505976926635182e-21,-2.3306773013542303e-21,-2.3107569100449425e-21,-2.2908367206840463e-21,-2.2709163293747584e-21,-2.2509959380654705e-21,-2.2310757487045744e-21,-2.2111553573952865e-21,-2.1912349660859986e-21,-2.1713147767251024e-21,-2.1513943854158145e-21,-2.1314741960549184e-21,-2.1115538047456305e-21,-2.0916334134363426e-21,-2.0717132240754464e-21,-2.0517928327661586e-21,-2.0318724414568707e-21,-2.0119522520959745e-21,-1.9920318607866866e-21,-1.9721114694773987e-21,-1.9521912801165026e-21,-1.9322708888072147e-21,-1.9123504974979268e-21,-1.8924303081370306e-21,-1.8725099168277427e-21,-1.8525897274668466e-21,-1.8326693361575587e-21,-1.8127489448482708e-21,-1.7928287554873746e-21,-1.7729083641780868e-21,-1.752987972868799e-21,-1.7330677835079027e-21,-1.713147392198615e-21,-1.6932271018635228e-21,-1.6733068115284308e-21,-1.6533864202191429e-21,-1.6334661298840509e-21,-1.6135458395489588e-21,-1.593625448239671e-21,-1.573705157904579e-21,-1.5537848675694869e-21,-1.5338645772343949e-21,-1.513944185925107e-21,-1.494023895590015e-21,-1.474103605254923e-21,-1.454183314919831e-21,-1.434262923610543e-21,-1.414342633275451e-21,-1.394422342940359e-21,-1.374501951631071e-21,-1.354581661295979e-21,-1.334661370960887e-21,-1.314741080625795e-21,-1.2948206893165071e-21,-1.2749003989814151e-21,-1.254980108646323e-21,-1.2350597173370352e-21,-1.2151394270019432e-21,-1.1952191366668511e-21,-1.1752988463317591e-21,-1.1553784550224712e-21,-1.1354581646873792e-21,-1.1155378743522872e-21,-1.0956174830429993e-21,-1.0756971927079073e-21,-1.0557769023728152e-21,-1.0358566120377232e-21,-1.0159362207284353e-21,-9.960159303933433e-22,-9.760956400582513e-22,-9.561752487489634e-22,-9.362549584138714e-22,-9.163346680787793e-22,-8.964143777436873e-22,-8.764939864343994e-22,-8.565736960993074e-22,-8.366534057642154e-22,-8.167330649420254e-22,-7.968127241198355e-22,-7.7689243378474345e-22,-7.569720929625535e-22,-7.370518026274615e-22,-7.171314618052715e-22,-6.972111714701795e-22,-6.772908306479895e-22,-6.573705403128975e-22,-6.3745019949070755e-22,-6.175298586685176e-22,-5.976095683334256e-22,-5.776892275112356e-22,-5.577689371761436e-22,-5.378485963539536e-22,-5.179283060188616e-22,-4.980079651966717e-22,-4.780876243744817e-22,-4.581673340393897e-22,-4.382469932171997e-22,-4.183267028821077e-22,-3.9840636205991774e-22,-3.7848604648127675e-22,-3.5856573090263576e-22,-3.3864541532399477e-22,-3.1872509974535378e-22,-2.988047841667128e-22,-2.788844685880718e-22,-2.589641530094308e-22,-2.3904381218724085e-22,-2.1912349660859986e-22,-1.9920318102995887e-22,-1.7928286545131788e-22,-1.5936254987267689e-22,-1.394422342940359e-22,-1.1952190609362042e-22,-9.960159051497943e-23,-7.968127493633844e-23,-5.976095304681021e-23,-3.984063746816922e-23,-1.992031873408461e-23,0],"y":[-1,1,1,-1,-1,1,1,1,1,1,1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,-1,-1,1,1,1,1,1,1,1,1,-1,-1,1,1,-1,1,1,-1,1,-1,1,-1,1,1,1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,-1,1,-1,1,1,1,1,-1,-1,1,-1,1,-1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,-1,1,1,1,-1,-1,1,1,-1,1,-1,1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,1,1,-1,1,1,-1,1,1,-1,1,-1,1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,-1,1,-1,1,-1,1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,1,1,-1,1,-1,1,1,1,-1,-1,1,1,-1,1,-1,1,1,-1,-1,1,-1,-1,-1,1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,1,-1,-1,1,-1,1,1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,1,1,1,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,-1,1,1,1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,-1,-1,-1,1,-1,1,1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,1,1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,-1,1,1,1,1,1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,-1,1,1,1,1,-1,-1,-1,1,1,-1,1,-1,1,-1,1,-1,1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,1,-1,-1,1,1,1,-1,1,1,1,-1,-1,1],"p":[-9.999999682655225e-21,-9.980079493294329e-21,-9.960159303933433e-21,-9.940239114572537e-21,-9.920318925211641e-21,-9.900398735850745e-21,-9.880477738696282e-21,-9.860557549335385e-21,-9.840637359974489e-21,-9.820717170613593e-21,-9.800796981252697e-21,-9.7808767918918e-21,-9.760955794737338e-21,-9.741035605376441e-21,-9.721115416015545e-21,-9.701195226654649e-21,-9.681275037293753e-21,-9.661354847932857e-21,-9.64143465857196e-21,-9.621513661417498e-21,-9.601593472056601e-21,-9.581673282695705e-21,-9.561753093334809e-21,-9.541832903973913e-21,-9.521912714613017e-21,-9.501991717458554e-21,-9.482071528097658e-21,-9.462151338736761e-21,-9.442231149375865e-21,-9.422310960014969e-21,-9.402390770654073e-21,-9.38246977349961e-21,-9.362549584138714e-21,-9.342629394777818e-21,-9.322709205416921e-21,-9.302789016056025e-21,-9.282868826695129e-21,-9.262947829540666e-21,-9.24302764017977e-21,-9.223107450818874e-21,-9.203187261457978e-21,-9.183267072097081e-21,-9.163346882736185e-21,-9.143426693375289e-21,-9.123505696220826e-21,-9.10358550685993e-21,-9.083665317499034e-21,-9.063745128138137e-21,-9.043824938777241e-21,-9.023904749416345e-21,-9.003983752261882e-21,-8.984063562900986e-21,-8.96414337354009e-21,-8.944223184179194e-21,-8.924302994818297e-21,-8.904382805457401e-21,-8.884461808302938e-21,-8.864541618942042e-21,-8.844621429581146e-21,-8.82470124022025e-21,-8.804781050859354e-21,-8.784860861498457e-21,-8.764939864343994e-21,-8.745019674983098e-21,-8.725099485622202e-21,-8.705179296261306e-21,-8.68525910690041e-21,-8.665338917539514e-21,-8.645418728178617e-21,-8.625497731024154e-21,-8.605577541663258e-21,-8.585657352302362e-21,-8.565737162941466e-21,-8.54581697358057e-21,-8.525896784219674e-21,-8.50597578706521e-21,-8.486055597704314e-21,-8.466135408343418e-21,-8.446215218982522e-21,-8.426295029621626e-21,-8.40637484026073e-21,-8.386453843106267e-21,-8.36653365374537e-21,-8.346613464384474e-21,-8.326693275023578e-21,-8.306773085662682e-21,-8.286852896301786e-21,-8.266931899147323e-21,-8.247011709786427e-21,-8.22709152042553e-21,-8.207171331064634e-21,-8.187251141703738e-21,-8.167330952342842e-21,-8.147409955188379e-21,-8.127489765827483e-21,-8.107569576466586e-21,-8.08764938710569e-21,-8.067729197744794e-21,-8.047809008383898e-21,-8.027888819023002e-21,-8.007967821868539e-21,-7.988047632507643e-21,-7.968127443146746e-21,-7.94820725378585e-21,-7.928287064424954e-21,-7.908366875064058e-21,-7.888445877909595e-21,-7.868525688548699e-21,-7.848605499187803e-21,-7.828685309826906e-21,-7.80876512046601e-21,-7.788844931105114e-21,-7.768923933950651e-21,-7.749003744589755e-21,-7.729083555228859e-21,-7.709163365867963e-21,-7.689243176507066e-21,-7.66932298714617e-21,-7.649401989991707e-21,-7.629481800630811e-21,-7.609561611269915e-21,-7.589641421909019e-21,-7.569721232548123e-21,-7.549801043187226e-21,-7.52988085382633e-21,-7.509959856671867e-21,-7.490039667310971e-21,-7.470119477950075e-21,-7.450199288589179e-21,-7.430279099228283e-21,-7.410358909867386e-21,-7.390437912712923e-21,-7.370517723352027e-21,-7.350597533991131e-21,-7.330677344630235e-21,-7.310757155269339e-21,-7.290836965908442e-21,-7.27091596875398e-21,-7.250995779393083e-21,-7.231075590032187e-21,-7.211155400671291e-21,-7.191235211310395e-21,-7.171315021949499e-21,-7.151394024795035e-21,-7.13147383543414e-21,-7.111553646073243e-21,-7.091633456712347e-21,-7.071713267351451e-21,-7.051793077990555e-21,-7.031872888629659e-21,-7.011951891475195e-21,-6.9920317021143e-21,-6.972111512753403e-21,-6.952191323392507e-21,-6.932271134031611e-21,-6.912350944670715e-21,-6.892429947516252e-21,-6.872509758155355e-21,-6.85258956879446e-21,-6.832669379433563e-21,-6.812749190072667e-21,-6.792829000711771e-21,-6.772908407454091e-21,-6.752988218093195e-21,-6.7330676248355154e-21,-6.713147435474619e-21,-6.693227246113723e-21,-6.6733066528560435e-21,-6.653386463495147e-21,-6.633466274134251e-21,-6.6135456808765715e-21,-6.5936254915156754e-21,-6.573705302154779e-21,-6.5537847088970996e-21,-6.5338645195362034e-21,-6.513944330175307e-21,-6.494023736917628e-21,-6.4741035475567315e-21,-6.454183358195835e-21,-6.434262764938156e-21,-6.4143425755772596e-21,-6.3944223862163634e-21,-6.374501792958684e-21,-6.354581603597788e-21,-6.3346614142368915e-21,-6.314741224875995e-21,-6.294820631618316e-21,-6.2749004422574195e-21,-6.2549802528965234e-21,-6.235059659638844e-21,-6.2151394702779476e-21,-6.1952192809170514e-21,-6.175298687659372e-21,-6.155378498298476e-21,-6.1354583089375795e-21,-6.1155377156799e-21,-6.095617526319004e-21,-6.0756973369581076e-21,-6.055776743700428e-21,-6.035856554339532e-21,-6.015936364978636e-21,-5.996015771720956e-21,-5.97609558236006e-21,-5.956175392999164e-21,-5.936254799741484e-21,-5.916334610380588e-21,-5.896414421019692e-21,-5.876493827762012e-21,-5.856573638401116e-21,-5.83665344904022e-21,-5.816733259679324e-21,-5.796812666421644e-21,-5.776892477060748e-21,-5.756972287699852e-21,-5.737051694442172e-21,-5.717131505081276e-21,-5.69721131572038e-21,-5.6772907224627e-21,-5.657370533101804e-21,-5.637450343740908e-21,-5.617529750483228e-21,-5.597609561122332e-21,-5.577689371761436e-21,-5.557768778503756e-21,-5.53784858914286e-21,-5.517928399781964e-21,-5.498007806524284e-21,-5.478087617163388e-21,-5.458167427802492e-21,-5.4382468345448124e-21,-5.418326645183916e-21,-5.39840645582302e-21,-5.3784858625653405e-21,-5.358565673204444e-21,-5.338645483843548e-21,-5.318725294482652e-21,-5.2988047012249724e-21,-5.278884511864076e-21,-5.25896432250318e-21,-5.2390437292455004e-21,-5.219123539884604e-21,-5.199203350523708e-21,-5.1792827572660285e-21,-5.159362567905132e-21,-5.139442378544236e-21,-5.1195217852865566e-21,-5.0996015959256604e-21,-5.079681406564764e-21,-5.059760813307085e-21,-5.0398406239461885e-21,-5.019920434585292e-21,-4.999999841327613e-21,-4.9800796519667165e-21,-4.9601594626058204e-21,-4.940238869348141e-21,-4.9203186799872446e-21,-4.9003984906263484e-21,-4.880477897368669e-21,-4.860557708007773e-21,-4.8406375186468765e-21,-4.82071732928598e-21,-4.800796736028301e-21,-4.7808765466674046e-21,-4.7609563573065084e-21,-4.741035764048829e-21,-4.721115574687933e-21,-4.7011953853270365e-21,-4.681274792069357e-21,-4.661354602708461e-21,-4.6414344133475645e-21,-4.621513820089885e-21,-4.601593630728989e-21,-4.5816734413680926e-21,-4.561752848110413e-21,-4.541832658749517e-21,-4.521912469388621e-21,-4.501991876130941e-21,-4.482071686770045e-21,-4.462151497409149e-21,-4.442230904151469e-21,-4.422310714790573e-21,-4.402390525429677e-21,-4.382469932171997e-21,-4.362549742811101e-21,-4.342629553450205e-21,-4.322709364089309e-21,-4.302788770831629e-21,-4.282868581470733e-21,-4.262948392109837e-21,-4.243027798852157e-21,-4.223107609491261e-21,-4.203187420130365e-21,-4.183266826872685e-21,-4.163346637511789e-21,-4.143426448150893e-21,-4.123505854893213e-21,-4.103585665532317e-21,-4.083665476171421e-21,-4.063744882913741e-21,-4.043824693552845e-21,-4.023904504191949e-21,-4.0039839109342694e-21,-3.984063721573373e-21,-3.964143532212477e-21,-3.9442229389547974e-21,-3.924302749593901e-21,-3.904382560233005e-21,-3.8844619669753255e-21,-3.864541777614429e-21,-3.844621588253533e-21,-3.8247009949958536e-21,-3.8047808056349574e-21,-3.784860616274061e-21,-3.764940426913165e-21,-3.7450198336554855e-21,-3.725099644294589e-21,-3.705179454933693e-21,-3.6852588616760135e-21,-3.6653386723151174e-21,-3.645418482954221e-21,-3.6254978896965416e-21,-3.6055777003356455e-21,-3.585657510974749e-21,-3.56573691771707e-21,-3.5458167283561735e-21,-3.525896538995277e-21,-3.505975945737598e-21,-3.4860557563767016e-21,-3.4661355670158054e-21,-3.446214973758126e-21,-3.42629478439723e-21,-3.4063745950363335e-21,-3.3864542037270456e-21,-3.3665338124177577e-21,-3.3466136230568615e-21,-3.3266932317475737e-21,-3.3067728404382858e-21,-3.2868526510773896e-21,-3.2669322597681017e-21,-3.247011868458814e-21,-3.2270916790979177e-21,-3.2071712877886298e-21,-3.187250896479342e-21,-3.1673307071184457e-21,-3.147410315809158e-21,-3.1274901264482617e-21,-3.1075697351389738e-21,-3.087649343829686e-21,-3.0677291544687898e-21,-3.047808763159502e-21,-3.027888371850214e-21,-3.007968182489318e-21,-2.98804779118003e-21,-2.968127399870742e-21,-2.948207210509846e-21,-2.928286819200558e-21,-2.908366629839662e-21,-2.888446238530374e-21,-2.868525847221086e-21,-2.84860565786019e-21,-2.828685266550902e-21,-2.808764875241614e-21,-2.788844685880718e-21,-2.76892429457143e-21,-2.749003903262142e-21,-2.729083713901246e-21,-2.709163322591958e-21,-2.6892429312826702e-21,-2.669322741921774e-21,-2.6494023506124862e-21,-2.62948216125159e-21,-2.609561769942302e-21,-2.5896413786330143e-21,-2.569721189272118e-21,-2.5498007979628302e-21,-2.5298804066535423e-21,-2.509960217292646e-21,-2.4900398259833583e-21,-2.4701194346740704e-21,-2.4501992453131742e-21,-2.4302788540038863e-21,-2.41035866464299e-21,-2.3904382733337023e-21,-2.3705178820244144e-21,-2.3505976926635182e-21,-2.3306773013542303e-21,-2.3107569100449425e-21,-2.2908367206840463e-21,-2.2709163293747584e-21,-2.2509959380654705e-21,-2.2310757487045744e-21,-2.2111553573952865e-21,-2.1912349660859986e-21,-2.1713147767251024e-21,-2.1513943854158145e-21,-2.1314741960549184e-21,-2.1115538047456305e-21,-2.0916334134363426e-21,-2.0717132240754464e-21,-2.0517928327661586e-21,-2.0318724414568707e-21,-2.0119522520959745e-21,-1.9920318607866866e-21,-1.9721114694773987e-21,-1.9521912801165026e-21,-1.9322708888072147e-21,-1.9123504974979268e-21,-1.8924303081370306e-21,-1.8725099168277427e-21,-1.8525897274668466e-21,-1.8326693361575587e-21,-1.8127489448482708e-21,-1.7928287554873746e-21,-1.7729083641780868e-21,-1.752987972868799e-21,-1.7330677835079027e-21,-1.713147392198615e-21,-1.6932271018635228e-21,-1.6733068115284308e-21,-1.6533864202191429e-21,-1.6334661298840509e-21,-1.6135458395489588e-21,-1.593625448239671e-21,-1.573705157904579e-21,-1.5537848675694869e-21,-1.5338645772343949e-21,-1.513944185925107e-21,-1.494023895590015e-21,-1.474103605254923e-21,-1.454183314919831e-21,-1.434262923610543e-21,-1.414342633275451e-21,-1.394422342940359e-21,-1.374501951631071e-21,-1.354581661295979e-21,-1.334661370960887e-21,-1.314741080625795e-21,-1.2948206893165071e-21,-1.2749003989814151e-21,-1.254980108646323e-21,-1.2350597173370352e-21,-1.2151394270019432e-21,-1.1952191366668511e-21,-1.1752988463317591e-21,-1.1553784550224712e-21,-1.1354581646873792e-21,-1.1155378743522872e-21,-1.0956174830429993e-21,-1.0756971927079073e-21,-1.0557769023728152e-21,-1.0358566120377232e-21,-1.0159362207284353e-21,-9.960159303933433e-22,-9.760956400582513e-22,-9.561752487489634e-22,-9.362549584138714e-22,-9.163346680787793e-22,-8.964143777436873e-22,-8.764939864343994e-22,-8.565736960993074e-22,-8.366534057642154e-22,-8.167330649420254e-22,-7.968127241198355e-22,-7.7689243378474345e-22,-7.569720929625535e-22,-7.370518026274615e-22,-7.171314618052715e-22,-6.972111714701795e-22,-6.772908306479895e-22,-6.573705403128975e-22,-6.3745019949070755e-22,-6.175298586685176e-22,-5.976095683334256e-22,-5.776892275112356e-22,-5.577689371761436e-22,-5.378485963539536e-22,-5.179283060188616e-22,-4.980079651966717e-22,-4.780876243744817e-22,-4.581673340393897e-22,-4.382469932171997e-22,-4.183267028821077e-22,-3.9840636205991774e-22,-3.7848604648127675e-22,-3.5856573090263576e-22,-3.3864541532399477e-22,-3.1872509974535378e-22,-2.988047841667128e-22,-2.788844685880718e-22,-2.589641530094308e-22,-2.3904381218724085e-22,-2.1912349660859986e-22,-1.9920318102995887e-22,-1.7928286545131788e-22,-1.5936254987267689e-22,-1.394422342940359e-22,-1.1952190609362042e-22,-9.960159051497943e-23,-7.968127493633844e-23,-5.976095304681021e-23,-3.984063746816922e-23,-1.992031873408461e-23,0],"expected":[-1.999999936531045e-20,1.9960158986588658e-20,1.9920318607866866e-20,-1.9880478229145074e-20,-1.9840637850423282e-20,1.980079747170149e-20,1.9760955477392563e-20,1.972111509867077e-20,1.9681274719948978e-20,1.9641434341227186e-20,1.9601593962505394e-20,-1.95617535837836e-20,1.9521911589474675e-20,-1.9482071210752883e-20,-1.944223083203109e-20,-1.9402390453309298e-20,-1.9362550074587506e-20,1.9322709695865714e-20,-1.928286931714392e-20,-1.9243027322834995e-20,-1.9203186944113203e-20,1.916334656539141e-20,-1.9123506186669618e-20,-1.9083665807947826e-20,1.9043825429226034e-20,1.9003983434917107e-20,1.8964143056195315e-20,-1.8924302677473523e-20,-1.888446229875173e-20,1.8844621920029938e-20,1.8804781541308146e-20,1.876493954699922e-20,1.8725099168277427e-20,1.8685258789555635e-20,1.8645418410833843e-20,1.860557803211205e-20,1.8565737653390258e-20,-1.8525895659081332e-20,-1.848605528035954e-20,1.8446214901637747e-20,1.8406374522915955e-20,-1.8366534144194163e-20,1.832669376547237e-20,1.8286853386750578e-20,-1.8247011392441652e-20,1.820717101371986e-20,-1.8167330634998067e-20,1.8127490256276275e-20,-1.8087649877554483e-20,1.804780949883269e-20,1.8007967504523764e-20,1.7968127125801972e-20,-1.792828674708018e-20,-1.7888446368358387e-20,1.7848605989636595e-20,1.7808765610914803e-20,-1.7768923616605876e-20,-1.7729083237884084e-20,1.7689242859162292e-20,-1.76494024804405e-20,1.7609562101718707e-20,1.7569721722996915e-20,-1.752987972868799e-20,-1.7490039349966196e-20,-1.7450198971244404e-20,1.7410358592522612e-20,-1.737051821380082e-20,1.7330677835079027e-20,1.7290837456357235e-20,1.725099546204831e-20,1.7211155083326516e-20,-1.7171314704604724e-20,-1.7131474325882932e-20,1.709163394716114e-20,-1.7051793568439347e-20,1.701195157413042e-20,-1.697211119540863e-20,1.6932270816686836e-20,-1.6892430437965044e-20,1.6852590059243252e-20,1.681274968052146e-20,1.6772907686212533e-20,1.673306730749074e-20,1.6693226928768948e-20,-1.6653386550047156e-20,-1.6613546171325364e-20,1.6573705792603572e-20,-1.6533863798294645e-20,-1.6494023419572853e-20,1.645418304085106e-20,1.6414342662129268e-20,-1.6374502283407476e-20,1.6334661904685684e-20,1.6294819910376758e-20,1.6254979531654965e-20,1.6215139152933173e-20,-1.617529877421138e-20,-1.6135458395489588e-20,1.6095618016767796e-20,1.6055777638046004e-20,-1.6015935643737078e-20,1.5976095265015285e-20,-1.5936254886293493e-20,-1.58964145075717e-20,1.5856574128849908e-20,-1.5816733750128116e-20,-1.577689175581919e-20,-1.5737051377097397e-20,-1.5697210998375605e-20,1.5657370619653813e-20,1.561753024093202e-20,1.5577689862210228e-20,-1.5537847867901302e-20,-1.549800748917951e-20,1.5458167110457717e-20,1.5418326731735925e-20,-1.5378486353014133e-20,1.533864597429234e-20,-1.5298803979983414e-20,1.5258963601261622e-20,-1.521912322253983e-20,1.5179282843818037e-20,-1.5139442465096245e-20,-1.5099602086374453e-20,1.505976170765266e-20,-1.5019919713343734e-20,1.4980079334621942e-20,-1.494023895590015e-20,-1.4900398577178357e-20,-1.4860558198456565e-20,1.4820717819734773e-20,-1.4780875825425846e-20,-1.4741035446704054e-20,1.4701195067982262e-20,1.466135468926047e-20,-1.4621514310538677e-20,1.4581673931816885e-20,1.454183193750796e-20,1.4501991558786166e-20,-1.4462151180064374e-20,1.4422310801342582e-20,1.438247042262079e-20,-1.4342630043898997e-20,1.430278804959007e-20,1.426294767086828e-20,-1.4223107292146486e-20,1.4183266913424694e-20,-1.4143426534702902e-20,1.410358615598111e-20,1.4063745777259317e-20,1.402390378295039e-20,1.39840634042286e-20,-1.3944223025506806e-20,1.3904382646785014e-20,1.3864542268063222e-20,1.382470188934143e-20,-1.3784859895032503e-20,1.374501951631071e-20,-1.370517913758892e-20,1.3665338758867126e-20,-1.3625498380145334e-20,-1.3585658001423542e-20,1.3545816814908182e-20,-1.350597643618639e-20,1.3466135249671031e-20,-1.3426294870949239e-20,1.3386454492227446e-20,1.3346613305712087e-20,1.3306772926990295e-20,1.3266932548268502e-20,1.3227091361753143e-20,-1.3187250983031351e-20,1.3147410604309558e-20,-1.3107569417794199e-20,-1.3067729039072407e-20,-1.3027888660350615e-20,-1.2988047473835255e-20,-1.2948207095113463e-20,-1.290836671639167e-20,-1.2868525529876311e-20,-1.2828685151154519e-20,1.2788844772432727e-20,1.2749003585917368e-20,1.2709163207195575e-20,1.2669322828473783e-20,1.262948244975199e-20,-1.2589641263236631e-20,-1.2549800884514839e-20,-1.2509960505793047e-20,1.2470119319277688e-20,-1.2430278940555895e-20,1.2390438561834103e-20,-1.2350597375318744e-20,1.2310756996596951e-20,1.2270916617875159e-20,1.22310754313598e-20,-1.2191235052638007e-20,1.2151394673916215e-20,-1.2111553487400856e-20,-1.2071713108679064e-20,1.2031872729957271e-20,-1.1992031543441912e-20,-1.195219116472012e-20,-1.1912350785998327e-20,1.1872509599482968e-20,1.1832669220761176e-20,-1.1792828842039384e-20,-1.1752987655524024e-20,-1.1713147276802232e-20,1.167330689808044e-20,1.1633466519358647e-20,-1.1593625332843288e-20,1.1553784954121496e-20,1.1513944575399703e-20,-1.1474103388884344e-20,1.1434263010162552e-20,1.139442263144076e-20,1.13545814449254e-20,1.1314741066203608e-20,-1.1274900687481816e-20,-1.1235059500966456e-20,-1.1195219122244664e-20,-1.1155378743522872e-20,-1.1115537557007513e-20,1.107569717828572e-20,-1.1035856799563928e-20,1.0996015613048569e-20,-1.0956175234326776e-20,1.0916334855604984e-20,1.0876493669089625e-20,-1.0836653290367833e-20,1.079681291164604e-20,1.0756971725130681e-20,1.0717131346408889e-20,1.0677290967687096e-20,-1.0637450588965304e-20,-1.0597609402449945e-20,1.0557769023728152e-20,1.051792864500636e-20,-1.0478087458491001e-20,1.0438247079769209e-20,1.0398406701047416e-20,-1.0358565514532057e-20,1.0318725135810265e-20,-1.0278884757088472e-20,1.0239043570573113e-20,1.0199203191851321e-20,1.0159362813129529e-20,-1.011952162661417e-20,-1.0079681247892377e-20,1.0039840869170585e-20,9.999999682655225e-21,-9.960159303933433e-21,9.920318925211641e-21,-9.880477738696282e-21,9.840637359974489e-21,9.800796981252697e-21,-9.760955794737338e-21,-9.721115416015545e-21,9.681275037293753e-21,-9.64143465857196e-21,-9.601593472056601e-21,-9.561753093334809e-21,9.521912714613017e-21,-9.482071528097658e-21,9.442231149375865e-21,-9.402390770654073e-21,9.362549584138714e-21,9.322709205416921e-21,9.282868826695129e-21,9.24302764017977e-21,-9.203187261457978e-21,9.163346882736185e-21,9.123505696220826e-21,-9.083665317499034e-21,-9.043824938777241e-21,-9.003983752261882e-21,-8.96414337354009e-21,8.924302994818297e-21,8.884461808302938e-21,-8.844621429581146e-21,-8.804781050859354e-21,8.764939864343994e-21,-8.725099485622202e-21,-8.68525910690041e-21,8.645418728178617e-21,-8.605577541663258e-21,8.565737162941466e-21,8.525896784219674e-21,-8.486055597704314e-21,8.446215218982522e-21,8.40637484026073e-21,-8.36653365374537e-21,-8.326693275023578e-21,-8.286852896301786e-21,-8.247011709786427e-21,8.207171331064634e-21,8.167330952342842e-21,-8.127489765827483e-21,-8.08764938710569e-21,8.047809008383898e-21,-8.007967821868539e-21,7.968127443146746e-21,-7.928287064424954e-21,7.888445877909595e-21,7.848605499187803e-21,-7.80876512046601e-21,-7.768923933950651e-21,7.729083555228859e-21,-7.689243176507066e-21,-7.649401989991707e-21,-7.609561611269915e-21,-7.569721232548123e-21,7.52988085382633e-21,7.490039667310971e-21,-7.450199288589179e-21,7.410358909867386e-21,7.370517723352027e-21,7.330677344630235e-21,-7.290836965908442e-21,7.250995779393083e-21,7.211155400671291e-21,-7.171315021949499e-21,7.13147383543414e-21,-7.091633456712347e-21,-7.051793077990555e-21,-7.011951891475195e-21,6.972111512753403e-21,-6.932271134031611e-21,-6.892429947516252e-21,-6.85258956879446e-21,6.812749190072667e-21,-6.772908407454091e-21,6.7330676248355154e-21,6.693227246113723e-21,6.653386463495147e-21,-6.6135456808765715e-21,-6.573705302154779e-21,6.5338645195362034e-21,6.494023736917628e-21,6.454183358195835e-21,-6.4143425755772596e-21,-6.374501792958684e-21,-6.3346614142368915e-21,-6.294820631618316e-21,-6.2549802528965234e-21,-6.2151394702779476e-21,6.175298687659372e-21,-6.1354583089375795e-21,6.095617526319004e-21,-6.055776743700428e-21,6.015936364978636e-21,-5.97609558236006e-21,5.936254799741484e-21,5.896414421019692e-21,5.856573638401116e-21,5.816733259679324e-21,5.776892477060748e-21,-5.737051694442172e-21,5.69721131572038e-21,-5.657370533101804e-21,-5.617529750483228e-21,-5.577689371761436e-21,5.53784858914286e-21,-5.498007806524284e-21,-5.458167427802492e-21,5.418326645183916e-21,-5.3784858625653405e-21,-5.338645483843548e-21,-5.2988047012249724e-21,5.25896432250318e-21,-5.219123539884604e-21,5.1792827572660285e-21,5.139442378544236e-21,5.0996015959256604e-21,-5.059760813307085e-21,-5.019920434585292e-21,4.9800796519667165e-21,4.940238869348141e-21,-4.9003984906263484e-21,-4.860557708007773e-21,4.82071732928598e-21,4.7808765466674046e-21,-4.741035764048829e-21,4.7011953853270365e-21,4.661354602708461e-21,4.621513820089885e-21,4.5816734413680926e-21,-4.541832658749517e-21,-4.501991876130941e-21,4.462151497409149e-21,-4.422310714790573e-21,-4.382469932171997e-21,4.342629553450205e-21,4.302788770831629e-21,4.262948392109837e-21,-4.223107609491261e-21,-4.183266826872685e-21,-4.143426448150893e-21,-4.103585665532317e-21,-4.063744882913741e-21,-4.023904504191949e-21,3.984063721573373e-21,3.9442229389547974e-21,3.904382560233005e-21,3.864541777614429e-21,-3.8247009949958536e-21,-3.784860616274061e-21,-3.7450198336554855e-21,3.705179454933693e-21,3.6653386723151174e-21,3.6254978896965416e-21,-3.585657510974749e-21,3.5458167283561735e-21,-3.505975945737598e-21,3.4661355670158054e-21,3.42629478439723e-21,3.3864542037270456e-21,-3.3466136230568615e-21,3.3067728404382858e-21,3.2669322597681017e-21,3.2270916790979177e-21,-3.187250896479342e-21,-3.147410315809158e-21,3.1075697351389738e-21,3.0677291544687898e-21,3.027888371850214e-21,2.98804779118003e-21,2.948207210509846e-21,-2.908366629839662e-21,2.868525847221086e-21,2.828685266550902e-21,2.788844685880718e-21,-2.749003903262142e-21,-2.709163322591958e-21,2.669322741921774e-21,-2.62948216125159e-21,2.5896413786330143e-21,2.5498007979628302e-21,2.509960217292646e-21,-2.4701194346740704e-21,-2.4302788540038863e-21,2.3904382733337023e-21,-2.3505976926635182e-21,2.3107569100449425e-21,-2.2709163293747584e-21,-2.2310757487045744e-21,2.1912349660859986e-21,-2.1513943854158145e-21,-2.1115538047456305e-21,-2.0717132240754464e-21,-2.0318724414568707e-21,1.9920318607866866e-21,1.9521912801165026e-21,-1.9123504974979268e-21,1.8725099168277427e-21,1.8326693361575587e-21,1.7928287554873746e-21,-1.752987972868799e-21,-1.713147392198615e-21,-1.6733068115284308e-21,1.6334661298840509e-21,1.593625448239671e-21,1.5537848675694869e-21,1.513944185925107e-21,-1.474103605254923e-21,-1.434262923610543e-21,-1.394422342940359e-21,1.354581661295979e-21,1.314741080625795e-21,-1.2749003989814151e-21,1.2350597173370352e-21,-1.1952191366668511e-21,1.1553784550224712e-21,-1.1155378743522872e-21,1.0756971927079073e-21,-1.0358566120377232e-21,9.960159303933433e-22,9.561752487489634e-22,9.163346680787793e-22,-8.764939864343994e-22,-8.366534057642154e-22,-7.968127241198355e-22,-7.569720929625535e-22,7.171314618052715e-22,-6.772908306479895e-22,6.3745019949070755e-22,5.976095683334256e-22,-5.577689371761436e-22,5.179283060188616e-22,4.780876243744817e-22,-4.382469932171997e-22,-3.9840636205991774e-22,3.5856573090263576e-22,3.1872509974535378e-22,2.788844685880718e-22,-2.3904381218724085e-22,1.9920318102995887e-22,1.5936254987267689e-22,1.1952190609362042e-22,-7.968127493633844e-23,-3.984063746816922e-23,0]} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/tiny_positive.json b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/tiny_positive.json new file mode 100644 index 000000000000..88419a25ee9a --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/fixtures/julia/tiny_positive.json @@ -0,0 +1 @@ +{"x":[0,1.992031873408461e-23,3.984063746816922e-23,5.976095304681021e-23,7.968127493633844e-23,9.960159051497943e-23,1.1952190609362042e-22,1.394422342940359e-22,1.5936254987267689e-22,1.7928286545131788e-22,1.9920318102995887e-22,2.1912349660859986e-22,2.3904381218724085e-22,2.589641530094308e-22,2.788844685880718e-22,2.988047841667128e-22,3.1872509974535378e-22,3.3864541532399477e-22,3.5856573090263576e-22,3.7848604648127675e-22,3.9840636205991774e-22,4.183267028821077e-22,4.382469932171997e-22,4.581673340393897e-22,4.780876243744817e-22,4.980079651966717e-22,5.179283060188616e-22,5.378485963539536e-22,5.577689371761436e-22,5.776892275112356e-22,5.976095683334256e-22,6.175298586685176e-22,6.3745019949070755e-22,6.573705403128975e-22,6.772908306479895e-22,6.972111714701795e-22,7.171314618052715e-22,7.370518026274615e-22,7.569720929625535e-22,7.7689243378474345e-22,7.968127241198355e-22,8.167330649420254e-22,8.366534057642154e-22,8.565736960993074e-22,8.764939864343994e-22,8.964143777436873e-22,9.163346680787793e-22,9.362549584138714e-22,9.561752487489634e-22,9.760956400582513e-22,9.960159303933433e-22,1.0159362207284353e-21,1.0358566120377232e-21,1.0557769023728152e-21,1.0756971927079073e-21,1.0956174830429993e-21,1.1155378743522872e-21,1.1354581646873792e-21,1.1553784550224712e-21,1.1752988463317591e-21,1.1952191366668511e-21,1.2151394270019432e-21,1.2350597173370352e-21,1.254980108646323e-21,1.2749003989814151e-21,1.2948206893165071e-21,1.314741080625795e-21,1.334661370960887e-21,1.354581661295979e-21,1.374501951631071e-21,1.394422342940359e-21,1.414342633275451e-21,1.434262923610543e-21,1.454183314919831e-21,1.474103605254923e-21,1.494023895590015e-21,1.513944185925107e-21,1.5338645772343949e-21,1.5537848675694869e-21,1.573705157904579e-21,1.593625448239671e-21,1.6135458395489588e-21,1.6334661298840509e-21,1.6533864202191429e-21,1.6733068115284308e-21,1.6932271018635228e-21,1.713147392198615e-21,1.7330677835079027e-21,1.752987972868799e-21,1.7729083641780868e-21,1.7928287554873746e-21,1.8127489448482708e-21,1.8326693361575587e-21,1.8525897274668466e-21,1.8725099168277427e-21,1.8924303081370306e-21,1.9123504974979268e-21,1.9322708888072147e-21,1.9521912801165026e-21,1.9721114694773987e-21,1.9920318607866866e-21,2.0119522520959745e-21,2.0318724414568707e-21,2.0517928327661586e-21,2.0717132240754464e-21,2.0916334134363426e-21,2.1115538047456305e-21,2.1314741960549184e-21,2.1513943854158145e-21,2.1713147767251024e-21,2.1912349660859986e-21,2.2111553573952865e-21,2.2310757487045744e-21,2.2509959380654705e-21,2.2709163293747584e-21,2.2908367206840463e-21,2.3107569100449425e-21,2.3306773013542303e-21,2.3505976926635182e-21,2.3705178820244144e-21,2.3904382733337023e-21,2.41035866464299e-21,2.4302788540038863e-21,2.4501992453131742e-21,2.4701194346740704e-21,2.4900398259833583e-21,2.509960217292646e-21,2.5298804066535423e-21,2.5498007979628302e-21,2.569721189272118e-21,2.5896413786330143e-21,2.609561769942302e-21,2.62948216125159e-21,2.6494023506124862e-21,2.669322741921774e-21,2.6892429312826702e-21,2.709163322591958e-21,2.729083713901246e-21,2.749003903262142e-21,2.76892429457143e-21,2.788844685880718e-21,2.808764875241614e-21,2.828685266550902e-21,2.84860565786019e-21,2.868525847221086e-21,2.888446238530374e-21,2.908366629839662e-21,2.928286819200558e-21,2.948207210509846e-21,2.968127399870742e-21,2.98804779118003e-21,3.007968182489318e-21,3.027888371850214e-21,3.047808763159502e-21,3.0677291544687898e-21,3.087649343829686e-21,3.1075697351389738e-21,3.1274901264482617e-21,3.147410315809158e-21,3.1673307071184457e-21,3.187250896479342e-21,3.2071712877886298e-21,3.2270916790979177e-21,3.247011868458814e-21,3.2669322597681017e-21,3.2868526510773896e-21,3.3067728404382858e-21,3.3266932317475737e-21,3.3466136230568615e-21,3.3665338124177577e-21,3.3864542037270456e-21,3.4063745950363335e-21,3.42629478439723e-21,3.446214973758126e-21,3.4661355670158054e-21,3.4860557563767016e-21,3.505975945737598e-21,3.525896538995277e-21,3.5458167283561735e-21,3.56573691771707e-21,3.585657510974749e-21,3.6055777003356455e-21,3.6254978896965416e-21,3.645418482954221e-21,3.6653386723151174e-21,3.6852588616760135e-21,3.705179454933693e-21,3.725099644294589e-21,3.7450198336554855e-21,3.764940426913165e-21,3.784860616274061e-21,3.8047808056349574e-21,3.8247009949958536e-21,3.844621588253533e-21,3.864541777614429e-21,3.8844619669753255e-21,3.904382560233005e-21,3.924302749593901e-21,3.9442229389547974e-21,3.964143532212477e-21,3.984063721573373e-21,4.0039839109342694e-21,4.023904504191949e-21,4.043824693552845e-21,4.063744882913741e-21,4.083665476171421e-21,4.103585665532317e-21,4.123505854893213e-21,4.143426448150893e-21,4.163346637511789e-21,4.183266826872685e-21,4.203187420130365e-21,4.223107609491261e-21,4.243027798852157e-21,4.262948392109837e-21,4.282868581470733e-21,4.302788770831629e-21,4.322709364089309e-21,4.342629553450205e-21,4.362549742811101e-21,4.382469932171997e-21,4.402390525429677e-21,4.422310714790573e-21,4.442230904151469e-21,4.462151497409149e-21,4.482071686770045e-21,4.501991876130941e-21,4.521912469388621e-21,4.541832658749517e-21,4.561752848110413e-21,4.5816734413680926e-21,4.601593630728989e-21,4.621513820089885e-21,4.6414344133475645e-21,4.661354602708461e-21,4.681274792069357e-21,4.7011953853270365e-21,4.721115574687933e-21,4.741035764048829e-21,4.7609563573065084e-21,4.7808765466674046e-21,4.800796736028301e-21,4.82071732928598e-21,4.8406375186468765e-21,4.860557708007773e-21,4.880477897368669e-21,4.9003984906263484e-21,4.9203186799872446e-21,4.940238869348141e-21,4.9601594626058204e-21,4.9800796519667165e-21,4.999999841327613e-21,5.019920434585292e-21,5.0398406239461885e-21,5.059760813307085e-21,5.079681406564764e-21,5.0996015959256604e-21,5.1195217852865566e-21,5.139442378544236e-21,5.159362567905132e-21,5.1792827572660285e-21,5.199203350523708e-21,5.219123539884604e-21,5.2390437292455004e-21,5.25896432250318e-21,5.278884511864076e-21,5.2988047012249724e-21,5.318725294482652e-21,5.338645483843548e-21,5.358565673204444e-21,5.3784858625653405e-21,5.39840645582302e-21,5.418326645183916e-21,5.4382468345448124e-21,5.458167427802492e-21,5.478087617163388e-21,5.498007806524284e-21,5.517928399781964e-21,5.53784858914286e-21,5.557768778503756e-21,5.577689371761436e-21,5.597609561122332e-21,5.617529750483228e-21,5.637450343740908e-21,5.657370533101804e-21,5.6772907224627e-21,5.69721131572038e-21,5.717131505081276e-21,5.737051694442172e-21,5.756972287699852e-21,5.776892477060748e-21,5.796812666421644e-21,5.816733259679324e-21,5.83665344904022e-21,5.856573638401116e-21,5.876493827762012e-21,5.896414421019692e-21,5.916334610380588e-21,5.936254799741484e-21,5.956175392999164e-21,5.97609558236006e-21,5.996015771720956e-21,6.015936364978636e-21,6.035856554339532e-21,6.055776743700428e-21,6.0756973369581076e-21,6.095617526319004e-21,6.1155377156799e-21,6.1354583089375795e-21,6.155378498298476e-21,6.175298687659372e-21,6.1952192809170514e-21,6.2151394702779476e-21,6.235059659638844e-21,6.2549802528965234e-21,6.2749004422574195e-21,6.294820631618316e-21,6.314741224875995e-21,6.3346614142368915e-21,6.354581603597788e-21,6.374501792958684e-21,6.3944223862163634e-21,6.4143425755772596e-21,6.434262764938156e-21,6.454183358195835e-21,6.4741035475567315e-21,6.494023736917628e-21,6.513944330175307e-21,6.5338645195362034e-21,6.5537847088970996e-21,6.573705302154779e-21,6.5936254915156754e-21,6.6135456808765715e-21,6.633466274134251e-21,6.653386463495147e-21,6.6733066528560435e-21,6.693227246113723e-21,6.713147435474619e-21,6.7330676248355154e-21,6.752988218093195e-21,6.772908407454091e-21,6.792829000711771e-21,6.812749190072667e-21,6.832669379433563e-21,6.85258956879446e-21,6.872509758155355e-21,6.892429947516252e-21,6.912350944670715e-21,6.932271134031611e-21,6.952191323392507e-21,6.972111512753403e-21,6.9920317021143e-21,7.011951891475195e-21,7.031872888629659e-21,7.051793077990555e-21,7.071713267351451e-21,7.091633456712347e-21,7.111553646073243e-21,7.13147383543414e-21,7.151394024795035e-21,7.171315021949499e-21,7.191235211310395e-21,7.211155400671291e-21,7.231075590032187e-21,7.250995779393083e-21,7.27091596875398e-21,7.290836965908442e-21,7.310757155269339e-21,7.330677344630235e-21,7.350597533991131e-21,7.370517723352027e-21,7.390437912712923e-21,7.410358909867386e-21,7.430279099228283e-21,7.450199288589179e-21,7.470119477950075e-21,7.490039667310971e-21,7.509959856671867e-21,7.52988085382633e-21,7.549801043187226e-21,7.569721232548123e-21,7.589641421909019e-21,7.609561611269915e-21,7.629481800630811e-21,7.649401989991707e-21,7.66932298714617e-21,7.689243176507066e-21,7.709163365867963e-21,7.729083555228859e-21,7.749003744589755e-21,7.768923933950651e-21,7.788844931105114e-21,7.80876512046601e-21,7.828685309826906e-21,7.848605499187803e-21,7.868525688548699e-21,7.888445877909595e-21,7.908366875064058e-21,7.928287064424954e-21,7.94820725378585e-21,7.968127443146746e-21,7.988047632507643e-21,8.007967821868539e-21,8.027888819023002e-21,8.047809008383898e-21,8.067729197744794e-21,8.08764938710569e-21,8.107569576466586e-21,8.127489765827483e-21,8.147409955188379e-21,8.167330952342842e-21,8.187251141703738e-21,8.207171331064634e-21,8.22709152042553e-21,8.247011709786427e-21,8.266931899147323e-21,8.286852896301786e-21,8.306773085662682e-21,8.326693275023578e-21,8.346613464384474e-21,8.36653365374537e-21,8.386453843106267e-21,8.40637484026073e-21,8.426295029621626e-21,8.446215218982522e-21,8.466135408343418e-21,8.486055597704314e-21,8.50597578706521e-21,8.525896784219674e-21,8.54581697358057e-21,8.565737162941466e-21,8.585657352302362e-21,8.605577541663258e-21,8.625497731024154e-21,8.645418728178617e-21,8.665338917539514e-21,8.68525910690041e-21,8.705179296261306e-21,8.725099485622202e-21,8.745019674983098e-21,8.764939864343994e-21,8.784860861498457e-21,8.804781050859354e-21,8.82470124022025e-21,8.844621429581146e-21,8.864541618942042e-21,8.884461808302938e-21,8.904382805457401e-21,8.924302994818297e-21,8.944223184179194e-21,8.96414337354009e-21,8.984063562900986e-21,9.003983752261882e-21,9.023904749416345e-21,9.043824938777241e-21,9.063745128138137e-21,9.083665317499034e-21,9.10358550685993e-21,9.123505696220826e-21,9.143426693375289e-21,9.163346882736185e-21,9.183267072097081e-21,9.203187261457978e-21,9.223107450818874e-21,9.24302764017977e-21,9.262947829540666e-21,9.282868826695129e-21,9.302789016056025e-21,9.322709205416921e-21,9.342629394777818e-21,9.362549584138714e-21,9.38246977349961e-21,9.402390770654073e-21,9.422310960014969e-21,9.442231149375865e-21,9.462151338736761e-21,9.482071528097658e-21,9.501991717458554e-21,9.521912714613017e-21,9.541832903973913e-21,9.561753093334809e-21,9.581673282695705e-21,9.601593472056601e-21,9.621513661417498e-21,9.64143465857196e-21,9.661354847932857e-21,9.681275037293753e-21,9.701195226654649e-21,9.721115416015545e-21,9.741035605376441e-21,9.760955794737338e-21,9.7808767918918e-21,9.800796981252697e-21,9.820717170613593e-21,9.840637359974489e-21,9.860557549335385e-21,9.880477738696282e-21,9.900398735850745e-21,9.920318925211641e-21,9.940239114572537e-21,9.960159303933433e-21,9.980079493294329e-21,9.999999682655225e-21],"y":[-1,1,1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,1,1,-1,-1,-1,-1,1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1,1,-1,-1,1,-1,1,1,-1,-1,1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,1,1,1,1,1,-1,-1,1,1,-1,-1,-1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,1,1,-1,-1,1,1,-1,1,-1,-1,-1,-1,1,1,-1,1,-1,1,-1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,-1,-1,1,1,1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,1,1,-1,1,-1,1,-1,1,1,1,1,1,-1,-1,1,1,1,-1,-1,1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,-1,1,1,1,1,1,1,-1,1,1,-1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,-1,-1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,-1,1,-1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,-1,1,1,1,-1,1,1,-1,1,1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,-1,1,-1,1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,1,1,-1,-1,-1,-1,-1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,1,-1,-1,1,1,1,1,-1,-1,-1,-1,1,1,1,-1,-1,1,-1,-1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,1,-1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,-1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,-1,1],"p":[0,1.992031873408461e-23,3.984063746816922e-23,5.976095304681021e-23,7.968127493633844e-23,9.960159051497943e-23,1.1952190609362042e-22,1.394422342940359e-22,1.5936254987267689e-22,1.7928286545131788e-22,1.9920318102995887e-22,2.1912349660859986e-22,2.3904381218724085e-22,2.589641530094308e-22,2.788844685880718e-22,2.988047841667128e-22,3.1872509974535378e-22,3.3864541532399477e-22,3.5856573090263576e-22,3.7848604648127675e-22,3.9840636205991774e-22,4.183267028821077e-22,4.382469932171997e-22,4.581673340393897e-22,4.780876243744817e-22,4.980079651966717e-22,5.179283060188616e-22,5.378485963539536e-22,5.577689371761436e-22,5.776892275112356e-22,5.976095683334256e-22,6.175298586685176e-22,6.3745019949070755e-22,6.573705403128975e-22,6.772908306479895e-22,6.972111714701795e-22,7.171314618052715e-22,7.370518026274615e-22,7.569720929625535e-22,7.7689243378474345e-22,7.968127241198355e-22,8.167330649420254e-22,8.366534057642154e-22,8.565736960993074e-22,8.764939864343994e-22,8.964143777436873e-22,9.163346680787793e-22,9.362549584138714e-22,9.561752487489634e-22,9.760956400582513e-22,9.960159303933433e-22,1.0159362207284353e-21,1.0358566120377232e-21,1.0557769023728152e-21,1.0756971927079073e-21,1.0956174830429993e-21,1.1155378743522872e-21,1.1354581646873792e-21,1.1553784550224712e-21,1.1752988463317591e-21,1.1952191366668511e-21,1.2151394270019432e-21,1.2350597173370352e-21,1.254980108646323e-21,1.2749003989814151e-21,1.2948206893165071e-21,1.314741080625795e-21,1.334661370960887e-21,1.354581661295979e-21,1.374501951631071e-21,1.394422342940359e-21,1.414342633275451e-21,1.434262923610543e-21,1.454183314919831e-21,1.474103605254923e-21,1.494023895590015e-21,1.513944185925107e-21,1.5338645772343949e-21,1.5537848675694869e-21,1.573705157904579e-21,1.593625448239671e-21,1.6135458395489588e-21,1.6334661298840509e-21,1.6533864202191429e-21,1.6733068115284308e-21,1.6932271018635228e-21,1.713147392198615e-21,1.7330677835079027e-21,1.752987972868799e-21,1.7729083641780868e-21,1.7928287554873746e-21,1.8127489448482708e-21,1.8326693361575587e-21,1.8525897274668466e-21,1.8725099168277427e-21,1.8924303081370306e-21,1.9123504974979268e-21,1.9322708888072147e-21,1.9521912801165026e-21,1.9721114694773987e-21,1.9920318607866866e-21,2.0119522520959745e-21,2.0318724414568707e-21,2.0517928327661586e-21,2.0717132240754464e-21,2.0916334134363426e-21,2.1115538047456305e-21,2.1314741960549184e-21,2.1513943854158145e-21,2.1713147767251024e-21,2.1912349660859986e-21,2.2111553573952865e-21,2.2310757487045744e-21,2.2509959380654705e-21,2.2709163293747584e-21,2.2908367206840463e-21,2.3107569100449425e-21,2.3306773013542303e-21,2.3505976926635182e-21,2.3705178820244144e-21,2.3904382733337023e-21,2.41035866464299e-21,2.4302788540038863e-21,2.4501992453131742e-21,2.4701194346740704e-21,2.4900398259833583e-21,2.509960217292646e-21,2.5298804066535423e-21,2.5498007979628302e-21,2.569721189272118e-21,2.5896413786330143e-21,2.609561769942302e-21,2.62948216125159e-21,2.6494023506124862e-21,2.669322741921774e-21,2.6892429312826702e-21,2.709163322591958e-21,2.729083713901246e-21,2.749003903262142e-21,2.76892429457143e-21,2.788844685880718e-21,2.808764875241614e-21,2.828685266550902e-21,2.84860565786019e-21,2.868525847221086e-21,2.888446238530374e-21,2.908366629839662e-21,2.928286819200558e-21,2.948207210509846e-21,2.968127399870742e-21,2.98804779118003e-21,3.007968182489318e-21,3.027888371850214e-21,3.047808763159502e-21,3.0677291544687898e-21,3.087649343829686e-21,3.1075697351389738e-21,3.1274901264482617e-21,3.147410315809158e-21,3.1673307071184457e-21,3.187250896479342e-21,3.2071712877886298e-21,3.2270916790979177e-21,3.247011868458814e-21,3.2669322597681017e-21,3.2868526510773896e-21,3.3067728404382858e-21,3.3266932317475737e-21,3.3466136230568615e-21,3.3665338124177577e-21,3.3864542037270456e-21,3.4063745950363335e-21,3.42629478439723e-21,3.446214973758126e-21,3.4661355670158054e-21,3.4860557563767016e-21,3.505975945737598e-21,3.525896538995277e-21,3.5458167283561735e-21,3.56573691771707e-21,3.585657510974749e-21,3.6055777003356455e-21,3.6254978896965416e-21,3.645418482954221e-21,3.6653386723151174e-21,3.6852588616760135e-21,3.705179454933693e-21,3.725099644294589e-21,3.7450198336554855e-21,3.764940426913165e-21,3.784860616274061e-21,3.8047808056349574e-21,3.8247009949958536e-21,3.844621588253533e-21,3.864541777614429e-21,3.8844619669753255e-21,3.904382560233005e-21,3.924302749593901e-21,3.9442229389547974e-21,3.964143532212477e-21,3.984063721573373e-21,4.0039839109342694e-21,4.023904504191949e-21,4.043824693552845e-21,4.063744882913741e-21,4.083665476171421e-21,4.103585665532317e-21,4.123505854893213e-21,4.143426448150893e-21,4.163346637511789e-21,4.183266826872685e-21,4.203187420130365e-21,4.223107609491261e-21,4.243027798852157e-21,4.262948392109837e-21,4.282868581470733e-21,4.302788770831629e-21,4.322709364089309e-21,4.342629553450205e-21,4.362549742811101e-21,4.382469932171997e-21,4.402390525429677e-21,4.422310714790573e-21,4.442230904151469e-21,4.462151497409149e-21,4.482071686770045e-21,4.501991876130941e-21,4.521912469388621e-21,4.541832658749517e-21,4.561752848110413e-21,4.5816734413680926e-21,4.601593630728989e-21,4.621513820089885e-21,4.6414344133475645e-21,4.661354602708461e-21,4.681274792069357e-21,4.7011953853270365e-21,4.721115574687933e-21,4.741035764048829e-21,4.7609563573065084e-21,4.7808765466674046e-21,4.800796736028301e-21,4.82071732928598e-21,4.8406375186468765e-21,4.860557708007773e-21,4.880477897368669e-21,4.9003984906263484e-21,4.9203186799872446e-21,4.940238869348141e-21,4.9601594626058204e-21,4.9800796519667165e-21,4.999999841327613e-21,5.019920434585292e-21,5.0398406239461885e-21,5.059760813307085e-21,5.079681406564764e-21,5.0996015959256604e-21,5.1195217852865566e-21,5.139442378544236e-21,5.159362567905132e-21,5.1792827572660285e-21,5.199203350523708e-21,5.219123539884604e-21,5.2390437292455004e-21,5.25896432250318e-21,5.278884511864076e-21,5.2988047012249724e-21,5.318725294482652e-21,5.338645483843548e-21,5.358565673204444e-21,5.3784858625653405e-21,5.39840645582302e-21,5.418326645183916e-21,5.4382468345448124e-21,5.458167427802492e-21,5.478087617163388e-21,5.498007806524284e-21,5.517928399781964e-21,5.53784858914286e-21,5.557768778503756e-21,5.577689371761436e-21,5.597609561122332e-21,5.617529750483228e-21,5.637450343740908e-21,5.657370533101804e-21,5.6772907224627e-21,5.69721131572038e-21,5.717131505081276e-21,5.737051694442172e-21,5.756972287699852e-21,5.776892477060748e-21,5.796812666421644e-21,5.816733259679324e-21,5.83665344904022e-21,5.856573638401116e-21,5.876493827762012e-21,5.896414421019692e-21,5.916334610380588e-21,5.936254799741484e-21,5.956175392999164e-21,5.97609558236006e-21,5.996015771720956e-21,6.015936364978636e-21,6.035856554339532e-21,6.055776743700428e-21,6.0756973369581076e-21,6.095617526319004e-21,6.1155377156799e-21,6.1354583089375795e-21,6.155378498298476e-21,6.175298687659372e-21,6.1952192809170514e-21,6.2151394702779476e-21,6.235059659638844e-21,6.2549802528965234e-21,6.2749004422574195e-21,6.294820631618316e-21,6.314741224875995e-21,6.3346614142368915e-21,6.354581603597788e-21,6.374501792958684e-21,6.3944223862163634e-21,6.4143425755772596e-21,6.434262764938156e-21,6.454183358195835e-21,6.4741035475567315e-21,6.494023736917628e-21,6.513944330175307e-21,6.5338645195362034e-21,6.5537847088970996e-21,6.573705302154779e-21,6.5936254915156754e-21,6.6135456808765715e-21,6.633466274134251e-21,6.653386463495147e-21,6.6733066528560435e-21,6.693227246113723e-21,6.713147435474619e-21,6.7330676248355154e-21,6.752988218093195e-21,6.772908407454091e-21,6.792829000711771e-21,6.812749190072667e-21,6.832669379433563e-21,6.85258956879446e-21,6.872509758155355e-21,6.892429947516252e-21,6.912350944670715e-21,6.932271134031611e-21,6.952191323392507e-21,6.972111512753403e-21,6.9920317021143e-21,7.011951891475195e-21,7.031872888629659e-21,7.051793077990555e-21,7.071713267351451e-21,7.091633456712347e-21,7.111553646073243e-21,7.13147383543414e-21,7.151394024795035e-21,7.171315021949499e-21,7.191235211310395e-21,7.211155400671291e-21,7.231075590032187e-21,7.250995779393083e-21,7.27091596875398e-21,7.290836965908442e-21,7.310757155269339e-21,7.330677344630235e-21,7.350597533991131e-21,7.370517723352027e-21,7.390437912712923e-21,7.410358909867386e-21,7.430279099228283e-21,7.450199288589179e-21,7.470119477950075e-21,7.490039667310971e-21,7.509959856671867e-21,7.52988085382633e-21,7.549801043187226e-21,7.569721232548123e-21,7.589641421909019e-21,7.609561611269915e-21,7.629481800630811e-21,7.649401989991707e-21,7.66932298714617e-21,7.689243176507066e-21,7.709163365867963e-21,7.729083555228859e-21,7.749003744589755e-21,7.768923933950651e-21,7.788844931105114e-21,7.80876512046601e-21,7.828685309826906e-21,7.848605499187803e-21,7.868525688548699e-21,7.888445877909595e-21,7.908366875064058e-21,7.928287064424954e-21,7.94820725378585e-21,7.968127443146746e-21,7.988047632507643e-21,8.007967821868539e-21,8.027888819023002e-21,8.047809008383898e-21,8.067729197744794e-21,8.08764938710569e-21,8.107569576466586e-21,8.127489765827483e-21,8.147409955188379e-21,8.167330952342842e-21,8.187251141703738e-21,8.207171331064634e-21,8.22709152042553e-21,8.247011709786427e-21,8.266931899147323e-21,8.286852896301786e-21,8.306773085662682e-21,8.326693275023578e-21,8.346613464384474e-21,8.36653365374537e-21,8.386453843106267e-21,8.40637484026073e-21,8.426295029621626e-21,8.446215218982522e-21,8.466135408343418e-21,8.486055597704314e-21,8.50597578706521e-21,8.525896784219674e-21,8.54581697358057e-21,8.565737162941466e-21,8.585657352302362e-21,8.605577541663258e-21,8.625497731024154e-21,8.645418728178617e-21,8.665338917539514e-21,8.68525910690041e-21,8.705179296261306e-21,8.725099485622202e-21,8.745019674983098e-21,8.764939864343994e-21,8.784860861498457e-21,8.804781050859354e-21,8.82470124022025e-21,8.844621429581146e-21,8.864541618942042e-21,8.884461808302938e-21,8.904382805457401e-21,8.924302994818297e-21,8.944223184179194e-21,8.96414337354009e-21,8.984063562900986e-21,9.003983752261882e-21,9.023904749416345e-21,9.043824938777241e-21,9.063745128138137e-21,9.083665317499034e-21,9.10358550685993e-21,9.123505696220826e-21,9.143426693375289e-21,9.163346882736185e-21,9.183267072097081e-21,9.203187261457978e-21,9.223107450818874e-21,9.24302764017977e-21,9.262947829540666e-21,9.282868826695129e-21,9.302789016056025e-21,9.322709205416921e-21,9.342629394777818e-21,9.362549584138714e-21,9.38246977349961e-21,9.402390770654073e-21,9.422310960014969e-21,9.442231149375865e-21,9.462151338736761e-21,9.482071528097658e-21,9.501991717458554e-21,9.521912714613017e-21,9.541832903973913e-21,9.561753093334809e-21,9.581673282695705e-21,9.601593472056601e-21,9.621513661417498e-21,9.64143465857196e-21,9.661354847932857e-21,9.681275037293753e-21,9.701195226654649e-21,9.721115416015545e-21,9.741035605376441e-21,9.760955794737338e-21,9.7808767918918e-21,9.800796981252697e-21,9.820717170613593e-21,9.840637359974489e-21,9.860557549335385e-21,9.880477738696282e-21,9.900398735850745e-21,9.920318925211641e-21,9.940239114572537e-21,9.960159303933433e-21,9.980079493294329e-21,9.999999682655225e-21],"expected":[0,-3.984063746816922e-23,-7.968127493633844e-23,1.1952190609362042e-22,1.5936254987267689e-22,1.9920318102995887e-22,2.3904381218724085e-22,-2.788844685880718e-22,3.1872509974535378e-22,3.5856573090263576e-22,3.9840636205991774e-22,-4.382469932171997e-22,4.780876243744817e-22,-5.179283060188616e-22,-5.577689371761436e-22,5.976095683334256e-22,6.3745019949070755e-22,6.772908306479895e-22,7.171314618052715e-22,-7.569720929625535e-22,-7.968127241198355e-22,8.366534057642154e-22,8.764939864343994e-22,9.163346680787793e-22,-9.561752487489634e-22,9.960159303933433e-22,1.0358566120377232e-21,-1.0756971927079073e-21,-1.1155378743522872e-21,-1.1553784550224712e-21,-1.1952191366668511e-21,-1.2350597173370352e-21,1.2749003989814151e-21,1.314741080625795e-21,1.354581661295979e-21,-1.394422342940359e-21,1.434262923610543e-21,1.474103605254923e-21,-1.513944185925107e-21,1.5537848675694869e-21,1.593625448239671e-21,-1.6334661298840509e-21,1.6733068115284308e-21,1.713147392198615e-21,-1.752987972868799e-21,1.7928287554873746e-21,-1.8326693361575587e-21,-1.8725099168277427e-21,1.9123504974979268e-21,1.9521912801165026e-21,-1.9920318607866866e-21,2.0318724414568707e-21,-2.0717132240754464e-21,2.1115538047456305e-21,-2.1513943854158145e-21,-2.1912349660859986e-21,2.2310757487045744e-21,-2.2709163293747584e-21,2.3107569100449425e-21,2.3505976926635182e-21,2.3904382733337023e-21,2.4302788540038863e-21,2.4701194346740704e-21,2.509960217292646e-21,2.5498007979628302e-21,-2.5896413786330143e-21,-2.62948216125159e-21,2.669322741921774e-21,-2.709163322591958e-21,2.749003903262142e-21,2.788844685880718e-21,2.828685266550902e-21,2.868525847221086e-21,2.908366629839662e-21,-2.948207210509846e-21,-2.98804779118003e-21,3.027888371850214e-21,3.0677291544687898e-21,3.1075697351389738e-21,3.147410315809158e-21,-3.187250896479342e-21,3.2270916790979177e-21,-3.2669322597681017e-21,3.3067728404382858e-21,-3.3466136230568615e-21,-3.3864542037270456e-21,3.42629478439723e-21,3.4661355670158054e-21,-3.505975945737598e-21,-3.5458167283561735e-21,-3.585657510974749e-21,-3.6254978896965416e-21,-3.6653386723151174e-21,-3.705179454933693e-21,3.7450198336554855e-21,3.784860616274061e-21,-3.8247009949958536e-21,-3.864541777614429e-21,3.904382560233005e-21,3.9442229389547974e-21,3.984063721573373e-21,4.023904504191949e-21,-4.063744882913741e-21,-4.103585665532317e-21,-4.143426448150893e-21,4.183266826872685e-21,-4.223107609491261e-21,4.262948392109837e-21,-4.302788770831629e-21,4.342629553450205e-21,-4.382469932171997e-21,-4.422310714790573e-21,-4.462151497409149e-21,-4.501991876130941e-21,-4.541832658749517e-21,4.5816734413680926e-21,4.621513820089885e-21,-4.661354602708461e-21,-4.7011953853270365e-21,4.741035764048829e-21,-4.7808765466674046e-21,4.82071732928598e-21,4.860557708007773e-21,4.9003984906263484e-21,4.940238869348141e-21,-4.9800796519667165e-21,-5.019920434585292e-21,5.059760813307085e-21,-5.0996015959256604e-21,5.139442378544236e-21,-5.1792827572660285e-21,5.219123539884604e-21,-5.25896432250318e-21,5.2988047012249724e-21,-5.338645483843548e-21,-5.3784858625653405e-21,5.418326645183916e-21,5.458167427802492e-21,-5.498007806524284e-21,5.53784858914286e-21,5.577689371761436e-21,5.617529750483228e-21,5.657370533101804e-21,-5.69721131572038e-21,-5.737051694442172e-21,-5.776892477060748e-21,5.816733259679324e-21,5.856573638401116e-21,-5.896414421019692e-21,5.936254799741484e-21,5.97609558236006e-21,6.015936364978636e-21,6.055776743700428e-21,6.095617526319004e-21,6.1354583089375795e-21,6.175298687659372e-21,6.2151394702779476e-21,6.2549802528965234e-21,6.294820631618316e-21,-6.3346614142368915e-21,-6.374501792958684e-21,-6.4143425755772596e-21,6.454183358195835e-21,6.494023736917628e-21,-6.5338645195362034e-21,-6.573705302154779e-21,-6.6135456808765715e-21,-6.653386463495147e-21,6.693227246113723e-21,-6.7330676248355154e-21,6.772908407454091e-21,6.812749190072667e-21,-6.85258956879446e-21,-6.892429947516252e-21,6.932271134031611e-21,6.972111512753403e-21,-7.011951891475195e-21,-7.051793077990555e-21,7.091633456712347e-21,7.13147383543414e-21,-7.171315021949499e-21,-7.211155400671291e-21,7.250995779393083e-21,-7.290836965908442e-21,-7.330677344630235e-21,-7.370517723352027e-21,-7.410358909867386e-21,-7.450199288589179e-21,7.490039667310971e-21,7.52988085382633e-21,7.569721232548123e-21,-7.609561611269915e-21,-7.649401989991707e-21,7.689243176507066e-21,-7.729083555228859e-21,7.768923933950651e-21,-7.80876512046601e-21,7.848605499187803e-21,-7.888445877909595e-21,-7.928287064424954e-21,-7.968127443146746e-21,-8.007967821868539e-21,-8.047809008383898e-21,8.08764938710569e-21,8.127489765827483e-21,-8.167330952342842e-21,-8.207171331064634e-21,-8.247011709786427e-21,8.286852896301786e-21,8.326693275023578e-21,-8.36653365374537e-21,-8.40637484026073e-21,8.446215218982522e-21,-8.486055597704314e-21,8.525896784219674e-21,8.565737162941466e-21,-8.605577541663258e-21,-8.645418728178617e-21,8.68525910690041e-21,8.725099485622202e-21,-8.764939864343994e-21,-8.804781050859354e-21,8.844621429581146e-21,8.884461808302938e-21,-8.924302994818297e-21,8.96414337354009e-21,9.003983752261882e-21,9.043824938777241e-21,-9.083665317499034e-21,-9.123505696220826e-21,9.163346882736185e-21,9.203187261457978e-21,-9.24302764017977e-21,-9.282868826695129e-21,-9.322709205416921e-21,-9.362549584138714e-21,-9.402390770654073e-21,-9.442231149375865e-21,9.482071528097658e-21,-9.521912714613017e-21,-9.561753093334809e-21,9.601593472056601e-21,-9.64143465857196e-21,9.681275037293753e-21,-9.721115416015545e-21,-9.760955794737338e-21,-9.800796981252697e-21,9.840637359974489e-21,-9.880477738696282e-21,-9.920318925211641e-21,-9.960159303933433e-21,9.999999682655225e-21,-1.0039840869170585e-20,1.0079681247892377e-20,1.011952162661417e-20,-1.0159362813129529e-20,-1.0199203191851321e-20,-1.0239043570573113e-20,-1.0278884757088472e-20,1.0318725135810265e-20,1.0358565514532057e-20,1.0398406701047416e-20,1.0438247079769209e-20,1.0478087458491001e-20,-1.051792864500636e-20,1.0557769023728152e-20,-1.0597609402449945e-20,-1.0637450588965304e-20,-1.0677290967687096e-20,-1.0717131346408889e-20,1.0756971725130681e-20,1.079681291164604e-20,1.0836653290367833e-20,-1.0876493669089625e-20,-1.0916334855604984e-20,-1.0956175234326776e-20,-1.0996015613048569e-20,1.1035856799563928e-20,-1.107569717828572e-20,-1.1115537557007513e-20,1.1155378743522872e-20,1.1195219122244664e-20,1.1235059500966456e-20,-1.1274900687481816e-20,1.1314741066203608e-20,-1.13545814449254e-20,-1.139442263144076e-20,-1.1434263010162552e-20,1.1474103388884344e-20,-1.1513944575399703e-20,-1.1553784954121496e-20,1.1593625332843288e-20,1.1633466519358647e-20,1.167330689808044e-20,1.1713147276802232e-20,-1.1752987655524024e-20,1.1792828842039384e-20,1.1832669220761176e-20,-1.1872509599482968e-20,-1.1912350785998327e-20,1.195219116472012e-20,1.1992031543441912e-20,-1.2031872729957271e-20,-1.2071713108679064e-20,-1.2111553487400856e-20,1.2151394673916215e-20,-1.2191235052638007e-20,-1.22310754313598e-20,1.2270916617875159e-20,-1.2310756996596951e-20,-1.2350597375318744e-20,-1.2390438561834103e-20,-1.2430278940555895e-20,1.2470119319277688e-20,-1.2509960505793047e-20,-1.2549800884514839e-20,-1.2589641263236631e-20,1.262948244975199e-20,-1.2669322828473783e-20,1.2709163207195575e-20,1.2749003585917368e-20,-1.2788844772432727e-20,-1.2828685151154519e-20,-1.2868525529876311e-20,1.290836671639167e-20,1.2948207095113463e-20,1.2988047473835255e-20,-1.3027888660350615e-20,1.3067729039072407e-20,1.3107569417794199e-20,1.3147410604309558e-20,-1.3187250983031351e-20,-1.3227091361753143e-20,1.3266932548268502e-20,1.3306772926990295e-20,-1.3346613305712087e-20,-1.3386454492227446e-20,1.3426294870949239e-20,-1.3466135249671031e-20,1.350597643618639e-20,1.3545816814908182e-20,-1.3585658001423542e-20,1.3625498380145334e-20,1.3665338758867126e-20,-1.370517913758892e-20,1.374501951631071e-20,-1.3784859895032503e-20,1.382470188934143e-20,-1.3864542268063222e-20,1.3904382646785014e-20,-1.3944223025506806e-20,1.39840634042286e-20,1.402390378295039e-20,-1.4063745777259317e-20,1.410358615598111e-20,1.4143426534702902e-20,1.4183266913424694e-20,-1.4223107292146486e-20,1.426294767086828e-20,-1.430278804959007e-20,-1.4342630043898997e-20,1.438247042262079e-20,1.4422310801342582e-20,1.4462151180064374e-20,1.4501991558786166e-20,1.454183193750796e-20,1.4581673931816885e-20,-1.4621514310538677e-20,-1.466135468926047e-20,1.4701195067982262e-20,-1.4741035446704054e-20,1.4780875825425846e-20,1.4820717819734773e-20,-1.4860558198456565e-20,1.4900398577178357e-20,1.494023895590015e-20,1.4980079334621942e-20,-1.5019919713343734e-20,1.505976170765266e-20,1.5099602086374453e-20,-1.5139442465096245e-20,-1.5179282843818037e-20,1.521912322253983e-20,-1.5258963601261622e-20,-1.5298803979983414e-20,1.533864597429234e-20,-1.5378486353014133e-20,-1.5418326731735925e-20,-1.5458167110457717e-20,1.549800748917951e-20,1.5537847867901302e-20,-1.5577689862210228e-20,1.561753024093202e-20,1.5657370619653813e-20,-1.5697210998375605e-20,-1.5737051377097397e-20,-1.577689175581919e-20,-1.5816733750128116e-20,-1.5856574128849908e-20,1.58964145075717e-20,-1.5936254886293493e-20,1.5976095265015285e-20,1.6015935643737078e-20,-1.6055777638046004e-20,-1.6095618016767796e-20,1.6135458395489588e-20,1.617529877421138e-20,-1.6215139152933173e-20,-1.6254979531654965e-20,-1.6294819910376758e-20,-1.6334661904685684e-20,1.6374502283407476e-20,1.6414342662129268e-20,1.645418304085106e-20,1.6494023419572853e-20,-1.6533863798294645e-20,-1.6573705792603572e-20,-1.6613546171325364e-20,1.6653386550047156e-20,1.6693226928768948e-20,-1.673306730749074e-20,1.6772907686212533e-20,1.681274968052146e-20,-1.6852590059243252e-20,1.6892430437965044e-20,1.6932270816686836e-20,1.697211119540863e-20,1.701195157413042e-20,-1.7051793568439347e-20,1.709163394716114e-20,-1.7131474325882932e-20,-1.7171314704604724e-20,1.7211155083326516e-20,-1.725099546204831e-20,1.7290837456357235e-20,-1.7330677835079027e-20,1.737051821380082e-20,1.7410358592522612e-20,1.7450198971244404e-20,1.7490039349966196e-20,-1.752987972868799e-20,-1.7569721722996915e-20,1.7609562101718707e-20,-1.76494024804405e-20,-1.7689242859162292e-20,-1.7729083237884084e-20,-1.7768923616605876e-20,1.7808765610914803e-20,1.7848605989636595e-20,-1.7888446368358387e-20,-1.792828674708018e-20,1.7968127125801972e-20,1.8007967504523764e-20,-1.804780949883269e-20,1.8087649877554483e-20,1.8127490256276275e-20,1.8167330634998067e-20,-1.820717101371986e-20,-1.8247011392441652e-20,1.8286853386750578e-20,-1.832669376547237e-20,-1.8366534144194163e-20,-1.8406374522915955e-20,1.8446214901637747e-20,1.848605528035954e-20,1.8525895659081332e-20,1.8565737653390258e-20,-1.860557803211205e-20,1.8645418410833843e-20,1.8685258789555635e-20,-1.8725099168277427e-20,-1.876493954699922e-20,-1.8804781541308146e-20,1.8844621920029938e-20,1.888446229875173e-20,1.8924302677473523e-20,-1.8964143056195315e-20,-1.9003983434917107e-20,1.9043825429226034e-20,1.9083665807947826e-20,1.9123506186669618e-20,1.916334656539141e-20,1.9203186944113203e-20,-1.9243027322834995e-20,1.928286931714392e-20,1.9322709695865714e-20,-1.9362550074587506e-20,-1.9402390453309298e-20,1.944223083203109e-20,-1.9482071210752883e-20,-1.9521911589474675e-20,1.95617535837836e-20,1.9601593962505394e-20,-1.9641434341227186e-20,-1.9681274719948978e-20,1.972111509867077e-20,1.9760955477392563e-20,-1.980079747170149e-20,-1.9840637850423282e-20,1.9880478229145074e-20,1.9920318607866866e-20,1.9960158986588658e-20,-1.999999936531045e-20]} diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/test.js b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/test.js new file mode 100644 index 000000000000..bf6ee649cbac --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/test.js @@ -0,0 +1,147 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); +var modifiedHuberGradient = require( './../lib' ); + + +// FIXTURES // + +var tinyPositive = require( './fixtures/julia/tiny_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); +var tinyNegative = require( './fixtures/julia/tiny_negative.json' ); +var smallNegative = require( './fixtures/julia/small_negative.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof modifiedHuberGradient, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for tiny positive values', function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = tinyPositive.x; + y = tinyPositive.y; + p = tinyPositive.p; + expected = tinyPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for small positive values', function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = smallPositive.x; + y = smallPositive.y; + p = smallPositive.p; + expected = smallPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for tiny negative values', function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = tinyNegative.x; + y = tinyNegative.y; + p = tinyNegative.p; + expected = tinyNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for small negative values', function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = smallNegative.x; + y = smallNegative.y; + p = smallNegative.p; + expected = smallNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { + var v; + + v = modifiedHuberGradient( NaN, 1.0, 0.782 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( 1.0, NaN, 0.782 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( 1.0, 1.0, NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( NaN, NaN, NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `NaN` if y is not +1 or -1', function test( t ) { + var v; + + v = modifiedHuberGradient( -0.9, -3.0, 0.23 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( 0.453, 1.2, 0.76 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/test.native.js b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/test.native.js new file mode 100644 index 000000000000..28b3b14c863b --- /dev/null +++ b/lib/node_modules/@stdlib/ml/base/loss/float32/modified-huber-gradient/test/test.native.js @@ -0,0 +1,156 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 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 isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var tinyPositive = require( './fixtures/julia/tiny_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); +var tinyNegative = require( './fixtures/julia/tiny_negative.json' ); +var smallNegative = require( './fixtures/julia/small_negative.json' ); + + +// VARIABLES // + +var modifiedHuberGradient = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( modifiedHuberGradient instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof modifiedHuberGradient, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for tiny positive values', opts, function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = tinyPositive.x; + y = tinyPositive.y; + p = tinyPositive.p; + expected = tinyPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for small positive values', opts, function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = smallPositive.x; + y = smallPositive.y; + p = smallPositive.p; + expected = smallPositive.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for tiny negative values', opts, function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = tinyNegative.x; + y = tinyNegative.y; + p = tinyNegative.p; + expected = tinyNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the modified Huber loss gradient for small negative values', opts, function test( t ) { + var expected; + var x; + var y; + var p; + var v; + var i; + + x = smallNegative.x; + y = smallNegative.y; + p = smallNegative.p; + expected = smallNegative.expected; + for ( i = 0; i < y.length; i++ ) { + v = modifiedHuberGradient( x[ i ], y[ i ], p[ i ] ); + t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { + var v; + + v = modifiedHuberGradient( NaN, 1.0, 0.782 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( 1.0, NaN, 0.782 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( 1.0, 1.0, NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( NaN, NaN, NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `NaN` if y is not +1 or -1', opts, function test( t ) { + var v; + + v = modifiedHuberGradient( -0.9, -3.0, 0.23 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + + v = modifiedHuberGradient( 0.453, 1.2, 0.76 ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +});