From 4eacb9568fbc50573d9461a40f1c256f03f5eedb Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Tue, 13 Jan 2026 18:04:48 +0530 Subject: [PATCH 01/11] feat: add implementation of halfnormal/quantile --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../base/dists/halfnormal/quantile/README.md | 271 ++++++++++++++++++ .../quantile/benchmark/benchmark.js | 93 ++++++ .../quantile/benchmark/benchmark.native.js | 71 +++++ .../halfnormal/quantile/benchmark/c/Makefile | 146 ++++++++++ .../quantile/benchmark/c/benchmark.c | 141 +++++++++ .../dists/halfnormal/quantile/binding.gyp | 170 +++++++++++ .../dists/halfnormal/quantile/docs/repl.txt | 81 ++++++ .../halfnormal/quantile/docs/types/index.d.ts | 100 +++++++ .../halfnormal/quantile/docs/types/test.ts | 98 +++++++ .../halfnormal/quantile/examples/c/Makefile | 146 ++++++++++ .../halfnormal/quantile/examples/c/example.c | 40 +++ .../halfnormal/quantile/examples/index.js | 34 +++ .../dists/halfnormal/quantile/include.gypi | 53 ++++ .../stats/base/dists/halfnormal/quantile.h | 38 +++ .../dists/halfnormal/quantile/lib/factory.js | 80 ++++++ .../dists/halfnormal/quantile/lib/index.js | 54 ++++ .../dists/halfnormal/quantile/lib/main.js | 93 ++++++ .../dists/halfnormal/quantile/lib/native.js | 75 +++++ .../dists/halfnormal/quantile/manifest.json | 84 ++++++ .../dists/halfnormal/quantile/package.json | 68 +++++ .../dists/halfnormal/quantile/src/Makefile | 70 +++++ .../dists/halfnormal/quantile/src/addon.c | 22 ++ .../base/dists/halfnormal/quantile/src/main.c | 52 ++++ .../quantile/test/fixtures/julia/REQUIRE | 0 .../quantile/test/fixtures/julia/data.json | 1 + .../quantile/test/fixtures/julia/runner.jl | 64 +++++ .../halfnormal/quantile/test/test.factory.js | 108 +++++++ .../dists/halfnormal/quantile/test/test.js | 38 +++ .../halfnormal/quantile/test/test.native.js | 104 +++++++ .../halfnormal/quantile/test/test.quantile.js | 95 ++++++ 30 files changed, 2490 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/binding.gyp create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include.gypi create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include/stdlib/stats/base/dists/halfnormal/quantile.h create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/native.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/Makefile create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/addon.c create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/REQUIRE create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md new file mode 100644 index 000000000000..0aabe538192d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md @@ -0,0 +1,271 @@ + + +# Quantile Function + +> [Half-normal][halfnormal-distribution] distribution [quantile function][quantile-function]. + +
+ +The [quantile function][quantile-function] for a [half-normal][halfnormal-distribution] random variable is + + + +```math +Q(p;\sigma) = \sigma\sqrt{2}\,\mathop{\mathrm{erf}}^{-1}(p) +``` + + + + + +for `0 <= p < 1`, where `σ > 0` is the scale parameter. + +
+ + + +
+ +## Usage + +```javascript +var quantile = require( '@stdlib/stats/base/dists/halfnormal/quantile' ); +``` + +#### quantile( p, sigma ) + +Evaluates the [quantile function][quantile-function] for a [half-normal][halfnormal-distribution] distribution with scale parameter `sigma`. + +```javascript +var y = quantile( 0.5, 1.0 ); +// returns ~0.674 + +y = quantile( 0.8, 2.0 ); +// returns ~2.563 +``` + +If provided a probability `p` outside the interval `[0,1]`, the function returns `NaN`. + +```javascript +var y = quantile( 1.9, 1.0 ); +// returns NaN + +y = quantile( -0.1, 1.0 ); +// returns NaN +``` + +If provided `NaN` as any argument, the function returns `NaN`. + +```javascript +var y = quantile( NaN, 1.0 ); +// returns NaN + +y = quantile( 0.0, NaN ); +// returns NaN +``` + +If provided `sigma < 0`, the function returns `NaN`. + +```javascript +var y = quantile( 0.4, -1.0 ); +// returns NaN +``` + +If provided `sigma = 0`, the function evaluates the [quantile function][quantile-function] of a [degenerate distribution][degenerate-distribution] centered at `0`. + +```javascript +var y = quantile( 0.3, 0.0 ); +// returns 0.0 + +y = quantile( 0.9, 0.0 ); +// returns 0.0 +``` + +#### quantile.factory( sigma ) + +Returns a function for evaluating the [quantile function][quantile-function] of a [half-normal][halfnormal-distribution] distribution with parameter `sigma`. + +```javascript +var myquantile = quantile.factory( 4.0 ); + +var y = myquantile( 0.2 ); +// returns ~1.013 + +y = myquantile( 0.8 ); +// returns ~5.126 +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var quantile = require( '@stdlib/stats/base/dists/halfnormal/quantile' ); + +var opts = { + 'dtype': 'float64' +}; +var sigma = uniform( 10, 0.0, 20.0, opts ); +var p = uniform( 10, 0.0, 1.0, opts ); + +logEachMap( 'p: %lf, σ: %lf, Q(p;σ): %lf', p, sigma, quantile ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/halfnormal/quantile.h" +``` + +#### stdlib_base_dists_halfnormal_quantile( p, sigma ) + +Evaluates the [quantile function][quantile-function] for a [half-normal][halfnormal-distribution] distribution with parameter `sigma` (scale). + +```c +double y = stdlib_base_dists_halfnormal_quantile( 0.8, 1.0 ); +// returns ~1.282 +``` + +The function accepts the following arguments: + +- **p**: `[in] double` probability. +- **sigma**: `[in] double` scale parameter. + +```c +double stdlib_base_dists_halfnormal_quantile( const double p, const double sigma ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/halfnormal/quantile.h" +#include "stdlib/constants/float64/eps.h" +#include +#include + +static double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +int main( void ) { + double sigma; + double p; + double y; + int i; + + for ( i = 0; i < 10; i++ ) { + p = random_uniform( 0.0, 1.0 ); + sigma = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 ); + y = stdlib_base_dists_halfnormal_quantile( p, sigma ); + printf( "p:%lf, σ: %lf, Q(p;σ): %lf\n", p, sigma, y ); + } +} +``` + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js new file mode 100644 index 000000000000..2815ef3fd5c8 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js @@ -0,0 +1,93 @@ +/** +* @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 Float64Array = require( '@stdlib/array/float64' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var pkg = require( './../package.json' ).name; +var quantile = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var sigma; + var len; + var p; + var y; + var i; + + len = 100; + p = new Float64Array( len ); + sigma = new Float64Array( len ); + for ( i = 0; i < len; i++ ) { + p[ i ] = uniform( 0.0, 1.0 ); + sigma[ i ] = uniform( EPS, 20.0 ); + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = quantile( p[ i % len ], sigma[ i % len ] ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+':factory', function benchmark( b ) { + var myquantile; + var sigma; + var len; + var p; + var y; + var i; + + sigma = 4.0; + myquantile = quantile.factory( sigma ); + len = 100; + p = new Float64Array( len ); + for ( i = 0; i < len; i++ ) { + p[ i ] = uniform( 0.0, 1.0 ); + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = myquantile( p[ i % len ] ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js new file mode 100644 index 000000000000..6e7ed876ec0a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js @@ -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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var quantile = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( quantile instanceof Error ) +}; + + +// MAIN // + +bench( pkg+'::native', opts, function benchmark( b ) { + var sigma; + var len; + var p; + var y; + var i; + + len = 100; + p = new Float64Array( len ); + sigma = new Float64Array( len ); + for ( i = 0; i < len; i++ ) { + p[ i ] = uniform( 0.0, 1.0 ); + sigma[ i ] = uniform( EPS, 20.0 ); + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = quantile( p[ i % len ], sigma[ i % len ] ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile new file mode 100644 index 000000000000..a4bd7b38fd74 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := 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/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c new file mode 100644 index 000000000000..50195b410ece --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c @@ -0,0 +1,141 @@ +/** +* @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/stats/base/dists/halfnormal/quantile.h" +#include "stdlib/constants/float64/eps.h" +#include +#include +#include +#include +#include + +#define NAME "halfnormal-quantile" +#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 double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + double elapsed; + double p[ 100 ]; + double sigma[ 100 ]; + double y; + double t; + int i; + + for ( i = 0; i < 100; i++ ) { + p[ i ] = random_uniform( 0.0, 1.0 ); + sigma[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 ); + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + y = stdlib_base_dists_halfnormal_quantile( p[ i % 100 ], sigma[ i % 100 ] ); + if ( y != y ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( y != y ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int i; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + for ( i = 0; i < REPEATS; i++ ) { + printf( "# c::%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/stats/base/dists/halfnormal/quantile/binding.gyp b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/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/stats/base/dists/halfnormal/quantile/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/repl.txt new file mode 100644 index 000000000000..3a54c869fe9a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/repl.txt @@ -0,0 +1,81 @@ +{{alias}}( p, σ ) + Evaluates the quantile function for a Half-Normal distribution with scale + parameter `σ` at a probability `p`. + + If `p < 0` or `p > 1`, the function returns `NaN`. + + If provided `NaN` as any argument, the function returns `NaN`. + + If provided `σ < 0`, the function returns `NaN`. + + If `σ = 0`, the function returns `0`. + + If `p = 1`, the function returns `+∞`. + + Parameters + ---------- + p: number + Input probability. + + σ: number + Scale parameter. + + Returns + ------- + out: number + Evaluated quantile function. + + Examples + -------- + > var y = {{alias}}( 0.8, 1.0 ) + ~1.2816 + + > y = {{alias}}( 0.5, 2.0 ) + ~1.3490 + + > y = {{alias}}( 0.5, 4.0 ) + ~2.6980 + + > y = {{alias}}( 1.1, 1.0 ) + NaN + + > y = {{alias}}( -0.2, 1.0 ) + NaN + + > y = {{alias}}( NaN, 1.0 ) + NaN + + > y = {{alias}}( 0.0, NaN ) + NaN + + // Negative scale parameter: + > y = {{alias}}( 0.5, -1.0 ) + NaN + + +{{alias}}.factory( σ ) + Returns a function for evaluating the quantile function of a Half-Normal + distribution with scale parameter `σ`. + + Parameters + ---------- + σ: number + Scale parameter. + + Returns + ------- + quantile: Function + Quantile function. + + Examples + -------- + > var myQuantile = {{alias}}.factory( 2.0 ); + + > var y = myQuantile( 0.5 ) + ~1.3490 + + > y = myQuantile( 0.8 ) + ~2.5631 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts new file mode 100644 index 000000000000..c29b0bd79da0 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts @@ -0,0 +1,100 @@ +/* +* @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 + +/** +* Evaluates the quantile function for a half-normal distribution. +* +* @param p - cumulative probability +* @returns evaluated quantile +*/ +type Unary = ( p: number ) => number; + +/** +* Interface for the quantile function of a half-normal distribution. +*/ +interface Quantile { + /** + * Evaluates the quantile function for a half-normal distribution with scale parameter `sigma`. + * + * ## Notes + * + * - If `sigma < 0`, the function returns `NaN`. + * - If `p < 0` or `p > 1`, the function returns `NaN`. + * - If `sigma = 0`, the function returns `0`. + * - If `p = 1`, the function returns `+Infinity`. + * + * @param p - cumulative probability + * @param sigma - scale parameter + * @returns evaluated quantile + * + * @example + * var y = quantile( 0.8, 1.0 ); + * // returns ~1.2816 + * + * @example + * var y = quantile( 0.5, 2.0 ); + * // returns ~1.3490 + * + * @example + * var y = quantile( 1.1, 1.0 ); + * // returns NaN + * + * @example + * // Negative scale parameter: + * var y = quantile( 0.5, -1.0 ); + * // returns NaN + */ + ( p: number, sigma: number ): number; + + /** + * Returns a function for evaluating the quantile function for a half-normal distribution with scale parameter `sigma`. + * + * @param sigma - scale parameter + * @returns quantile function + * + * @example + * var myquantile = quantile.factory( 2.0 ); + * var y = myquantile( 0.5 ); + * // returns ~1.3490 + */ + factory( sigma: number ): Unary; +} + +/** +* Half-normal distribution quantile function. +* +* @param p - cumulative probability +* @param sigma - scale parameter +* @returns evaluated quantile +* +* @example +* var y = quantile( 0.8, 1.0 ); +* // returns ~1.2816 +* +* var myquantile = quantile.factory( 1.0 ); +* var y = myquantile( 0.8 ); +* // returns ~1.2816 +*/ +declare var quantile: Quantile; + + +// EXPORTS // + +export = quantile; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/test.ts new file mode 100644 index 000000000000..6eec785bf355 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/test.ts @@ -0,0 +1,98 @@ +/* +* @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 quantile = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + quantile( 0.2, 4 ); // $ExpectType number + quantile( 0.8, 8 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided values other than two numbers... +{ + quantile( true, 6 ); // $ExpectError + quantile( false, 4 ); // $ExpectError + quantile( '5', 2 ); // $ExpectError + quantile( [], 2 ); // $ExpectError + quantile( {}, 4 ); // $ExpectError + quantile( ( x: number ): number => x, 4 ); // $ExpectError + + quantile( 0.2, true ); // $ExpectError + quantile( 0.8, false ); // $ExpectError + quantile( 0.5, '5' ); // $ExpectError + quantile( 0.8, [] ); // $ExpectError + quantile( 0.9, {} ); // $ExpectError + quantile( 0.8, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + quantile(); // $ExpectError + quantile( 0.2 ); // $ExpectError + quantile( 0.2, 4, 1 ); // $ExpectError +} + +// Attached to main export is a `factory` method which returns a function... +{ + quantile.factory( 4 ); // $ExpectType Unary +} + +// The `factory` method returns a function which returns a number... +{ + const fcn = quantile.factory( 4 ); + fcn( 0.5 ); // $ExpectType number +} + +// The compiler throws an error if the function returned by the `factory` method is provided invalid arguments... +{ + const fcn = quantile.factory( 4 ); + fcn( true ); // $ExpectError + fcn( false ); // $ExpectError + fcn( '5' ); // $ExpectError + fcn( [] ); // $ExpectError + fcn( {} ); // $ExpectError + fcn( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function returned by the `factory` method is provided an unsupported number of arguments... +{ + const fcn = quantile.factory( 4 ); + fcn(); // $ExpectError + fcn( 2, 0 ); // $ExpectError + fcn( 2, 0, 1 ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided values other than one number... +{ + quantile.factory( true ); // $ExpectError + quantile.factory( false ); // $ExpectError + quantile.factory( '5' ); // $ExpectError + quantile.factory( [] ); // $ExpectError + quantile.factory( {} ); // $ExpectError + quantile.factory( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided an unsupported number of arguments... +{ + quantile.factory(); // $ExpectError + quantile.factory( 0, 4 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/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/stats/base/dists/halfnormal/quantile/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/c/example.c new file mode 100644 index 000000000000..5deff2a54239 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/c/example.c @@ -0,0 +1,40 @@ +/** +* @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/stats/base/dists/halfnormal/quantile.h" +#include +#include + +static double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +int main( void ) { + double sigma; + double p; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + p = random_uniform( 0.0, 1.0 ); + sigma = random_uniform( 0.0, 10.0 ); + y = stdlib_base_dists_halfnormal_quantile( p, sigma ); + printf( "p: %lf, σ: %lf, Q(p;σ): %lf\n", p, sigma, y ); + } +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js new file mode 100644 index 000000000000..95e4060a12a3 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js @@ -0,0 +1,34 @@ +/** +* @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 randu = require( '@stdlib/random/base/randu' ); +var quantile = require( './../lib' ); + +var i; +var p; +var sigma; +var y; + +for ( i = 0; i < 25; i++ ) { + p = randu(); // p in [0,1) + sigma = randu() * 3.0; // sigma >= 0 + y = quantile( p, sigma ); + console.log( 'p: %lf, σ: %lf, Q(p;σ): %lf', p, sigma, y ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include.gypi b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/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': [ + ' + */ + function quantile( p ) { + if ( isnan( p ) || p < 0.0 || p > 1.0 ) { + return NaN; + } + if ( p === 1.0 ) { + return PINF; + } + return sigma * SQRT2 * erfinv( p ); + } +} + + +// EXPORTS // + +module.exports = factory; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js new file mode 100644 index 000000000000..e0fd755c376d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js @@ -0,0 +1,54 @@ +/** +* @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'; + +/** +* Halfnormal distribution quantile function. +* +* @module @stdlib/stats/base/dists/halfnormal/quantile +* +* @example +* var quantile = require( '@stdlib/stats/base/dists/halfnormal/quantile' ); +* +* var y = quantile( 0.8, 1.0 ); +* // returns ~1.282 +* +* var myQuantile = quantile.factory( 1.0 ); +* y = myQuantile( 0.5 ); +* // returns ~0.674 +* +* y = myQuantile( 0.7 ); +* // returns ~1.036 +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var factory = require( './factory.js' ); + + +// MAIN // + +setReadOnly( main, 'factory', factory ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/main.js new file mode 100644 index 000000000000..5b58c79258e4 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/main.js @@ -0,0 +1,93 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var erfinv = require( '@stdlib/math/base/special/erfinv' ); +var SQRT2 = require( '@stdlib/constants/float64/sqrt-two' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); + + +// MAIN // + +/** +* Evaluates the quantile function for a Half-Normal distribution with scale parameter `sigma` at a probability `p`. +* +* @param {Probability} p - cumulative probability +* @param {NonNegativeNumber} sigma - scale parameter +* @returns {number} evaluated quantile function +* +* @example +* var y = quantile( 0.8, 1.0 ); +* // returns ~1.2816 +* +* @example +* var y = quantile( 0.5, 2.0 ); +* // returns ~1.3490 +* +* @example +* var y = quantile( 0.5, 4.0 ); +* // returns ~2.6980 +* +* @example +* var y = quantile( 1.1, 1.0 ); +* // returns NaN +* +* @example +* var y = quantile( -0.2, 1.0 ); +* // returns NaN +* +* @example +* var y = quantile( NaN, 1.0 ); +* // returns NaN +* +* @example +* var y = quantile( 0.0, NaN ); +* // returns NaN +* +* @example +* // Negative scale parameter: +* var y = quantile( 0.5, -1.0 ); +* // returns NaN +*/ +function quantile( p, sigma ) { + if ( + isnan( sigma ) || + isnan( p ) || + sigma < 0.0 || + p < 0.0 || + p > 1.0 + ) { + return NaN; + } + if ( sigma === 0.0 ) { + return 0.0; + } + if ( p === 1.0 ) { + return PINF; + } + return sigma * SQRT2 * erfinv( p ); +} + + +// EXPORTS // + +module.exports = quantile; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/native.js new file mode 100644 index 000000000000..4255bbd7b1fa --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/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 addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Evaluates the quantile function for a Half-Normal distribution with scale parameter `sigma` at a probability `p`. +* +* @param {Probability} p - cumulative probability +* @param {NonNegativeNumber} sigma - scale parameter +* @returns {number} evaluated quantile function +* +* @example +* var y = quantile( 0.8, 1.0 ); +* // returns ~1.2816 +* +* @example +* var y = quantile( 0.5, 2.0 ); +* // returns ~1.3490 +* +* @example +* var y = quantile( 0.5, 4.0 ); +* // returns ~2.6980 +* +* @example +* var y = quantile( 1.1, 1.0 ); +* // returns NaN +* +* @example +* var y = quantile( -0.2, 1.0 ); +* // returns NaN +* +* @example +* var y = quantile( NaN, 1.0 ); +* // returns NaN +* +* @example +* var y = quantile( 0.0, NaN ); +* // returns NaN +* +* @example +* // Negative scale parameter: +* var y = quantile( 0.5, -1.0 ); +* // returns NaN +*/ +function quantile( p, sigma ) { + return addon( p, sigma ); +} + + +// EXPORTS // + +module.exports = quantile; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json new file mode 100644 index 000000000000..833d05bf1a41 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json @@ -0,0 +1,84 @@ +{ + "options": { + "task": "build", + "wasm": false + }, + "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", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/napi/binary", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/special/erfinv", + "@stdlib/constants/float64/sqrt-two" + ] + }, + { + "task": "benchmark", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nan", + "@stdlib/constants/float64/eps", + "@stdlib/math/base/special/erfinv", + "@stdlib/constants/float64/sqrt-two" + ] + }, + { + "task": "examples", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nan", + "@stdlib/constants/float64/eps", + "@stdlib/math/base/special/erfinv", + "@stdlib/constants/float64/sqrt-two" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json new file mode 100644 index 000000000000..f569963257e6 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/stats/base/dists/halfnormal/quantile", + "version": "0.0.0", + "description": "Half-normal distribution quantile function.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "statistics", + "stats", + "distribution", + "dist", + "probability", + "cdf", + "inverse", + "half-normal", + "univariate", + "continuous" + ] +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/Makefile b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/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/stats/base/dists/halfnormal/quantile/src/addon.c b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/addon.c new file mode 100644 index 000000000000..3e0f61fd98ed --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/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/stats/base/dists/halfnormal/quantile.h" +#include "stdlib/math/base/napi/binary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_dists_halfnormal_quantile ) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c new file mode 100644 index 000000000000..094e4a450184 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c @@ -0,0 +1,52 @@ +/** +* @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/stats/base/dists/halfnormal/quantile.h" +#include "stdlib/math/base/assert/is_nan.h" +#include "stdlib/math/base/special/erfinv.h" +#include "stdlib/constants/float64/sqrt_two.h" + +/** +* Evaluates the quantile function for a Half-normal distribution with cumulative probability p and scale `sigma`. +* +* @param p probability +* @param sigma scale parameter +* @return evaluated quantile +* +* @example +* double y = stdlib_base_dists_halfnormal_quantile( 0.8, 1.0 ); +* // returns ~1.282 +*/ +double stdlib_base_dists_halfnormal_quantile( const double p, const double sigma ) { + if ( + stdlib_base_is_nan( p ) || + stdlib_base_is_nan( sigma ) || + sigma < 0.0 || + p < 0.0 || + p > 1.0 + ) { + return 0.0 / 0.0; // NaN + } + if( sigma == 0.0 ){ + return 0.0; + } + if( p == 1.0 ){ + return 1.0 / 0.0; // +infinity + } + return sigma * STDLIB_CONSTANT_FLOAT64_SQRT2 * stdlib_base_erfinv( p ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json new file mode 100644 index 000000000000..8eec56801a4c --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json @@ -0,0 +1 @@ +{"sigma":[3.752372343198736,0.5952487736546558,3.3856198354728,1.3195086901125626,0.33660791776355947,3.0698228295251733,2.8333822017156756,0.842096233317226,0.9014208323745504,0.9645360412814957],"expected":[4.115703132034415,0.4368820501703096,3.423273300043822,0.6971282572460012,0.27955804839293547,0.6442160951563007,2.626768194061231,0.24752155341315513,0.04330086356582894,1.155323910174928],"p":[0.7272829554760867,0.5370199818842734,0.6880417602571298,0.40272560115812794,0.5937525368951077,0.1662187547190921,0.6461143084421898,0.23119242465068246,0.038312635981986976,0.7690061785566936]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl new file mode 100644 index 000000000000..8f5dfec5906d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl @@ -0,0 +1,64 @@ +#!/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. + +using Distributions +using SpecialFunctions # for erfinv +using JSON + +""" + gen(p, sigma, name) + +Generate Half-Normal quantile fixture data. + +# Arguments +- `p`: probability values (0 ≤ p ≤ 1) +- `sigma`: scale parameters (σ ≥ 0) +- `name`: output filename +""" +function gen(p, sigma, name) + z = Array{Float64}(undef, length(p)) + for i in eachindex(p) + # Half-normal quantile: + # Q(p) = sigma * sqrt(2) * erfinv(p) + z[i] = sigma[i] * sqrt(2.0) * erfinv(p[i]) + end + + data = Dict( + "p" => p, + "sigma" => sigma, + "expected" => z + ) + + filepath = joinpath(dir, name) + open(filepath, "w") do f + write(f, JSON.json(data)) + write(f, "\n") + end +end + +# Directory of this script +file = @__FILE__ +dir = dirname(file) + +# Generate random test values +N = 10 +p = rand(N) # in (0,1) +sigma = rand(N) .* 5.0 # σ in [0,5) + +# Write a single data file +gen(p, sigma, "data.json") diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js new file mode 100644 index 000000000000..5a1b554d175b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -0,0 +1,108 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var factory = require( './../lib/factory.js' ); + + +// FIXTURES // + +var data = require( './fixtures/julia/data.json' ); +var p = data.p; +var sigma = data.sigma; +var expected = data.expected; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'factory returns a function', function test( t ) { + var q = factory( 1.0 ); + t.strictEqual( typeof q, 'function', 'returns expected value' ); + t.end(); +}); + +tape( 'if sigma is NaN or < 0, returned function always returns NaN', function test( t ) { + var q; + + q = factory( NaN ); + t.ok( isnan( q( 0.5 ) ), 'sigma NaN' ); + + q = factory( -1.0 ); + t.ok( isnan( q( 0.5 ) ), 'sigma < 0' ); + + t.end(); +}); + +tape( 'if sigma = 0, quantile always returns 0', function test( t ) { + var q = factory( 0.0 ); + t.strictEqual( q( 0.0 ), 0.0 ); + t.strictEqual( q( 0.5 ), 0.0 ); + t.strictEqual( q( 1.0 ), 0.0 ); + t.end(); +}); + +tape( 'if p < 0, p > 1, or p is NaN, quantile returns NaN', function test( t ) { + var q = factory( 1.0 ); + + t.ok( isnan( q( -0.1 ) ), 'p < 0' ); + t.ok( isnan( q( 1.1 ) ), 'p > 1' ); + t.ok( isnan( q( NaN ) ), 'p NaN' ); + + t.end(); +}); + +tape( 'p = 1 returns +Infinity', function test( t ) { + var q = factory( 1.0 ); + t.strictEqual( q( 1.0 ), PINF, 'returns +Infinity' ); + t.end(); +}); + +tape( 'the factory evaluates the half-normal quantile correctly', function test( t ) { + var delta; + var tol; + var q; + var i; + + for ( i = 0; i < p.length; i++ ) { + q = factory( sigma[i] ); + if ( expected[i] !== null ) { + if ( q( p[i] ) === expected[i] ) { + t.strictEqual( q( p[i] ), expected[i], 'exact match' ); + } else { + delta = abs( q( p[i] ) - expected[i] ); + tol = 40.0 * EPS * abs( expected[i] ); + t.ok(delta <= tol, 'p: '+p[i]+', sigma: '+sigma[i]+', q: '+q(p[i])+', expected: '+expected[i]); + } + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.js new file mode 100644 index 000000000000..ea2a910239b6 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.js @@ -0,0 +1,38 @@ +/** +* @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 quantile = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof quantile, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a factory method for generating `quantile` functions', function test( t ) { + t.strictEqual( typeof quantile.factory, 'function', 'exports a factory method' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js new file mode 100644 index 000000000000..f321a2cd8bef --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -0,0 +1,104 @@ +/** +* @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 tryRequire = require( '@stdlib/utils/try-require' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); + + +// VARIABLES // + +var quantile = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( quantile instanceof Error ) +}; + + +// FIXTURES // + +var data = require( './fixtures/julia/data.json' ); +var p = data.p; +var sigma = data.sigma; +var expected = data.expected; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if any argument is NaN, the function returns NaN', opts, function test( t ) { + t.ok( isnan( quantile( NaN, 1.0 ) ), 'p NaN' ); + t.ok( isnan( quantile( 0.5, NaN ) ), 'sigma NaN' ); + t.end(); +}); + +tape( 'if p is outside [0,1], the function returns NaN', opts, function test( t ) { + t.ok( isnan( quantile( -0.1, 1.0 ) ), 'p < 0' ); + t.ok( isnan( quantile( 1.1, 1.0 ) ), 'p > 1' ); + t.end(); +}); + +tape( 'if sigma < 0, the function returns NaN', opts, function test( t ) { + t.ok( isnan( quantile( 0.5, -1.0 ) ), 'negative sigma' ); + t.end(); +}); + +tape( 'if sigma = 0, the quantile is 0 for all p', opts, function test( t ) { + t.strictEqual( quantile( 0.0, 0.0 ), 0.0 ); + t.strictEqual( quantile( 0.5, 0.0 ), 0.0 ); + t.strictEqual( quantile( 1.0, 0.0 ), 0.0 ); + t.end(); +}); + +tape( 'p = 1 returns +Infinity', opts, function test( t ) { + t.strictEqual( quantile( 1.0, 1.0 ), PINF ); + t.end(); +}); + +tape( 'the native function evaluates the half-normal quantile correctly', opts, function test( t ) { + var delta; + var tol; + var y; + var i; + + for ( i = 0; i < p.length; i++ ) { + y = quantile( p[i], sigma[i] ); + if ( expected[i] !== null ) { + if ( y === expected[i] ) { + t.strictEqual( y, expected[i], 'exact match' ); + } else { + delta = abs( y - expected[i] ); + tol = 40.0 * EPS * abs( expected[i] ); + t.ok(delta <= tol, 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i]); + } + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js new file mode 100644 index 000000000000..a5907775251f --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -0,0 +1,95 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var quantile = require( './../lib' ); + + +// FIXTURES // + +var data = require( './fixtures/julia/data.json' ); +var p = data.p; +var sigma = data.sigma; +var expected = data.expected; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if any argument is NaN, the function returns NaN', function test( t ) { + t.ok( isnan( quantile( NaN, 1.0 ) ), 'p NaN' ); + t.ok( isnan( quantile( 0.5, NaN ) ), 'sigma NaN' ); + t.end(); +}); + +tape( 'if p is outside [0,1], the function returns NaN', function test( t ) { + t.ok( isnan( quantile( -0.1, 1.0 ) ), 'p < 0' ); + t.ok( isnan( quantile( 1.1, 1.0 ) ), 'p > 1' ); + t.end(); +}); + +tape( 'if sigma < 0, the function returns NaN', function test( t ) { + t.ok( isnan( quantile( 0.5, -1.0 ) ), 'negative sigma' ); + t.end(); +}); + +tape( 'if sigma = 0, the quantile is 0 for all p', function test( t ) { + t.strictEqual( quantile( 0.0, 0.0 ), 0.0 ); + t.strictEqual( quantile( 0.5, 0.0 ), 0.0 ); + t.strictEqual( quantile( 1.0, 0.0 ), 0.0 ); + t.end(); +}); + +tape( 'p = 1 returns +Infinity', function test( t ) { + t.strictEqual( quantile( 1.0, 1.0 ), PINF ); + t.end(); +}); + +tape( 'the function evaluates the half-normal quantile correctly', function test( t ) { + var delta; + var tol; + var y; + var i; + + for ( i = 0; i < p.length; i++ ) { + y = quantile( p[i], sigma[i] ); + if ( expected[i] !== null ) { + if ( y === expected[i] ) { + t.strictEqual( y, expected[i], 'exact match' ); + } else { + delta = abs( y - expected[i] ); + tol = 40.0 * EPS * abs( expected[i] ); + t.ok(delta <= tol, 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i]); + } + } + } + t.end(); +}); From 17da207e1181d16025ea24cc8a6e373074602cc8 Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Tue, 13 Jan 2026 18:10:32 +0530 Subject: [PATCH 02/11] fix: changed wrong variable names in test files --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../stats/base/dists/halfnormal/quantile/test/test.native.js | 2 +- .../stats/base/dists/halfnormal/quantile/test/test.quantile.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index f321a2cd8bef..f76fa9a748e2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -49,7 +49,7 @@ var expected = data.expected; tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.strictEqual( typeof quantile, 'function', 'main export is a function' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index a5907775251f..d7adb981ea54 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -40,7 +40,7 @@ var expected = data.expected; tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.strictEqual( typeof quantile, 'function', 'main export is a function' ); t.end(); }); From 76453beb962dfe9418782b1673ec0e2ccc856e0d Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Tue, 13 Jan 2026 23:05:25 +0530 Subject: [PATCH 03/11] fix: addresses review comments --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../stats/base/dists/halfnormal/quantile/README.md | 12 ++++++------ .../dists/halfnormal/quantile/docs/types/index.d.ts | 8 ++++---- .../base/dists/halfnormal/quantile/lib/factory.js | 4 ++-- .../base/dists/halfnormal/quantile/lib/index.js | 2 +- .../stats/base/dists/halfnormal/quantile/src/main.c | 4 ++-- .../dists/halfnormal/quantile/test/test.factory.js | 2 +- .../dists/halfnormal/quantile/test/test.native.js | 2 +- .../dists/halfnormal/quantile/test/test.quantile.js | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md index 0aabe538192d..9c20e78973fc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md @@ -24,16 +24,16 @@ limitations under the License.
-The [quantile function][quantile-function] for a [half-normal][halfnormal-distribution] random variable is +The [quantile function][quantile-function] for a [Half-normal][halfnormal-distribution] random variable is - + ```math Q(p;\sigma) = \sigma\sqrt{2}\,\mathop{\mathrm{erf}}^{-1}(p) ``` @@ -55,7 +55,7 @@ var quantile = require( '@stdlib/stats/base/dists/halfnormal/quantile' ); #### quantile( p, sigma ) -Evaluates the [quantile function][quantile-function] for a [half-normal][halfnormal-distribution] distribution with scale parameter `sigma`. +Evaluates the [quantile function][quantile-function] for a [Half-normal][halfnormal-distribution] distribution with scale parameter `sigma`. ```javascript var y = quantile( 0.5, 1.0 ); @@ -104,7 +104,7 @@ y = quantile( 0.9, 0.0 ); #### quantile.factory( sigma ) -Returns a function for evaluating the [quantile function][quantile-function] of a [half-normal][halfnormal-distribution] distribution with parameter `sigma`. +Returns a function for evaluating the [quantile function][quantile-function] of a [Half-normal][halfnormal-distribution] distribution with parameter `sigma`. ```javascript var myquantile = quantile.factory( 4.0 ); @@ -172,7 +172,7 @@ logEachMap( 'p: %lf, σ: %lf, Q(p;σ): %lf', p, sigma, quantile ); #### stdlib_base_dists_halfnormal_quantile( p, sigma ) -Evaluates the [quantile function][quantile-function] for a [half-normal][halfnormal-distribution] distribution with parameter `sigma` (scale). +Evaluates the [quantile function][quantile-function] for a [Half-normal][halfnormal-distribution] distribution with parameter `sigma` (scale). ```c double y = stdlib_base_dists_halfnormal_quantile( 0.8, 1.0 ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts index c29b0bd79da0..e9bc4b5266d9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts @@ -19,7 +19,7 @@ // TypeScript Version: 4.1 /** -* Evaluates the quantile function for a half-normal distribution. +* Evaluates the quantile function for a Half-normal distribution. * * @param p - cumulative probability * @returns evaluated quantile @@ -27,11 +27,11 @@ type Unary = ( p: number ) => number; /** -* Interface for the quantile function of a half-normal distribution. +* Interface for the quantile function of a Half-normal distribution. */ interface Quantile { /** - * Evaluates the quantile function for a half-normal distribution with scale parameter `sigma`. + * Evaluates the quantile function for a Half-normal distribution with scale parameter `sigma`. * * ## Notes * @@ -64,7 +64,7 @@ interface Quantile { ( p: number, sigma: number ): number; /** - * Returns a function for evaluating the quantile function for a half-normal distribution with scale parameter `sigma`. + * Returns a function for evaluating the quantile function for a Half-normal distribution with scale parameter `sigma`. * * @param sigma - scale parameter * @returns quantile function diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js index 2f927907ce35..9f5a1629f119 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js @@ -30,7 +30,7 @@ var PINF = require( '@stdlib/constants/float64/pinf' ); // MAIN // /** -* Returns a function for evaluating the quantile function for a half-normal distribution with scale parameter `sigma`. +* Returns a function for evaluating the quantile function for a Half-normal distribution with scale parameter `sigma`. * * @param {NonNegativeNumber} sigma - scale parameter * @returns {Function} quantile function @@ -53,7 +53,7 @@ function factory( sigma ) { return quantile; /** - * Evaluates the quantile function for a half-normal distribution. + * Evaluates the quantile function for a Half-normal distribution. * * @private * @param {Probability} p - input value diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js index e0fd755c376d..ab5461df0d39 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Halfnormal distribution quantile function. +* Half-normal distribution quantile function. * * @module @stdlib/stats/base/dists/halfnormal/quantile * diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c index 094e4a450184..75646bd5b8d2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c @@ -42,10 +42,10 @@ double stdlib_base_dists_halfnormal_quantile( const double p, const double sigma ) { return 0.0 / 0.0; // NaN } - if( sigma == 0.0 ){ + if ( sigma == 0.0 ) { return 0.0; } - if( p == 1.0 ){ + if ( p == 1.0 ) { return 1.0 / 0.0; // +infinity } return sigma * STDLIB_CONSTANT_FLOAT64_SQRT2 * stdlib_base_erfinv( p ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js index 5a1b554d175b..0f0961ac02a2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -86,7 +86,7 @@ tape( 'p = 1 returns +Infinity', function test( t ) { t.end(); }); -tape( 'the factory evaluates the half-normal quantile correctly', function test( t ) { +tape( 'the factory evaluates the Half-normal quantile correctly', function test( t ) { var delta; var tol; var q; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index f76fa9a748e2..c2d45671affc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -82,7 +82,7 @@ tape( 'p = 1 returns +Infinity', opts, function test( t ) { t.end(); }); -tape( 'the native function evaluates the half-normal quantile correctly', opts, function test( t ) { +tape( 'the native function evaluates the Half-normal quantile correctly', opts, function test( t ) { var delta; var tol; var y; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index d7adb981ea54..2245271a4122 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -73,7 +73,7 @@ tape( 'p = 1 returns +Infinity', function test( t ) { t.end(); }); -tape( 'the function evaluates the half-normal quantile correctly', function test( t ) { +tape( 'the function evaluates the Half-normal quantile correctly', function test( t ) { var delta; var tol; var y; From 56fcf300ebd1e147297342037954067ca13d9091 Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Tue, 13 Jan 2026 23:14:08 +0530 Subject: [PATCH 04/11] fix: copyright year fix --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../stats/base/dists/halfnormal/quantile/benchmark/c/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile index a4bd7b38fd74..979768abbcec 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2025 The Stdlib Authors. +# 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. From 96e103e8e01adbe5166abd52219573a49e9de396 Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Fri, 23 Jan 2026 17:32:59 +0530 Subject: [PATCH 05/11] fix: migrate from julia to python fixtures and minor style changes --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: missing_dependencies - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/dists/halfnormal/quantile/README.md | 8 +- .../quantile/benchmark/c/benchmark.c | 2 +- .../halfnormal/quantile/examples/index.js | 27 ++++--- .../stats/base/dists/halfnormal/quantile.h | 2 +- .../dists/halfnormal/quantile/lib/factory.js | 6 +- .../dists/halfnormal/quantile/lib/native.js | 1 + .../quantile/test/fixtures/julia/REQUIRE | 0 .../quantile/test/fixtures/julia/data.json | 1 - .../quantile/test/fixtures/julia/runner.jl | 64 --------------- .../quantile/test/fixtures/python/data.json | 1 + .../quantile/test/fixtures/python/runner.py | 80 +++++++++++++++++++ .../halfnormal/quantile/test/test.factory.js | 17 ++-- .../halfnormal/quantile/test/test.native.js | 13 +-- .../halfnormal/quantile/test/test.quantile.js | 13 +-- 14 files changed, 120 insertions(+), 115 deletions(-) delete mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/REQUIRE delete mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json delete mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md index 9c20e78973fc..8bc627389413 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md @@ -32,10 +32,6 @@ The [quantile function][quantile-function] for a [Half-normal][halfnormal-distri Q(p;\sigma) = \sigma\sqrt{2}\,\mathop{\mathrm{erf}}^{-1}(p) ``` - @@ -104,7 +100,7 @@ y = quantile( 0.9, 0.0 ); #### quantile.factory( sigma ) -Returns a function for evaluating the [quantile function][quantile-function] of a [Half-normal][halfnormal-distribution] distribution with parameter `sigma`. +Returns a function for evaluating the [quantile function][quantile-function] of a [Half-normal][halfnormal-distribution] distribution with scale parameter `sigma`. ```javascript var myquantile = quantile.factory( 4.0 ); @@ -172,7 +168,7 @@ logEachMap( 'p: %lf, σ: %lf, Q(p;σ): %lf', p, sigma, quantile ); #### stdlib_base_dists_halfnormal_quantile( p, sigma ) -Evaluates the [quantile function][quantile-function] for a [Half-normal][halfnormal-distribution] distribution with parameter `sigma` (scale). +Evaluates the [quantile function][quantile-function] for a [Half-normal][halfnormal-distribution] distribution with scale parameter `sigma` (scale). ```c double y = stdlib_base_dists_halfnormal_quantile( 0.8, 1.0 ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c index 50195b410ece..d8d4a3b4957b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/c/benchmark.c @@ -93,9 +93,9 @@ static double random_uniform( const double min, const double max ) { * @return elapsed time in seconds */ static double benchmark( void ) { - double elapsed; double p[ 100 ]; double sigma[ 100 ]; + double elapsed; double y; double t; int i; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js index 95e4060a12a3..e4c2878cb493 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js @@ -18,17 +18,20 @@ 'use strict'; -var randu = require( '@stdlib/random/base/randu' ); +// MODULES // + +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); var quantile = require( './../lib' ); -var i; -var p; -var sigma; -var y; - -for ( i = 0; i < 25; i++ ) { - p = randu(); // p in [0,1) - sigma = randu() * 3.0; // sigma >= 0 - y = quantile( p, sigma ); - console.log( 'p: %lf, σ: %lf, Q(p;σ): %lf', p, sigma, y ); -} + +// MAIN // + +var opts = { + 'dtype': 'float64' +}; + +var p = uniform( 25, 0.0, 1.0, opts ); +var sigma = uniform( 25, 0.0, 3.0, opts ); + +logEachMap( 'p: %lf, σ: %lf, Q(p;σ): %lf', p, sigma, quantile ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include/stdlib/stats/base/dists/halfnormal/quantile.h b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include/stdlib/stats/base/dists/halfnormal/quantile.h index 8220ed1c3569..487d2046da23 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include/stdlib/stats/base/dists/halfnormal/quantile.h +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/include/stdlib/stats/base/dists/halfnormal/quantile.h @@ -27,7 +27,7 @@ extern "C" { #endif /** -* Evaluates the quantile function for a Half-Normal distribution with cumulative probability `p` and scale `sigma`. +* Evaluates the quantile function for a Half-Normal distribution with cumulative probability `p` and scale parameter `sigma`. */ double stdlib_base_dists_halfnormal_quantile( const double p, const double sigma ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js index 9f5a1629f119..4b808d093bfc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js @@ -44,19 +44,21 @@ var PINF = require( '@stdlib/constants/float64/pinf' ); * // returns ~1.282 */ function factory( sigma ) { + var C; if ( isnan( sigma ) || sigma < 0.0 ) { return constantFunction( NaN ); } if ( sigma === 0.0 ) { return constantFunction( 0.0 ); } + C = sigma * SQRT2; return quantile; /** * Evaluates the quantile function for a Half-normal distribution. * * @private - * @param {Probability} p - input value + * @param {Probability} p - cumulative probability * @returns {number} evaluated quantile function * * @example @@ -70,7 +72,7 @@ function factory( sigma ) { if ( p === 1.0 ) { return PINF; } - return sigma * SQRT2 * erfinv( p ); + return C * erfinv( p ); } } diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/native.js index 4255bbd7b1fa..e00c213995d4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/native.js @@ -28,6 +28,7 @@ var addon = require( './../src/addon.node' ); /** * Evaluates the quantile function for a Half-Normal distribution with scale parameter `sigma` at a probability `p`. * +* @private * @param {Probability} p - cumulative probability * @param {NonNegativeNumber} sigma - scale parameter * @returns {number} evaluated quantile function diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/REQUIRE deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json deleted file mode 100644 index 8eec56801a4c..000000000000 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/data.json +++ /dev/null @@ -1 +0,0 @@ -{"sigma":[3.752372343198736,0.5952487736546558,3.3856198354728,1.3195086901125626,0.33660791776355947,3.0698228295251733,2.8333822017156756,0.842096233317226,0.9014208323745504,0.9645360412814957],"expected":[4.115703132034415,0.4368820501703096,3.423273300043822,0.6971282572460012,0.27955804839293547,0.6442160951563007,2.626768194061231,0.24752155341315513,0.04330086356582894,1.155323910174928],"p":[0.7272829554760867,0.5370199818842734,0.6880417602571298,0.40272560115812794,0.5937525368951077,0.1662187547190921,0.6461143084421898,0.23119242465068246,0.038312635981986976,0.7690061785566936]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl deleted file mode 100644 index 8f5dfec5906d..000000000000 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/julia/runner.jl +++ /dev/null @@ -1,64 +0,0 @@ -#!/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. - -using Distributions -using SpecialFunctions # for erfinv -using JSON - -""" - gen(p, sigma, name) - -Generate Half-Normal quantile fixture data. - -# Arguments -- `p`: probability values (0 ≤ p ≤ 1) -- `sigma`: scale parameters (σ ≥ 0) -- `name`: output filename -""" -function gen(p, sigma, name) - z = Array{Float64}(undef, length(p)) - for i in eachindex(p) - # Half-normal quantile: - # Q(p) = sigma * sqrt(2) * erfinv(p) - z[i] = sigma[i] * sqrt(2.0) * erfinv(p[i]) - end - - data = Dict( - "p" => p, - "sigma" => sigma, - "expected" => z - ) - - filepath = joinpath(dir, name) - open(filepath, "w") do f - write(f, JSON.json(data)) - write(f, "\n") - end -end - -# Directory of this script -file = @__FILE__ -dir = dirname(file) - -# Generate random test values -N = 10 -p = rand(N) # in (0,1) -sigma = rand(N) .* 5.0 # σ in [0,5) - -# Write a single data file -gen(p, sigma, "data.json") diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json new file mode 100644 index 000000000000..2c75ffb4b07d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json @@ -0,0 +1 @@ +{"p": [0.9774893766311928, 0.3303611508495079, 0.8131521683757337, 0.6693264455728574, 0.3685658595631208, 0.26035691800918415, 0.6591743418377072, 0.637147796808677, 0.3423370738469663, 0.24685816886607803], "sigma": [3.033632737920289, 3.2664388791085726, 2.2676544546611432, 0.7448037297348742, 4.17093786683222, 1.4259184016029536, 1.8265179135368266, 4.417846025457937, 1.3142239404712563, 4.252133347147264], "expected": [6.921656759847963, 1.3936056319137575, 2.993216852835478, 0.7245138419078899, 2.000837529764881, 0.47386981031578596, 1.7398224792397319, 4.019991146929366, 0.5823880100553026, 1.3372930558009646]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py new file mode 100644 index 000000000000..756ccc1d1708 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# +# @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. + +"""Generate fixtures.""" + +import os +import json +import numpy as np +from scipy.stats import halfnorm + +# Get the file path: +FILE = os.path.realpath(__file__) + +# Extract the directory in which this file resides: +DIR = os.path.dirname(FILE) + + +def gen(p, sigma, name): + """Generate fixture data and write to file. + + # Arguments + + * `p`: probability values (0 ≤ p ≤ 1) + * `sigma`: scale parameters (σ ≥ 0) + * `name::str`: output filename + + # Examples + + ``` python + python> p = np.random.rand(10) + python> sigma = np.random.rand(10) * 5.0 + python> gen(p, sigma, './data.json') + ``` + """ + # Compute half-normal quantiles using SciPy: + y = halfnorm.ppf(p, scale=sigma) + + # Store data to be written to file as a dictionary: + data = { + "p": p.tolist(), + "sigma": sigma.tolist(), + "expected": y.tolist() + } + + # Based on the script directory, create an output filepath: + filepath = os.path.join(DIR, name) + + # Write the data to the output filepath as JSON: + with open(filepath, "w", encoding="utf-8") as outfile: + json.dump(data, outfile) + outfile.write("\n") + + +def main(): + """Generate fixture data.""" + # Generate random test values: + N = 10 + p = np.random.rand(N) # in (0,1) + sigma = np.random.rand(N) * 5.0 # σ in [0,5) + + gen(p, sigma, "data.json") + + +if __name__ == "__main__": + main() diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js index 0f0961ac02a2..f68179f67489 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -22,15 +22,14 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); var PINF = require( '@stdlib/constants/float64/pinf' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var factory = require( './../lib/factory.js' ); // FIXTURES // -var data = require( './fixtures/julia/data.json' ); +var data = require( './fixtures/python/data.json' ); var p = data.p; var sigma = data.sigma; var expected = data.expected; @@ -87,20 +86,18 @@ tape( 'p = 1 returns +Infinity', function test( t ) { }); tape( 'the factory evaluates the Half-normal quantile correctly', function test( t ) { - var delta; - var tol; + var y; var q; var i; for ( i = 0; i < p.length; i++ ) { q = factory( sigma[i] ); if ( expected[i] !== null ) { - if ( q( p[i] ) === expected[i] ) { - t.strictEqual( q( p[i] ), expected[i], 'exact match' ); + y = q( p[i] ); + if ( y === expected[i] ) { + t.strictEqual( y, expected[i], 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( q( p[i] ) - expected[i] ); - tol = 40.0 * EPS * abs( expected[i] ); - t.ok(delta <= tol, 'p: '+p[i]+', sigma: '+sigma[i]+', q: '+q(p[i])+', expected: '+expected[i]); + t.ok( isAlmostSameValue( y, expected[ i ], 40.0 ), 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } } diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index c2d45671affc..71f5c42d878b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -24,9 +24,8 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); var tryRequire = require( '@stdlib/utils/try-require' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var PINF = require( '@stdlib/constants/float64/pinf' ); -var EPS = require( '@stdlib/constants/float64/eps' ); // VARIABLES // @@ -39,7 +38,7 @@ var opts = { // FIXTURES // -var data = require( './fixtures/julia/data.json' ); +var data = require( './fixtures/python/data.json' ); var p = data.p; var sigma = data.sigma; var expected = data.expected; @@ -83,8 +82,6 @@ tape( 'p = 1 returns +Infinity', opts, function test( t ) { }); tape( 'the native function evaluates the Half-normal quantile correctly', opts, function test( t ) { - var delta; - var tol; var y; var i; @@ -92,11 +89,9 @@ tape( 'the native function evaluates the Half-normal quantile correctly', opts, y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'exact match' ); + t.strictEqual( y, expected[i], 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[i] ); - tol = 40.0 * EPS * abs( expected[i] ); - t.ok(delta <= tol, 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i]); + t.ok( isAlmostSameValue( y, expected[ i ], 40.0 ), 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } } diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index 2245271a4122..25bbe289f928 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -22,15 +22,14 @@ var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); var PINF = require( '@stdlib/constants/float64/pinf' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var quantile = require( './../lib' ); // FIXTURES // -var data = require( './fixtures/julia/data.json' ); +var data = require( './fixtures/python/data.json' ); var p = data.p; var sigma = data.sigma; var expected = data.expected; @@ -74,8 +73,6 @@ tape( 'p = 1 returns +Infinity', function test( t ) { }); tape( 'the function evaluates the Half-normal quantile correctly', function test( t ) { - var delta; - var tol; var y; var i; @@ -83,11 +80,9 @@ tape( 'the function evaluates the Half-normal quantile correctly', function test y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'exact match' ); + t.strictEqual( y, expected[i], 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] ); } else { - delta = abs( y - expected[i] ); - tol = 40.0 * EPS * abs( expected[i] ); - t.ok(delta <= tol, 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i]); + t.ok( isAlmostSameValue( y, expected[ i ], 40.0 ), 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } } From 5e852362e8cdc9596152e6ea9ce5cf1c454f5d46 Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Fri, 23 Jan 2026 17:53:35 +0530 Subject: [PATCH 06/11] fix: pylint lint fix --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: missing_dependencies - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../halfnormal/quantile/test/fixtures/python/runner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py index 756ccc1d1708..6e861961fd48 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py @@ -69,9 +69,9 @@ def gen(p, sigma, name): def main(): """Generate fixture data.""" # Generate random test values: - N = 10 - p = np.random.rand(N) # in (0,1) - sigma = np.random.rand(N) * 5.0 # σ in [0,5) + n = 10 + p = np.random.rand(n) # in (0,1) + sigma = np.random.rand(n) * 5.0 # σ in [0,5) gen(p, sigma, "data.json") From bfd2be471105113d753eed2557de3651e9010d0e Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Fri, 23 Jan 2026 18:41:17 +0530 Subject: [PATCH 07/11] fix: using random/array/uniform , format and addressing remaining testfile comments --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: passed - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../quantile/benchmark/benchmark.js | 20 ++++++------------- .../quantile/benchmark/benchmark.native.js | 15 +++++--------- .../quantile/test/fixtures/python/runner.py | 2 +- .../halfnormal/quantile/test/test.factory.js | 9 ++++++--- .../halfnormal/quantile/test/test.native.js | 9 ++++++--- .../halfnormal/quantile/test/test.quantile.js | 9 ++++++--- 6 files changed, 30 insertions(+), 34 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js index 2815ef3fd5c8..6525141cbc1e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.js @@ -21,10 +21,9 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var quantile = require( './../lib' ); @@ -39,12 +38,8 @@ bench( pkg, function benchmark( b ) { var i; len = 100; - p = new Float64Array( len ); - sigma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - p[ i ] = uniform( 0.0, 1.0 ); - sigma[ i ] = uniform( EPS, 20.0 ); - } + p = uniform( 100, 0.0, 1.0 ); + sigma = uniform( 100, 0.0, 20.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { @@ -61,7 +56,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+':factory', function benchmark( b ) { +bench( format( '%s::factory', pkg ), function benchmark( b ) { var myquantile; var sigma; var len; @@ -72,10 +67,7 @@ bench( pkg+':factory', function benchmark( b ) { sigma = 4.0; myquantile = quantile.factory( sigma ); len = 100; - p = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - p[ i ] = uniform( 0.0, 1.0 ); - } + p = uniform( 100, 0.0, 1.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js index 6e7ed876ec0a..1e4fdacbb84d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/benchmark/benchmark.native.js @@ -22,11 +22,10 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); +var uniform = require( '@stdlib/random/array/uniform' ); var tryRequire = require( '@stdlib/utils/try-require' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var format = require( '@stdlib/string/format' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -40,7 +39,7 @@ var opts = { // MAIN // -bench( pkg+'::native', opts, function benchmark( b ) { +bench( format( '%s::native', pkg ), opts, function benchmark( b ) { var sigma; var len; var p; @@ -48,12 +47,8 @@ bench( pkg+'::native', opts, function benchmark( b ) { var i; len = 100; - p = new Float64Array( len ); - sigma = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - p[ i ] = uniform( 0.0, 1.0 ); - sigma[ i ] = uniform( EPS, 20.0 ); - } + p = uniform( 100, 0.0, 1.0 ); + sigma = uniform( 100, 0.0, 20.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py index 6e861961fd48..f55d5b02fe0b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py @@ -71,7 +71,7 @@ def main(): # Generate random test values: n = 10 p = np.random.rand(n) # in (0,1) - sigma = np.random.rand(n) * 5.0 # σ in [0,5) + sigma = np.random.rand(n) * 5.0 # σ in [0,5) gen(p, sigma, "data.json") diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js index f68179f67489..b40716ba99c0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -30,9 +30,6 @@ var factory = require( './../lib/factory.js' ); // FIXTURES // var data = require( './fixtures/python/data.json' ); -var p = data.p; -var sigma = data.sigma; -var expected = data.expected; // TESTS // @@ -86,10 +83,16 @@ tape( 'p = 1 returns +Infinity', function test( t ) { }); tape( 'the factory evaluates the Half-normal quantile correctly', function test( t ) { + var expected; + var sigma; var y; var q; var i; + var p; + p = data.p; + sigma = data.sigma; + expected = data.expected; for ( i = 0; i < p.length; i++ ) { q = factory( sigma[i] ); if ( expected[i] !== null ) { diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index 71f5c42d878b..6d1530883d55 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -39,9 +39,6 @@ var opts = { // FIXTURES // var data = require( './fixtures/python/data.json' ); -var p = data.p; -var sigma = data.sigma; -var expected = data.expected; // TESTS // @@ -82,9 +79,15 @@ tape( 'p = 1 returns +Infinity', opts, function test( t ) { }); tape( 'the native function evaluates the Half-normal quantile correctly', opts, function test( t ) { + var expected; + var sigma; var y; var i; + var p; + p = data.p; + sigma = data.sigma; + expected = data.expected; for ( i = 0; i < p.length; i++ ) { y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index 25bbe289f928..77451f2e1570 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -30,9 +30,6 @@ var quantile = require( './../lib' ); // FIXTURES // var data = require( './fixtures/python/data.json' ); -var p = data.p; -var sigma = data.sigma; -var expected = data.expected; // TESTS // @@ -73,9 +70,15 @@ tape( 'p = 1 returns +Infinity', function test( t ) { }); tape( 'the function evaluates the Half-normal quantile correctly', function test( t ) { + var expected; + var sigma; var y; var i; + var p; + p = data.p; + sigma = data.sigma; + expected = data.expected; for ( i = 0; i < p.length; i++ ) { y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { From 163cafbb569641daf4f10b09f110f4dae864a8c5 Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Sun, 25 Jan 2026 17:00:24 +0530 Subject: [PATCH 08/11] fix: addressing comments --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../halfnormal/quantile/test/test.factory.js | 30 ++++++++----------- .../halfnormal/quantile/test/test.native.js | 28 ++++++++--------- .../halfnormal/quantile/test/test.quantile.js | 28 ++++++++--------- 3 files changed, 37 insertions(+), 49 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js index b40716ba99c0..46aceb4a852b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -46,43 +46,43 @@ tape( 'factory returns a function', function test( t ) { t.end(); }); -tape( 'if sigma is NaN or < 0, returned function always returns NaN', function test( t ) { +tape( 'if sigma is NaN or sigma < 0, returned function always returns NaN', function test( t ) { var q; q = factory( NaN ); - t.ok( isnan( q( 0.5 ) ), 'sigma NaN' ); + t.ok( isnan( q( 0.5 ) ), 'returns expected value' ); q = factory( -1.0 ); - t.ok( isnan( q( 0.5 ) ), 'sigma < 0' ); + t.ok( isnan( q( 0.5 ) ), 'returns expected value' ); t.end(); }); tape( 'if sigma = 0, quantile always returns 0', function test( t ) { var q = factory( 0.0 ); - t.strictEqual( q( 0.0 ), 0.0 ); - t.strictEqual( q( 0.5 ), 0.0 ); - t.strictEqual( q( 1.0 ), 0.0 ); + t.strictEqual( q( 0.0 ), 0.0, 'returns expected value' ); + t.strictEqual( q( 0.5 ), 0.0, 'returns expected value' ); + t.strictEqual( q( 1.0 ), 0.0, 'returns expected value' ); t.end(); }); tape( 'if p < 0, p > 1, or p is NaN, quantile returns NaN', function test( t ) { var q = factory( 1.0 ); - t.ok( isnan( q( -0.1 ) ), 'p < 0' ); - t.ok( isnan( q( 1.1 ) ), 'p > 1' ); - t.ok( isnan( q( NaN ) ), 'p NaN' ); + t.ok( isnan( q( -0.1 ) ), 'returns expected value' ); + t.ok( isnan( q( 1.1 ) ), 'returns expected value' ); + t.ok( isnan( q( NaN ) ), 'returns expected value' ); t.end(); }); -tape( 'p = 1 returns +Infinity', function test( t ) { +tape( 'if p = 1, the function returns positive infinity', function test( t ) { var q = factory( 1.0 ); - t.strictEqual( q( 1.0 ), PINF, 'returns +Infinity' ); + t.strictEqual( q( 1.0 ), PINF, 'returns expected value' ); t.end(); }); -tape( 'the factory evaluates the Half-normal quantile correctly', function test( t ) { +tape( 'the factory evaluates the half-normal quantile', function test( t ) { var expected; var sigma; var y; @@ -97,11 +97,7 @@ tape( 'the factory evaluates the Half-normal quantile correctly', function test( q = factory( sigma[i] ); if ( expected[i] !== null ) { y = q( p[i] ); - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.ok( isAlmostSameValue( y, expected[ i ], 40.0 ), 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 40.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } t.end(); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index 6d1530883d55..03f9ff47b9cf 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -50,35 +50,35 @@ tape( 'main export is a function', function test( t ) { }); tape( 'if any argument is NaN, the function returns NaN', opts, function test( t ) { - t.ok( isnan( quantile( NaN, 1.0 ) ), 'p NaN' ); - t.ok( isnan( quantile( 0.5, NaN ) ), 'sigma NaN' ); + t.ok( isnan( quantile( NaN, 1.0 ) ), 'returns expected value' ); + t.ok( isnan( quantile( 0.5, NaN ) ), 'returns expected value' ); t.end(); }); tape( 'if p is outside [0,1], the function returns NaN', opts, function test( t ) { - t.ok( isnan( quantile( -0.1, 1.0 ) ), 'p < 0' ); - t.ok( isnan( quantile( 1.1, 1.0 ) ), 'p > 1' ); + t.ok( isnan( quantile( -0.1, 1.0 ) ), 'returns expected value' ); + t.ok( isnan( quantile( 1.1, 1.0 ) ), 'returns expected value' ); t.end(); }); tape( 'if sigma < 0, the function returns NaN', opts, function test( t ) { - t.ok( isnan( quantile( 0.5, -1.0 ) ), 'negative sigma' ); + t.ok( isnan( quantile( 0.5, -1.0 ) ), 'returns expected value' ); t.end(); }); tape( 'if sigma = 0, the quantile is 0 for all p', opts, function test( t ) { - t.strictEqual( quantile( 0.0, 0.0 ), 0.0 ); - t.strictEqual( quantile( 0.5, 0.0 ), 0.0 ); - t.strictEqual( quantile( 1.0, 0.0 ), 0.0 ); + t.strictEqual( quantile( 0.0, 0.0 ), 0.0, 'returns expected value' ); + t.strictEqual( quantile( 0.5, 0.0 ), 0.0, 'returns expected value' ); + t.strictEqual( quantile( 1.0, 0.0 ), 0.0, 'returns expected value' ); t.end(); }); -tape( 'p = 1 returns +Infinity', opts, function test( t ) { - t.strictEqual( quantile( 1.0, 1.0 ), PINF ); +tape( 'if p = 1, the function returns positive infinity', opts, function test( t ) { + t.strictEqual( quantile( 1.0, 1.0 ), PINF, 'returns expected value' ); t.end(); }); -tape( 'the native function evaluates the Half-normal quantile correctly', opts, function test( t ) { +tape( 'the native function evaluates the half-normal quantile', opts, function test( t ) { var expected; var sigma; var y; @@ -91,11 +91,7 @@ tape( 'the native function evaluates the Half-normal quantile correctly', opts, for ( i = 0; i < p.length; i++ ) { y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.ok( isAlmostSameValue( y, expected[ i ], 40.0 ), 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 40.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } t.end(); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index 77451f2e1570..a96bf947b775 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -41,35 +41,35 @@ tape( 'main export is a function', function test( t ) { }); tape( 'if any argument is NaN, the function returns NaN', function test( t ) { - t.ok( isnan( quantile( NaN, 1.0 ) ), 'p NaN' ); - t.ok( isnan( quantile( 0.5, NaN ) ), 'sigma NaN' ); + t.ok( isnan( quantile( NaN, 1.0 ) ), 'returns expected value' ); + t.ok( isnan( quantile( 0.5, NaN ) ), 'returns expected value' ); t.end(); }); tape( 'if p is outside [0,1], the function returns NaN', function test( t ) { - t.ok( isnan( quantile( -0.1, 1.0 ) ), 'p < 0' ); - t.ok( isnan( quantile( 1.1, 1.0 ) ), 'p > 1' ); + t.ok( isnan( quantile( -0.1, 1.0 ) ), 'returns expected value' ); + t.ok( isnan( quantile( 1.1, 1.0 ) ), 'returns expected value' ); t.end(); }); tape( 'if sigma < 0, the function returns NaN', function test( t ) { - t.ok( isnan( quantile( 0.5, -1.0 ) ), 'negative sigma' ); + t.ok( isnan( quantile( 0.5, -1.0 ) ), 'returns expected value' ); t.end(); }); tape( 'if sigma = 0, the quantile is 0 for all p', function test( t ) { - t.strictEqual( quantile( 0.0, 0.0 ), 0.0 ); - t.strictEqual( quantile( 0.5, 0.0 ), 0.0 ); - t.strictEqual( quantile( 1.0, 0.0 ), 0.0 ); + t.strictEqual( quantile( 0.0, 0.0 ), 0.0, 'returns expected value' ); + t.strictEqual( quantile( 0.5, 0.0 ), 0.0, 'returns expected value' ); + t.strictEqual( quantile( 1.0, 0.0 ), 0.0, 'returns expected value' ); t.end(); }); -tape( 'p = 1 returns +Infinity', function test( t ) { - t.strictEqual( quantile( 1.0, 1.0 ), PINF ); +tape( 'if p = 1, the function returns positive infinity', function test( t ) { + t.strictEqual( quantile( 1.0, 1.0 ), PINF, 'returns expected value' ); t.end(); }); -tape( 'the function evaluates the Half-normal quantile correctly', function test( t ) { +tape( 'the function evaluates the half-normal quantile', function test( t ) { var expected; var sigma; var y; @@ -82,11 +82,7 @@ tape( 'the function evaluates the Half-normal quantile correctly', function test for ( i = 0; i < p.length; i++ ) { y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { - if ( y === expected[i] ) { - t.strictEqual( y, expected[i], 'p: '+p[i]+', sigma: '+sigma[i]+', y: '+y+', expected: '+expected[i] ); - } else { - t.ok( isAlmostSameValue( y, expected[ i ], 40.0 ), 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); - } + t.strictEqual( isAlmostSameValue( y, expected[ i ], 40.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } t.end(); From a94a01f42077f75f309ab98b651affb4b9f3d011 Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Thu, 29 Jan 2026 00:46:37 +0530 Subject: [PATCH 09/11] fix: addressing t.strictEqual in test files --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../dists/halfnormal/quantile/test/test.factory.js | 10 +++++----- .../base/dists/halfnormal/quantile/test/test.native.js | 10 +++++----- .../dists/halfnormal/quantile/test/test.quantile.js | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js index 46aceb4a852b..bd57c3dd41cc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -50,10 +50,10 @@ tape( 'if sigma is NaN or sigma < 0, returned function always returns NaN', func var q; q = factory( NaN ); - t.ok( isnan( q( 0.5 ) ), 'returns expected value' ); + t.strictEqual( isnan( q( 0.5 ) ), true, 'returns expected value' ); q = factory( -1.0 ); - t.ok( isnan( q( 0.5 ) ), 'returns expected value' ); + t.strictEqual( isnan( q( 0.5 ) ), true, 'returns expected value' ); t.end(); }); @@ -69,9 +69,9 @@ tape( 'if sigma = 0, quantile always returns 0', function test( t ) { tape( 'if p < 0, p > 1, or p is NaN, quantile returns NaN', function test( t ) { var q = factory( 1.0 ); - t.ok( isnan( q( -0.1 ) ), 'returns expected value' ); - t.ok( isnan( q( 1.1 ) ), 'returns expected value' ); - t.ok( isnan( q( NaN ) ), 'returns expected value' ); + t.strictEqual( isnan( q( -0.1 ) ), true, 'returns expected value' ); + t.strictEqual( isnan( q( 1.1 ) ), true, 'returns expected value' ); + t.strictEqual( isnan( q( NaN ) ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index 03f9ff47b9cf..e118a381b5f1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -50,19 +50,19 @@ tape( 'main export is a function', function test( t ) { }); tape( 'if any argument is NaN, the function returns NaN', opts, function test( t ) { - t.ok( isnan( quantile( NaN, 1.0 ) ), 'returns expected value' ); - t.ok( isnan( quantile( 0.5, NaN ) ), 'returns expected value' ); + t.strictEqual( isnan( quantile( NaN, 1.0 ) ), true, 'returns expected value' ); + t.strictEqual( isnan( quantile( 0.5, NaN ) ), true, 'returns expected value' ); t.end(); }); tape( 'if p is outside [0,1], the function returns NaN', opts, function test( t ) { - t.ok( isnan( quantile( -0.1, 1.0 ) ), 'returns expected value' ); - t.ok( isnan( quantile( 1.1, 1.0 ) ), 'returns expected value' ); + t.strictEqual( isnan( quantile( -0.1, 1.0 ) ), true, 'returns expected value' ); + t.strictEqual( isnan( quantile( 1.1, 1.0 ) ), true, 'returns expected value' ); t.end(); }); tape( 'if sigma < 0, the function returns NaN', opts, function test( t ) { - t.ok( isnan( quantile( 0.5, -1.0 ) ), 'returns expected value' ); + t.strictEqual( isnan( quantile( 0.5, -1.0 ) ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index a96bf947b775..e2e5e9d420c1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -41,19 +41,19 @@ tape( 'main export is a function', function test( t ) { }); tape( 'if any argument is NaN, the function returns NaN', function test( t ) { - t.ok( isnan( quantile( NaN, 1.0 ) ), 'returns expected value' ); - t.ok( isnan( quantile( 0.5, NaN ) ), 'returns expected value' ); + t.strictEqual( isnan( quantile( NaN, 1.0 ) ), true, 'returns expected value' ); + t.strictEqual( isnan( quantile( 0.5, NaN ) ), true, 'returns expected value' ); t.end(); }); tape( 'if p is outside [0,1], the function returns NaN', function test( t ) { - t.ok( isnan( quantile( -0.1, 1.0 ) ), 'returns expected value' ); - t.ok( isnan( quantile( 1.1, 1.0 ) ), 'returns expected value' ); + t.strictEqual( isnan( quantile( -0.1, 1.0 ) ), true, 'returns expected value' ); + t.strictEqual( isnan( quantile( 1.1, 1.0 ) ), true, 'returns expected value' ); t.end(); }); tape( 'if sigma < 0, the function returns NaN', function test( t ) { - t.ok( isnan( quantile( 0.5, -1.0 ) ), 'returns expected value' ); + t.strictEqual( isnan( quantile( 0.5, -1.0 ) ), true, 'returns expected value' ); t.end(); }); From 301efab1a65caabdba44d6453c4d4060ea8c64df Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Sun, 1 Mar 2026 13:54:23 +0530 Subject: [PATCH 10/11] fix: addressing more comments --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../stats/base/dists/halfnormal/quantile/README.md | 11 +++++------ .../base/dists/halfnormal/quantile/docs/repl.txt | 1 + .../halfnormal/quantile/docs/types/index.d.ts | 2 +- .../dists/halfnormal/quantile/examples/index.js | 5 ----- .../base/dists/halfnormal/quantile/lib/factory.js | 3 ++- .../dists/halfnormal/quantile/test/test.factory.js | 13 +++++++++---- .../dists/halfnormal/quantile/test/test.native.js | 14 +++++++++----- .../halfnormal/quantile/test/test.quantile.js | 12 ++++++++---- 8 files changed, 35 insertions(+), 26 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md index 8bc627389413..2bb27ad6d773 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/README.md @@ -130,8 +130,8 @@ var quantile = require( '@stdlib/stats/base/dists/halfnormal/quantile' ); var opts = { 'dtype': 'float64' }; -var sigma = uniform( 10, 0.0, 20.0, opts ); -var p = uniform( 10, 0.0, 1.0, opts ); +var p = uniform( 25, 0.0, 1.0, opts ); +var sigma = uniform( 25, 0.0, 3.0, opts ); logEachMap( 'p: %lf, σ: %lf, Q(p;σ): %lf', p, sigma, quantile ); ``` @@ -204,7 +204,6 @@ double stdlib_base_dists_halfnormal_quantile( const double p, const double sigma ```c #include "stdlib/stats/base/dists/halfnormal/quantile.h" -#include "stdlib/constants/float64/eps.h" #include #include @@ -219,11 +218,11 @@ int main( void ) { double y; int i; - for ( i = 0; i < 10; i++ ) { + for ( i = 0; i < 25; i++ ) { p = random_uniform( 0.0, 1.0 ); - sigma = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 ); + sigma = random_uniform( 0.0, 10.0 ); y = stdlib_base_dists_halfnormal_quantile( p, sigma ); - printf( "p:%lf, σ: %lf, Q(p;σ): %lf\n", p, sigma, y ); + printf( "p: %lf, σ: %lf, Q(p;σ): %lf\n", p, sigma, y ); } } ``` diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/repl.txt index 3a54c869fe9a..0b052643e000 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/repl.txt +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/repl.txt @@ -1,3 +1,4 @@ + {{alias}}( p, σ ) Evaluates the quantile function for a Half-Normal distribution with scale parameter `σ` at a probability `p`. diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts index e9bc4b5266d9..b2f6387cc44b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/docs/types/index.d.ts @@ -22,7 +22,7 @@ * Evaluates the quantile function for a Half-normal distribution. * * @param p - cumulative probability -* @returns evaluated quantile +* @returns evaluated quantile function */ type Unary = ( p: number ) => number; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js index e4c2878cb493..695f951b086b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/examples/index.js @@ -18,15 +18,10 @@ 'use strict'; -// MODULES // - var uniform = require( '@stdlib/random/array/uniform' ); var logEachMap = require( '@stdlib/console/log-each-map' ); var quantile = require( './../lib' ); - -// MAIN // - var opts = { 'dtype': 'float64' }; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js index 4b808d093bfc..eb6018c59509 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/lib/factory.js @@ -21,6 +21,7 @@ // MODULES // var constantFunction = require( '@stdlib/utils/constant-function' ); +var degenerate = require( '@stdlib/stats/base/dists/degenerate/quantile' ).factory; var isnan = require( '@stdlib/math/base/assert/is-nan' ); var erfinv = require( '@stdlib/math/base/special/erfinv' ); var SQRT2 = require( '@stdlib/constants/float64/sqrt-two' ); @@ -49,7 +50,7 @@ function factory( sigma ) { return constantFunction( NaN ); } if ( sigma === 0.0 ) { - return constantFunction( 0.0 ); + return degenerate( 0.0 ); } C = sigma * SQRT2; return quantile; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js index bd57c3dd41cc..6b8f27df9160 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -58,11 +58,16 @@ tape( 'if sigma is NaN or sigma < 0, returned function always returns NaN', func t.end(); }); -tape( 'if sigma = 0, quantile always returns 0', function test( t ) { +tape( 'if `sigma` equals `0`, the created function evaluates a degenerate distribution centered at `0.0`', function test( t ) { var q = factory( 0.0 ); - t.strictEqual( q( 0.0 ), 0.0, 'returns expected value' ); - t.strictEqual( q( 0.5 ), 0.0, 'returns expected value' ); - t.strictEqual( q( 1.0 ), 0.0, 'returns expected value' ); + + t.strictEqual( q( 0.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + t.strictEqual( q( 0.5 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + t.strictEqual( q( 1.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + + t.strictEqual( isnan( q( 1.1 ) ), true, 'returns NaN for p outside [0,1]' ); + t.strictEqual( isnan( q( -0.1 ) ), true, 'returns NaN for p outside [0,1]' ); + t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index e118a381b5f1..f0d2fc354736 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -43,7 +43,7 @@ var data = require( './fixtures/python/data.json' ); // TESTS // -tape( 'main export is a function', function test( t ) { +tape( 'main export is a function', opts, function test( t ) { t.ok( true, __filename ); t.strictEqual( typeof quantile, 'function', 'main export is a function' ); t.end(); @@ -66,10 +66,14 @@ tape( 'if sigma < 0, the function returns NaN', opts, function test( t ) { t.end(); }); -tape( 'if sigma = 0, the quantile is 0 for all p', opts, function test( t ) { - t.strictEqual( quantile( 0.0, 0.0 ), 0.0, 'returns expected value' ); - t.strictEqual( quantile( 0.5, 0.0 ), 0.0, 'returns expected value' ); - t.strictEqual( quantile( 1.0, 0.0 ), 0.0, 'returns expected value' ); +tape( 'if `sigma` equals `0`, the function evaluates a degenerate distribution centered at `0.0`', opts, function test( t ) { + t.strictEqual( quantile( 0.0, 0.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + t.strictEqual( quantile( 0.5, 0.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + t.strictEqual( quantile( 1.0, 0.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + + t.strictEqual( isnan( quantile( 1.1, 0.0 ) ), true, 'returns NaN for p outside [0,1]' ); + t.strictEqual( isnan( quantile( -0.1, 0.0 ) ), true, 'returns NaN for p outside [0,1]' ); + t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index e2e5e9d420c1..ee055268e83d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -57,10 +57,14 @@ tape( 'if sigma < 0, the function returns NaN', function test( t ) { t.end(); }); -tape( 'if sigma = 0, the quantile is 0 for all p', function test( t ) { - t.strictEqual( quantile( 0.0, 0.0 ), 0.0, 'returns expected value' ); - t.strictEqual( quantile( 0.5, 0.0 ), 0.0, 'returns expected value' ); - t.strictEqual( quantile( 1.0, 0.0 ), 0.0, 'returns expected value' ); +tape( 'if `sigma` equals `0`, the function evaluates a degenerate distribution centered at `0.0`', function test( t ) { + t.strictEqual( quantile( 0.0, 0.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + t.strictEqual( quantile( 0.5, 0.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + t.strictEqual( quantile( 1.0, 0.0 ), 0.0, 'returns 0.0 for p inside [0,1]' ); + + t.strictEqual( isnan( quantile( 1.1, 0.0 ) ), true, 'returns NaN for p outside [0,1]' ); + t.strictEqual( isnan( quantile( -0.1, 0.0 ) ), true, 'returns NaN for p outside [0,1]' ); + t.end(); }); From ca24ff1ccdf7076f56b8e97b0e2e9dc8598ad83f Mon Sep 17 00:00:00 2001 From: Om-A-osc Date: Fri, 3 Apr 2026 11:07:13 +0530 Subject: [PATCH 11/11] fix: increase fixture datapoints and address comments --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: passed - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../stats/base/dists/halfnormal/quantile/manifest.json | 9 ++++++--- .../stats/base/dists/halfnormal/quantile/package.json | 1 + .../stats/base/dists/halfnormal/quantile/src/main.c | 3 ++- .../halfnormal/quantile/test/fixtures/python/data.json | 2 +- .../halfnormal/quantile/test/fixtures/python/runner.py | 2 +- .../base/dists/halfnormal/quantile/test/test.factory.js | 2 +- .../base/dists/halfnormal/quantile/test/test.native.js | 2 +- .../base/dists/halfnormal/quantile/test/test.quantile.js | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json index 833d05bf1a41..0ace00f0b5ae 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/manifest.json @@ -41,7 +41,8 @@ "@stdlib/math/base/napi/binary", "@stdlib/math/base/assert/is-nan", "@stdlib/math/base/special/erfinv", - "@stdlib/constants/float64/sqrt-two" + "@stdlib/constants/float64/sqrt-two", + "@stdlib/constants/float64/pinf" ] }, { @@ -59,7 +60,8 @@ "@stdlib/math/base/assert/is-nan", "@stdlib/constants/float64/eps", "@stdlib/math/base/special/erfinv", - "@stdlib/constants/float64/sqrt-two" + "@stdlib/constants/float64/sqrt-two", + "@stdlib/constants/float64/pinf" ] }, { @@ -77,7 +79,8 @@ "@stdlib/math/base/assert/is-nan", "@stdlib/constants/float64/eps", "@stdlib/math/base/special/erfinv", - "@stdlib/constants/float64/sqrt-two" + "@stdlib/constants/float64/sqrt-two", + "@stdlib/constants/float64/pinf" ] } ] diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json index f569963257e6..cfa816be6eb6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/package.json @@ -61,6 +61,7 @@ "probability", "cdf", "inverse", + "halfnormal", "half-normal", "univariate", "continuous" diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c index 75646bd5b8d2..31fc65f90395 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/src/main.c @@ -20,6 +20,7 @@ #include "stdlib/math/base/assert/is_nan.h" #include "stdlib/math/base/special/erfinv.h" #include "stdlib/constants/float64/sqrt_two.h" +#include "stdlib/constants/float64/pinf.h" /** * Evaluates the quantile function for a Half-normal distribution with cumulative probability p and scale `sigma`. @@ -46,7 +47,7 @@ double stdlib_base_dists_halfnormal_quantile( const double p, const double sigma return 0.0; } if ( p == 1.0 ) { - return 1.0 / 0.0; // +infinity + return STDLIB_CONSTANT_FLOAT64_PINF; // +infinity } return sigma * STDLIB_CONSTANT_FLOAT64_SQRT2 * stdlib_base_erfinv( p ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json index 2c75ffb4b07d..db67b919f314 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/data.json @@ -1 +1 @@ -{"p": [0.9774893766311928, 0.3303611508495079, 0.8131521683757337, 0.6693264455728574, 0.3685658595631208, 0.26035691800918415, 0.6591743418377072, 0.637147796808677, 0.3423370738469663, 0.24685816886607803], "sigma": [3.033632737920289, 3.2664388791085726, 2.2676544546611432, 0.7448037297348742, 4.17093786683222, 1.4259184016029536, 1.8265179135368266, 4.417846025457937, 1.3142239404712563, 4.252133347147264], "expected": [6.921656759847963, 1.3936056319137575, 2.993216852835478, 0.7245138419078899, 2.000837529764881, 0.47386981031578596, 1.7398224792397319, 4.019991146929366, 0.5823880100553026, 1.3372930558009646]} +{"p": [0.5013923341832525, 0.470658354457132, 0.87944884042932, 0.89852172538479, 0.687680734807598, 0.28962729596006764, 0.9484085405959427, 0.699646666483073, 0.1931304163519384, 0.6668982261323405, 0.8102909430873988, 0.615884926717725, 0.05537471340154887, 0.3726004511194899, 0.3341573864000472, 0.6131866839294893, 0.4349576267310108, 0.8487103156572211, 0.7685281966531946, 0.3686218166249987, 0.9217474379345413, 0.46543898925371907, 0.8071951348922111, 0.7007753038816233, 0.7865864782140244, 0.27949966902207846, 0.49739461479327873, 0.13218354140700783, 0.20075297361236455, 0.019990598512756863, 0.40674524464320727, 0.7788369564535518, 0.6822387993928741, 0.40138636968594876, 0.3133494985297648, 0.2225701672970669, 0.3415516893623738, 0.18646787321402492, 0.7095064043120741, 0.7195485605615412, 0.7581521184266197, 0.8450728601036132, 0.2580534567962043, 0.789259678697781, 0.8420340761670487, 0.12211687383541703, 0.48929520252247194, 0.5723991055491084, 0.30472619846398963, 0.3253551311819852, 0.10553084969722348, 0.7697548189356954, 0.2908269410045895, 0.9393697221414368, 0.6432776090439936, 0.2006008832777354, 0.2418796004625675, 0.11522698410068843, 0.5295792793432251, 0.8599081352621255, 0.7619913226823569, 0.7713651138183839, 0.4756612408728579, 0.7199991810416233, 0.9860325438417683, 0.03234470409746282, 0.05537635492919979, 0.2706921881300134, 0.07561222598940687, 0.24116352241897632, 0.8490655990265231, 0.9380108010950594, 0.6918701492964222, 0.46379377076155004, 0.5275120890787448, 0.44726917893613916, 0.48528729882157506, 0.8417339526343248, 0.6651619900914787, 0.11045012037993185, 0.13419088391348943, 0.4482486456007121, 0.08236773826226917, 0.1090882320532327, 0.2055792408008701, 0.5299934438601482, 0.7718217868419694, 0.9151837043398384, 0.5920934013627377, 0.7298478220429501, 0.3943340254896065, 0.19436880413879776, 0.31938156303437837, 0.28721916101069245, 0.36133155289678354, 0.8135397272632908, 0.4205043390912099, 0.9378339078726156, 0.480867071073267, 0.7531925801024836, 0.39889656565203835, 0.9780581481143137, 0.7430480472355424, 0.7448745576929104, 0.9009169419030922, 0.3362729238992338, 0.9038503970761347, 0.6243584504949579, 0.07700802200903867, 0.44736268028858683, 0.0691747189146199, 0.15792538978060688, 0.8592683624649027, 0.3609976854269755, 0.15680339916920671, 0.9034300956947044, 0.8997134584378963, 0.8869516078139048, 0.26954681065731845, 0.06378819740314201, 0.8349528828284205, 0.7407902014922644, 0.524307724202358, 0.3629559259453884, 0.6786640383111208, 0.18307864046036337, 0.8203656884886202, 0.3951611781761952, 0.6422076516469489, 0.35093114264965597, 0.9007267962612284, 0.027331449993220347, 0.3746499948313211, 0.5209182209967645, 0.43570137429728173, 0.6038191381955842, 0.4903202078086055, 0.15919241953332042, 0.62395461828893, 0.4614569106665647, 0.07525722718661099, 0.14898964524032254, 0.5278931608693774, 0.442154306579858, 0.9288615209681245, 0.743771327456038, 0.7305189563658256, 0.8727922004515295, 0.23974559379184435, 0.5053553504694976, 0.48890379857814215, 0.5979371116682642, 0.12580002359126385, 0.03902407347472048, 0.18096033065006167, 0.9717550515236858, 0.9333371136533588, 0.1811747442887176, 0.8485933373805794, 0.9574834423270613, 0.881076232148817, 0.7172774929659996, 0.4837285026810303, 0.49580391584356176, 0.7049996262995738, 0.4812889887070094, 0.26467019456212393, 0.5758019906281648, 0.3502150505907424, 0.10382148366265709, 0.5352741499323808, 0.9256616099831184, 0.6476084245893188, 0.05744378409757889, 0.9602041838859159, 0.8285556233045067, 0.9503894355458405, 0.3163327638564609, 0.3349369227142557, 0.6460190131206823, 0.9363406612333829, 0.7967418723091215, 0.28141698227312795, 0.9412536304753983, 0.5396700042181145, 0.6236042843183377, 0.09285466776709128, 0.7116717346150594, 0.4716352785016843, 0.08206586479534272, 0.5542965926729679, 0.6830404010336598, 0.30913248777143987, 0.6245772223016236, 0.6578797416615366, 0.0048676046826003905, 0.40235622732515364, 0.6388334149837677, 0.8482921117096801, 0.9872695979858852, 0.008991475183046549, 0.07148853597810101, 0.8071716514789594, 0.7214531001328439, 0.32703737091542406, 0.8153871371849025, 0.5219265322009439, 0.5651037758884043, 0.261583964684879, 0.6959997938945389, 0.07378378114603856, 0.8088929008202168, 0.6062868156527961, 0.9464560767974819, 0.7568470396547948, 0.6035237303669324, 0.48627468772874005, 0.4158140511635542, 0.13118727751386283, 0.8699551502786892, 0.4636884548145226, 0.8752736646751578, 0.9903536207120531, 0.9285431670837183, 0.6980986179407472, 0.396678127263292, 0.46138526557267723, 0.2629877463110023, 0.07050062041289418, 0.9414449638802805, 0.4700016208933373, 0.8174565164751106, 0.7407461558814167, 0.5282525699548528, 0.48492529275888796, 0.4340784206559032, 0.5960460132609473, 0.6604423816667606, 0.9723866108867063, 0.6499898842738986, 0.07378730824470925, 0.9231157280550236, 0.27780519937250614, 0.7828098158240464, 0.871956368684625, 0.8697896847086494, 0.025547918244049672, 0.43029693391249035, 0.009942241902530236, 0.6443315400066173, 0.026645269286888484, 0.15925229055652756, 0.251927717400639, 0.30734674440494025, 0.0006024128784400951, 0.24537722818437713, 0.8834282321122048, 0.2681541906932421, 0.7310380813650904, 0.378607344617753, 0.5957662820181997, 0.7419539580608128, 0.6010499677643449, 0.7136874508324783, 0.2549645934656999, 0.004064988360572341, 0.4320077893653249, 0.8773638522917274, 0.9070880679767199, 0.15748053670298323, 0.857041043026189, 0.722165983847922, 0.7676231107976371, 0.20875612521684905, 0.7494401830474321, 0.31790884210312875, 0.6129303636881387, 0.0807601195072386, 0.9015859213958144, 0.3845471920663045, 0.06330096170864419, 0.9072163458910638, 0.4632396447538615, 0.9880878364106218, 0.7273480968011385, 0.13362930208231294, 0.6926090533838145, 0.734272382158128, 0.13497593642481687, 0.5687159200301141, 0.2850575621505077, 0.6853808093507261, 0.13580559786897506, 0.07429935292585155, 0.2822060166871715, 0.6669776468364781, 0.9258531589531751, 0.8210310274872912, 0.5029539957946227, 0.2567961058605771, 0.3770137279810313, 0.38208215905970644, 0.0319229682534673, 0.37270077791785483, 0.8309778661514745, 0.43844675594029836, 0.01554441452115407, 0.9551890131827219, 0.012617482391528156, 0.9136700912832892, 0.09063692719515137, 0.6563146531407932, 0.1539877034714181, 0.9986824118669592, 0.9192115405919843, 0.3936301503145949, 0.35838754642870474, 0.03457218322533995, 0.34654351880810574, 0.9691007226037305, 0.1398961190816369, 0.48187465996748835, 0.7096367355644816, 0.16978238285594394, 0.3938804564220908, 0.6703092371259886, 0.01023026948030048, 0.381591189743549, 0.5119457349709431, 0.6698726408669252, 0.7313018517787903, 0.13732316062795913, 0.40351903132540956, 0.4974129434659297, 0.20305757158051874, 0.46468993356535315, 0.47186382243239156, 0.22262247401641255, 0.8765305056938688, 0.7364853814208235, 0.2612303215832189, 0.6738415015928799, 0.6635781256853388, 0.609888707682628, 0.28914721376311603, 0.6670986646509303, 0.17597696823580056, 0.49435093018889575, 0.11824721523807646, 0.6523101577003874, 0.06518967167750844, 0.0979611179560792, 0.10094353446316118, 0.8360935310782303, 0.6559716372381714, 0.1800457152677447, 0.12600093938563428, 0.1647694476491437, 0.5389544826667307, 0.9070642737310706, 0.9008184764022178, 0.4880344731511541, 0.12806413725674004, 0.745864278644023, 0.7765570216622252, 0.3943360149496894, 0.8633106971834686, 0.9182031025318587, 0.4558078017310635, 0.6369812028578903, 0.18726888626885085, 0.9144310543016667, 0.910380871234975, 0.9596691582495516, 0.22831218179146917, 0.5585196983713081, 0.2530509469353053, 0.12204360312093232, 0.16494148266016295, 0.9881530409396035, 0.8427829381486339, 0.4736726740356869, 0.19983422034325238, 0.9679966381455499, 0.21028708455482903, 0.5541247985306837, 0.5547569180550166, 0.8893691893781949, 0.9803642981234185, 0.709361197032531, 0.1100429763140166, 0.1439421675416701, 0.3274740573246485, 0.5938303049820535, 0.10119878496617296, 0.7263687082429136, 0.148356584443174, 0.08429178487141564, 0.732558314975887, 0.6740546371015563, 0.7392428131957092, 0.19146512839397756, 0.2744155782779888, 0.8758732178229958, 0.6900930034989946, 0.17402080392558605, 0.40207257406481856, 0.6256607057658385, 0.49998805676567737, 0.25605342460066505, 0.2954260411686802, 0.38315563656424945, 0.06512450377423029, 0.2894158033913289, 0.8677696610724137, 0.7606788920533808, 0.5151749490812, 0.0550382464302539, 0.3316040274361822, 0.5544091945172367, 0.6796134002206243, 0.2969123312252516, 0.6155230437794543, 0.7922583379570046, 0.010550397335987949, 0.19521767337408802, 0.6745726512322386, 0.8670346667605312, 0.5073398051902848, 0.9916759305338194, 0.8273930624611259, 0.41573442200068844, 0.3770794438858033, 0.8155972145616819, 0.7863282090158544, 0.18947049579634268, 0.4789096644465254, 0.8385088031923518, 0.45013889804575147, 0.2819041621793058, 0.13482450955928993, 0.7599790520452299, 0.2776160701717292, 0.36261583475502646, 0.6663664635422054, 0.9675172556801206, 0.5508484023536583, 0.7497286449293907, 0.4401910764945781, 0.027577178116137135, 0.08562390306277745, 0.6580378969816172, 0.5291413499351942, 0.22088463597982966, 0.7904240383734602, 0.19361890993343134, 0.7740192373916038, 0.4279895361091596, 0.7320539847359334, 0.5712170742682532, 0.7189832239723655, 0.37324107478403434, 0.1570180502306806, 0.4369145100556924, 0.14882634355196211, 0.6329788967912723, 0.5300403992976569, 0.8522002267470804, 0.27784619850601344, 0.7072802102404105, 0.0025556483734607838, 0.8882443626400813, 0.964635094373408, 0.6104743431082319, 0.3163096956400908, 0.5933810395095666, 0.45475098761149735, 0.1629478069027398, 0.38353639613351576, 0.014590740206510966, 0.9218379806327467, 0.9369337186528551, 0.732724398318775, 0.6672843289094683, 0.958340815789354, 0.42331722661700044, 0.3008253661338044, 0.8135085706859124, 0.6593613561069748, 0.589270897197692, 0.3016068085066108, 0.7225029739923268, 0.2205980771736794, 0.5141023957831582, 0.37946216819806144, 0.5833276751995589, 0.08588783399977551, 0.9227145807306804, 0.32950786238942775, 0.6671064855444068, 0.2577648812833969, 0.15438513750746863, 0.414840645823789, 0.4774797054696923, 0.7575242647652375, 0.5127977457932535, 0.4482022267315845, 0.33885199640435615, 0.9439410658355896, 0.12278387334649787, 0.013371684755591362, 0.2503548457369942, 0.7201449326512893, 0.9997388783278058, 0.33284349997979035, 0.2110533988428963, 0.8163335338140822, 0.854450490676069, 0.7918126405856114, 0.5641763891787013, 0.5596378074476575, 0.9193009633874749, 0.39454668239239177, 0.9668755453834773, 0.43437788414710987, 0.9802352796361609, 0.22678013236017758, 0.6424254431073019, 0.423116701685071, 0.12392691463098882, 0.8628952088534302, 0.6299223813987158, 0.3719165008040497, 0.7569364405778063, 0.2639818466504935, 0.7025452830525601, 0.9112420345774448, 0.21825507420173884, 0.6587727696233591, 0.22221265088669306, 0.07803675836421009, 0.4252740925124098, 0.31793630678235607, 0.5802659270969178, 0.09857141639447975, 0.8510639242972228, 0.38782804165496665, 0.30489499667318987, 0.1840651332729849, 0.7257583944952779, 0.40599792859311257, 0.509295312743683, 0.3515822191960064, 0.9063612337512017, 0.8182568821925168, 0.4809762711483798, 0.9747626401175615, 0.685237715642594, 0.10929148452427306, 0.6231071297668406, 0.9807180680275512, 0.4849092255454506, 0.7905189407422166, 0.12440747932837026, 0.5345880465820987, 0.17025275355414604, 0.07302935145625966, 0.12866552716696, 0.9220646729699685, 0.6870606161139546, 0.8819736395130386, 0.5303561480486079, 0.7253328093219069, 0.3330522264875443, 0.007497574067207635, 0.29117772521660956, 0.8977102515501383, 0.4647516299174135, 0.22983621525265907, 0.8959740077648076, 0.570474887616414, 0.513778617586619, 0.6761476133469523, 0.5876840501424098, 0.003716956254022241, 0.6685275594603561, 0.04924504746722025, 0.1107604002418261, 0.6657340735833408, 0.07679290107233483, 0.2459711989379555, 0.302540583087757, 0.05294628057273365, 0.7422960438506014, 0.7185287967787702, 0.24785289816561606, 0.7560083558418653, 0.33263844715485635, 0.8763861222424979, 0.45773936872376597, 0.044507030853786045, 0.5980044906778078, 0.3573530417186178, 0.6309200760545403, 0.6418576840827273, 0.6927107719970005, 0.7329357157626282, 0.1950844392287443, 0.9616512004946285, 0.03134032924741115, 0.968914019616729, 0.5735664380061154, 0.7546422308809706, 0.8594367591743038, 0.8142419707179837, 0.6374710998021977, 0.6027080995637072, 0.454681847261588, 0.7012877536195204, 0.16632641704823292, 0.08384349820730652, 0.6771871277588649, 0.20880921459477342, 0.7285657910152755, 0.8252160430486191, 0.09401913746500412, 0.2160470772423806, 0.2427610221790083, 0.5373595893958414, 0.587770163516107, 0.05408661216666544, 0.681778759016937, 0.5559346003700996, 0.24411346185233573, 0.7163872898531216, 0.13633243855672905, 0.16254480524543835, 0.20259513674089336, 0.5849451430088808, 0.40505463291934807, 0.45968456305845484, 0.1933227495903257, 0.9604297009622618, 0.13367966362490713, 0.6652460926802848, 0.9803834046948469, 0.4478474737249444, 0.04246716399041561, 0.16955043013212956, 0.5131557706941268, 0.916714132983206, 0.747440030025463, 0.045101369317865236, 0.35709275457979006, 0.9440851615904154, 0.36870126207159126, 0.3610743835939568, 0.06535082305213413, 0.9729564211607742, 0.8135390098834578, 0.41018063265674365, 0.01907941574833638, 0.0028601625029327504, 0.38440875887606885, 0.5152766805104932, 0.5775873102032041, 0.8462577337740231, 0.09240924037346832, 0.8524579012583303, 0.41631495925353357, 0.020677008787219342, 0.5001192161091799, 0.8001360428066756, 0.7339963213741274, 0.4858464462675759, 0.30866487331434966, 0.19855089946756632, 0.7198218525805226, 0.538640246639333, 0.21053025592515795, 0.5648563955710141, 0.44838258498401273, 0.3097948405431109, 0.6553337234154841, 0.6765519260256543, 0.15194604018060587, 0.25545253426109915, 0.5147815484645386, 0.14331877011231675, 0.6549857910628781, 0.9140442726265057, 0.4662278191377671, 0.5907903806695419, 0.9617194907357552, 0.7473616970610307, 0.39687248591022717, 0.7583660748020896, 0.7652523120853577, 0.6207532371061774, 0.03403227579602863, 0.31628812163115316, 0.24650794299305756, 0.4449915237048282, 0.1655974115451987, 0.3715895784013715, 0.39616698654907534, 0.11395186592169204, 0.9688104383291684, 0.3012298064710831, 0.7661761757200565, 0.7786847109265168, 0.8017845539677503, 0.6139866209254912, 0.3137162765392574, 0.9306797987521278, 0.4963302090494468, 0.4132324379858271, 0.514377134214601, 0.6372982235912855, 0.7461730750469767, 0.8268547720057553, 0.10071422075810921, 0.702123970260936, 0.8090258179909139, 0.5009730496157689, 0.3903724140125284, 0.6088011621351532, 0.45915836832353685, 0.9110376154082241, 0.9051283153582163, 0.23714393150605406, 0.3139804564161257, 0.8507002422417261, 0.18824691127091064, 0.394611323714139, 0.47212472590910615, 0.31210773668498537, 0.9289457491445174, 0.19002708310229555, 0.9657411831760543, 0.8873426522406247, 0.6197509868674518, 0.7578341467670877, 0.5451541936445041, 0.12132554383361371, 0.3364960314154617, 0.7410233207166306, 0.024097421541702246, 0.9951496001366382, 0.014866169029107423, 0.6429054170560371, 0.3053331224736362, 0.12502165944413846, 0.3433433760885376, 0.39640946835649704, 0.46956907695866834, 0.7159190782828658, 0.7070795501117706, 0.16296938892317858, 0.2078746408953981, 0.9948342995189701, 0.38122708222947077, 0.8403758425446404, 0.49819344696668866, 0.03896093828355429, 0.09313954821658665, 0.023634292321940253, 0.08217312712581659, 0.7785883757658222, 0.3230898521763744, 0.7194870548339048, 0.8535291171833745, 0.6219400208674584, 0.1684876858626212, 0.5451579619997708, 0.3712075729539237, 0.9371806848289972, 0.5712833400296041, 0.9209072449165683, 0.2671744325664108, 0.959514978496304, 0.8598841881769212, 0.04714782119186278, 0.18302456795209698, 0.47062858719597767, 0.12062374331498915, 0.21051438131575273, 0.2814373801242893, 0.6953474422359464, 0.48177497583110307, 0.046777165812620924, 0.905024717524868, 0.22193526351010384, 0.2734130090635648, 0.2808942891215227, 0.5278358642019593, 0.3556324824421696, 0.6962426081823295, 0.5739093872994385, 0.9744315272500749, 0.4202299443500761, 0.7414738553876526, 0.612298002113886, 0.9231645365785838, 0.28531522641023266, 0.28901182549086146, 0.14962521643532734, 0.9236759239627127, 0.14506897147588305, 0.3756240122549376, 0.22897383716968112, 0.6456705174856842, 0.21853178043318577, 0.0064137804202349935, 0.12011921347310728, 0.7989631464328649, 0.763882806873099, 0.35215012280859115, 0.3636263005353627, 0.8403420596435444, 0.8776274489747012, 0.16233217422654256, 0.9751899417519517, 0.6010287122548008, 0.7406456829816382, 0.12677095445982378, 0.7871454690627142, 0.3860163105187292, 0.5035797884384919, 0.17653013832910935, 0.8704191584297896, 0.8151983718849655, 0.7385547439595656, 0.9559816619681437, 0.3688378401012582, 0.22057082062862787, 0.7302356859036878, 0.017362730158166917, 0.2446603634658684, 0.8105043362484767, 0.9592047025337129, 0.14180549309770885, 0.3153793469340048, 0.9866411991876772, 0.0804962448874581, 0.43654414288853527, 0.7188932547608968, 0.13731611352553685, 0.34224901801241037, 0.9640463080135655, 0.9219748597167288, 0.60886179987598, 0.07754912016165127, 0.7951414773295827, 0.3586414826504922, 0.15731289123823922, 0.05434885397359224, 0.7601084221897162, 0.8070789268238774, 0.08810541217786527, 0.6541732961996097, 0.3344542616530395, 0.22371297202600648, 0.20476361870773008, 0.20469378216477496, 0.7607026660593803, 0.4616718964158738, 0.4641013912906522, 0.7092362260755717, 0.20938637788674708, 0.7751083501995549, 0.663108515065611, 0.261152283953464, 0.8740048414585422, 0.7005111058784279, 0.17827416218381775, 0.8152459423524739, 0.008218919423947812, 0.8771992843529289, 0.22995500098781085, 0.2863736644099344, 0.6903657889909142, 0.3155159920359568, 0.40727038396922977, 0.39915277833191054, 0.8065985210298793, 0.8943720025659079, 0.296055685572332, 0.5598649431675652, 0.7120866436956698, 0.4447278826966068, 0.08474972107137568, 0.08498175755212256, 0.0937874137699447, 0.27127242200926127, 0.9252909263243623, 0.5701901317593926, 0.9201643144774787, 0.5365115894959993, 0.4086533701860813, 0.051013542699315906, 0.9048518320487914, 0.3127060224826088, 0.41033417449288234, 0.424767563956714, 0.4223221812442207, 0.8290966742876182, 0.931097715244484, 0.2631804138969429, 0.7420597575640299, 0.2335099804250057, 0.16174422349595485, 0.324712879502295, 0.637212520845879, 0.6386031302941959, 0.6083866785762841, 0.055538447784078904, 0.27660172943347106, 0.8509675708543706, 0.3011912184798138, 0.014466379567531384, 0.43698654216642396, 0.7678234859174183, 0.4283678448838699, 0.571064426574456, 0.29203900991739595, 0.37810576810558183, 0.5281963099107442, 0.012125155381696895, 0.6733051423226228, 0.4684413842656656, 0.36932426094523874, 0.7223104456476198, 0.1556167627481586, 0.1028791016468007, 0.6730109230433285, 0.43418570007561663, 0.5768226789798754, 0.6796412781404048, 0.351765355589326, 0.546378764334948, 0.23063133737858887, 0.19651215497978225, 0.10046802198716043, 0.8319652297207899, 0.5741815548571009, 0.14363001871238934, 0.7054110267782587, 0.2656736035399855, 0.023801548940825534, 0.7063291008489802, 0.5091128958976234, 0.48697667561902125, 0.26980516198815485, 0.13074249854865994, 0.3507945471815025, 0.0679448663509632, 0.6231672115494677, 0.4579642040330124, 0.9414692527395038, 0.8685291488413267, 0.0759303481177177, 0.08768008381516812, 0.3586064574358109, 0.8021210976902069, 0.6207721308270848, 0.8663351209306182, 0.09517483261904591, 0.813037782406458, 0.8329735437081075, 0.8046244942165821, 0.09475642132568152, 0.8003138633194988, 0.7459320298755941, 0.8680524395848181, 0.6996047592362222, 0.8035351545477541, 0.7431221146351825, 0.975398260922097, 0.15413050728902766, 0.6100424943115319, 0.30491068139276345, 0.6667073941536644, 0.3726578574049235, 0.05820747730935216, 0.5857964905970611, 0.8272403282062875, 0.7252445831110226, 0.1609625334879864, 0.9823830214568963, 0.6940178887760744, 0.7417185434820344, 0.4935753654822934, 0.19578741798967014, 0.5790314901105347, 0.6191239421758545, 0.03655488069795465, 0.718206941880759, 0.13812813456377837, 0.975972862409998], "sigma": [4.683086458560196, 2.0601797188312276, 0.8513647710444161, 3.017836810770091, 3.8170997361364685, 2.3251328721331332, 1.280647750873617, 2.724711578535625, 4.992927429842289, 1.473873289476249, 0.881967363699177, 4.218215732781854, 3.7369685103669266, 2.5815809643152554, 0.13264346830888396, 2.002676696190619, 3.3666194403053114, 1.4964745304806282, 0.02596816063948626, 3.977504976467814, 0.3821928985878975, 0.4019575723351154, 3.055246553611834, 3.870567832897331, 0.8055645199553935, 2.99485821455024, 0.6977816987386509, 4.744940997479736, 3.3374827896579005, 1.8362593956951734, 3.3136968971782483, 4.189630321070125, 2.5125087248561577, 3.64196633565901, 0.4561029023215063, 1.1320389522294456, 3.9988527816808164, 1.2228840006898534, 3.119756127780833, 0.7703491071672691, 1.7886100323937093, 1.0991652219204695, 3.0371991418890514, 4.088829499778022, 4.439764302547262, 1.1987054442829226, 4.945773727743075, 4.972397595444139, 4.287096612056932, 0.1998532508659323, 4.8229318290006296, 2.7846523185410033, 0.6103218560672635, 0.9618738120393167, 2.263509647431048, 1.3030939800294, 1.3048682896047477, 2.157484765314775, 2.646875180252692, 3.7586292232629304, 1.691333230517003, 4.683916094079262, 4.687653023400433, 1.719427692480563, 3.9529775711307384, 1.6179585979784628, 4.8420260923044065, 0.198663701481962, 4.137990172713022, 2.1708837357486956, 0.7777156126322732, 0.18010342171821625, 2.6566808330651996, 0.693343913306213, 4.917738615949482, 4.421187438104905, 0.37095386269198893, 0.949528121219842, 1.9895654212359493, 2.971355475231645, 3.966202657454301, 1.7352381494574924, 3.8134225386075142, 0.3427519344933827, 2.0556994482291904, 3.766164951908173, 0.2764609091786341, 4.131923096728233, 0.05930920662147954, 2.3491773471964055, 0.9693942139606376, 2.0766192567735082, 4.660218606194913, 2.9051077000772114, 2.652957118917648, 0.6430562895225611, 4.218287530681716, 2.0176917084270585, 3.0080125641384425, 4.6999096508779195, 3.027603033180192, 2.7807609751760443, 4.757735885029472, 1.968758871643677, 4.471376962659125, 0.30181499150092994, 2.34298919897842, 0.8096040989857323, 2.9479736621581054, 3.6048268249282067, 4.345776251230702, 3.8880292111295898, 4.255327089002818, 1.4855179362393234, 2.1647989480457923, 4.617604240311523, 3.715047130894684, 0.7399365014083042, 0.5227182233640648, 1.3016890129158887, 1.0870273880865748, 2.735316585129759, 0.3946406267288671, 1.2719344422637562, 4.18953081112037, 3.0838533358684566, 2.542912477879793, 3.095722674180853, 3.7123080263643757, 4.689673043512809, 3.0552571593690905, 3.9553063873723855, 4.62082184169336, 0.16461099072914764, 4.552439715668094, 0.3858038535193081, 2.572823318169463, 4.184316077497633, 0.25369583954931996, 1.314328186351983, 1.0534243006172705, 2.7348499004167555, 3.486868582136346, 2.5686360805900637, 2.745055516703774, 4.418298649101533, 4.887781164919566, 4.412439361379949, 1.1890317549748879, 0.819962950500242, 3.954572323433696, 2.7582199841691226, 3.75387653720761, 1.1619558808384889, 1.533096359025992, 0.2126213978322572, 0.28037711211847116, 1.8113345935257814, 2.0268710526174893, 4.711997446808514, 4.089534571999066, 1.5554300444400204, 3.915166214834032, 4.405555066212495, 2.5437581691846223, 0.2000673332640318, 2.0316921002667376, 4.24769320865602, 0.5771623918225988, 0.787269930204198, 1.508559505338833, 0.23353007531599468, 2.2154585004133893, 1.671672953061668, 4.353162172622799, 1.6016498564547021, 2.455585706971042, 0.9311295175998374, 2.617331633754567, 3.272581263751838, 2.3968008755749266, 1.5189302667864957, 4.17131040586148, 1.4238822118914403, 0.7676592105603125, 1.5530941115332242, 0.08652196187766692, 4.330204498315571, 0.551514582256683, 1.1120207379319114, 0.7726785015161886, 3.1831172887026082, 0.9458242411595136, 3.600842514372679, 3.6537598561068716, 2.5798365128386425, 0.47400132399391115, 2.2130960472496755, 2.506972793782569, 3.389935656337623, 3.525087084643988, 4.038644986574692, 2.1496588311910476, 0.42064309205576134, 4.91136431824076, 1.509368147624846, 3.335569826643936, 3.495889311534654, 3.9345311673462833, 2.3706226909533603, 4.246446372101867, 4.697911818776604, 4.821012577215671, 4.745896813245883, 1.4029141566383507, 4.7690999980394135, 2.646458514509943, 1.3223186199206989, 0.7506939435177695, 2.514780605405838, 0.2521278090751988, 4.330582405116095, 2.7570522125526384, 2.4945527302297776, 0.3196845541947285, 0.48198883409452886, 4.654406800660052, 3.6812837652098036, 0.9162663145058214, 1.7955548288811018, 1.5374008465029614, 3.4613063021719497, 0.9003642758434743, 2.252064028713621, 3.7983948490395045, 3.3985178658006827, 2.2521056817888936, 1.3151179928713086, 0.28696956241924254, 3.0091961902058877, 2.978522552941922, 2.4587180638987878, 3.996701605578323, 3.176766819200099, 0.8575703217025765, 4.022598598697989, 0.6166307704514246, 1.2142139341585267, 2.0903898006431136, 4.6532714857012945, 3.0332527062372105, 4.288754480950497, 2.0167631355047915, 4.83076050735533, 2.249057802206525, 1.927612614068925, 3.598392968975865, 4.598450119251247, 1.6331484022684417, 2.437358597246881, 1.1500447450871387, 1.5337053025002845, 1.541170069787473, 3.4089410048496154, 4.60066427699514, 4.599797584897094, 3.7946791573729826, 1.0437798214187417, 0.4282303606785631, 2.569305110422282, 0.9934035425459259, 4.933611281115623, 1.4690362855591066, 3.14203278995007, 1.0219234005484623, 1.3651546997099913, 4.516863819295439, 3.0623906655464426, 2.524754307006483, 0.7496321277412676, 4.3608067795302405, 1.7658764590551952, 4.844921456049672, 4.238905400808333, 2.9370811571198807, 1.6191959381723464, 1.7959437780772225, 1.8342911503863641, 3.0630208140774116, 0.0912245219102048, 2.8831933640039176, 2.577133774395498, 4.367461351981483, 1.745168971230412, 1.9594475960091562, 0.31426980428162776, 3.6978416085525074, 2.763107213897144, 1.9388986283423748, 3.7003837593983286, 0.38191098708774684, 3.676988508947577, 3.0219432984849313, 4.420836066539827, 1.0085665928586118, 0.7248184168134919, 4.15642526924729, 0.07986143968072013, 0.5061662845719955, 1.2593806574503086, 1.3335959804348292, 1.6536940708379748, 2.480076465927197, 3.640055890067791, 3.228825777728167, 3.865757566031325, 0.05395139092474688, 3.6680540058597972, 3.719391521454407, 4.940502289636705, 2.2826772945321, 1.2811489347448384, 2.4483429537625416, 3.2605905122970102, 4.922383138665779, 2.0168880595244087, 3.5584094723721122, 3.2444190048424404, 3.1271514352244347, 1.8652919266790207, 4.017333297776336, 3.682876490992728, 1.282099585236115, 2.3790703991767312, 2.507755290849623, 2.4191112296375583, 1.4221941683173749, 3.4426975489481846, 3.9690498798967013, 1.68616938556104, 0.8351257655600941, 3.596935147328744, 4.2044108653839825, 0.43791171801565165, 3.7415325412151157, 0.952360251226656, 0.7451360416726188, 0.20874111711048027, 3.856145554413861, 4.617754311026258, 1.7001493899421638, 4.13773537223113, 4.3856971709621675, 2.3526266377978438, 3.136205137745982, 2.6942952260583377, 3.78009991537731, 0.020366614490183732, 2.365134804151789, 2.1158340581506403, 2.9059533433569253, 2.088617987677347, 1.7920616599983685, 4.616029789323158, 1.3151201305219673, 1.156630739172313, 2.535383127998801, 3.8830258403180586, 4.3266367533476915, 3.524448092978043, 3.6950845256278164, 2.198182459250699, 4.272525651324624, 3.774507189478668, 0.19018285894468023, 2.467147243855306, 3.1197174693727603, 1.110971927866149, 4.415832451480976, 2.1473460705460328, 4.241739508815319, 1.1336378266408893, 1.6124002319468878, 2.6120272098126636, 1.3198167194996464, 2.203116601412549, 4.2265463126811635, 1.5128831529975928, 4.311985434465463, 2.6476844074434758, 1.5669712708764272, 3.2100625963539913, 4.903640020393032, 1.4046141814938569, 3.613281159143083, 0.03577583063117673, 1.6529247477854447, 4.271415734558955, 1.8283566605097485, 3.1759105791096527, 1.5065070743797477, 4.874705433510384, 1.8972668057873392, 2.156921956125783, 3.650506537122789, 4.560076201465801, 3.5707698870420375, 4.356415981656391, 0.1513245289158116, 1.7643399069570032, 4.423026099531572, 4.306940365633421, 2.8356903046952904, 3.5655819100260944, 3.2965076270807, 0.10215041971533556, 3.938490898969346, 3.8185467382166505, 4.978510394087353, 2.852249424831652, 0.12632129098898381, 4.414588351607017, 0.22890871354564302, 4.770755137247962, 0.1166334250604778, 1.4163779762832536, 4.043209824072079, 0.4360734162737423, 4.580780571848849, 3.951406429999897, 2.919833803512042, 2.771254221460927, 0.29277320269670337, 3.6908103310534157, 0.30895373084867894, 1.233131662973987, 0.1193036979021278, 1.7338347507664271, 0.777411142535116, 4.447602884658486, 0.29603213990838706, 1.140421115777594, 2.66046003484167, 3.767580369661114, 0.9051001711826584, 0.9925371465802951, 0.947313254267983, 0.7771114158947995, 1.3709982026876832, 4.5630775467791524, 2.2191335669596226, 3.4496084263603652, 1.1688246016854804, 4.093876042894175, 3.8509471001337077, 1.8114726473185088, 1.5128086886294345, 0.45419956547759155, 4.710242745299952, 3.1467295445381698, 4.305575517176918, 3.2528773929595873, 3.5416887241535155, 4.696880136124974, 2.990317205156336, 3.9077277906236803, 3.635568561449267, 3.9244311040927893, 0.8763027764213283, 1.4932224598433637, 3.901161167200354, 1.9425350229502807, 0.3458276846111952, 2.9099734131778714, 0.4560660391674143, 4.415766409951958, 0.5874159739853391, 1.6642950369924643, 0.268560927632453, 0.7500772072697098, 4.750052147169016, 4.177311994842855, 2.958239195937295, 1.889231386248128, 4.925891631222818, 2.345391250596363, 1.1205197709460561, 1.7376815246573096, 1.5147211995812433, 3.6031616182372983, 0.48256689084438864, 3.2204375598990653, 2.508192357371248, 1.4201828922008841, 3.9764561211052456, 1.319527044434217, 3.4725575036248535, 0.265795718663005, 1.4215219193596478, 0.8119088827875848, 3.3136096156585038, 2.3526826542351147, 2.088072546491095, 2.465508406746447, 1.6730502833755068, 0.5970907946147125, 4.024489888652182, 4.695155477070659, 0.7492582878675297, 1.2394527513142521, 3.2200556242835177, 4.18082264850815, 1.1450935536742683, 4.048221062816249, 2.483228165046132, 1.3409887278072363, 2.525547088151949, 0.15044437335954008, 1.360502115998969, 1.2673480508834118, 4.26849664004227, 2.828912447868985, 2.925925012134894, 0.6122316444012899, 3.4707491633997716, 2.6470413407238027, 4.869049735206454, 1.4697453419250843, 3.9837462091908558, 2.7040372969858426, 0.5416476259125297, 2.428826273029708, 0.1494727244356686, 0.7246957505369245, 3.124437821058791, 0.5207747860278089, 3.6439783596132043, 2.633765129794741, 3.7174977482582765, 1.2147117416378106, 1.4017312602613559, 3.1343110704236055, 4.025260555788442, 1.3408982280564525, 3.1141809573965062, 3.3716583511576035, 4.585408758937004, 4.7111476130254895, 4.886182094116192, 0.8086215759075505, 4.053384936782642, 4.246293977747651, 3.8450054880398317, 4.48833425093936, 0.8231228067643953, 4.642558383064147, 3.661352971542942, 4.905335847852016, 1.4282672111436594, 3.679896422569286, 2.0038873878588523, 0.12441531576497633, 0.42101254448436376, 2.273748858391855, 1.7754890891790265, 3.6362536541798574, 2.580281976246699, 4.355964282812522, 0.7687716194083938, 3.1210507518305084, 2.9886671450841105, 2.1062381847125056, 4.443901799360547, 3.3970224737792103, 1.2970169737548187, 2.626682018339398, 3.4466327268446157, 3.6407114464170593, 2.7961388916525114, 0.01779371863100787, 4.7662818678237775, 2.92303577456938, 1.9791674157524626, 3.209109515892447, 0.6623377344872133, 0.8100212644077648, 2.5495834748829127, 1.9755323285705755, 4.4254831317526815, 2.2697373714738096, 2.748411098583308, 1.499272955285782, 3.683523339932587, 0.5166479678186059, 2.2713328608687084, 0.3381494170388144, 1.655563424019531, 1.483553615737031, 1.6282699610140883, 0.07769726948576972, 0.8207738641689954, 1.2193595932905432, 4.210576461572071, 2.1716355631882616, 4.327372296286497, 2.9370228559026996, 4.773609153923398, 0.001744017419696986, 1.9722479077716215, 3.351649146460725, 1.9780404537551304, 0.3154131348729955, 4.129685378897078, 0.5198327333113639, 1.462491308865732, 1.0112391955606026, 3.623957911294699, 1.3055485623958458, 3.751477803457437, 4.555043689854922, 3.7142528010660736, 2.170754967869822, 1.3769665058538365, 1.3105715763672887, 4.051082665955476, 1.5217578454640495, 2.020675523245179, 0.8893216714724123, 2.9886839772993885, 1.9045253664575856, 0.6897133148791723, 1.0063363876031894, 3.2646371405618204, 0.6893917000568628, 2.7598830281600826, 0.7523149315106858, 2.820999668537789, 3.416543338110532, 4.676796260652741, 3.4423504846678292, 1.740426418378656, 0.3110580184703704, 4.980502169311732, 3.7766285319355823, 1.6357600890671498, 4.726119130847474, 0.8640026472743029, 0.042248329300720866, 3.88478789748256, 3.6333484730725334, 3.33365331984056, 0.4951782064021115, 4.42562235266853, 1.5055493752738398, 1.8073793460967407, 4.041257151411469, 4.2425253632365605, 0.37738225398738445, 4.209808562772982, 2.5376046449988805, 0.8472438855043707, 3.1788968778219777, 2.307578811666517, 2.104555077709262, 2.825525607564492, 0.7860320597932768, 4.56806885402205, 0.3620415779214148, 2.603049543875559, 3.9138402867879045, 4.122352597475895, 3.0432712116742335, 1.6669911073935062, 4.691539760155761, 0.43784260655524876, 3.5445016387901735, 3.436774846656267, 0.6792773168761473, 0.8061893884442106, 2.8158923811433194, 4.051755439044404, 0.49015050464555676, 0.9323191706523476, 0.30642070675691246, 2.8366045137530147, 3.812702158943532, 1.7633082304328802, 4.131153391215582, 4.029862280359469, 4.07824058313915, 4.500795743311588, 0.45506408609893745, 4.270461324002651, 1.5053970885837602, 0.34378323760299645, 1.3233066293717866, 4.539462191668286, 2.9037972678351935, 2.133552326876746, 2.7787957679034503, 4.308297101354012, 3.9350503621929085, 0.8109392665358228, 2.302440080536592, 2.767203613758005, 0.10437189290816717, 4.097701240135059, 1.4906731927973138, 2.984654239086919, 4.166419812469385, 4.617882711630083, 1.9949029472841655, 3.6378088154161503, 0.32168870401316607, 0.4310633805220382, 3.533492738808608, 1.437459376006649, 0.05230953178782305, 0.19147239233151703, 3.254643667299726, 0.7804887694810247, 3.862820123762744, 3.195214552302091, 1.9683011542730833, 3.4716856974138555, 2.3096142517468388, 3.2361501803593713, 0.8785644552293159, 2.8741930220146026, 1.9127906264018772, 1.179208753175811, 2.4144551838763393, 2.47178605458511, 3.548862150435345, 1.5730234373382896, 4.036224440604278, 3.0707794210765322, 1.1511431614026513, 0.453196992091926, 3.276377519472045, 3.2427073990567528, 0.5574916956189724, 4.584743825906797, 2.3516361365496623, 1.8812166832049981, 3.8073391598298945, 2.162261613021135, 0.21102206501255272, 3.628626872131596, 1.983152610368486, 2.9570794879479263, 1.1033897668365544, 1.8388355489670487, 2.180806396862851, 4.753339209917904, 0.753189907606181, 2.647259998016343, 4.903384281215002, 1.4563698140427612, 4.271734485092233, 4.762454906497162, 2.919989579201545, 0.23974428924430358, 2.173419327957155, 3.9332594923189874, 1.3302996525490092, 2.934582992376042, 4.746592175138677, 4.247128270414104, 0.30276219910953084, 2.0340542548278706, 3.852204699863655, 1.6017301669893125, 4.64624977954019, 0.2206583401009804, 0.7098299350702847, 1.8275363361911996, 3.19808177311524, 4.079054890316275, 1.6544160219546167, 1.7768005936291393, 2.7016091280679695, 0.5867410739066647, 4.097144831060576, 1.5985939370355533, 0.051053736798579163, 1.0157482756548675, 2.9835957724856286, 4.253466467664229, 0.9665281341803134, 0.7579403699980003, 0.9465073287514586, 2.91087391682715, 0.9956064876320142, 4.556084936486406, 4.239700380057096, 4.3885120166027445, 4.293039227545551, 4.29844542343875, 0.2844094621642773, 2.387324842492508, 4.734879898963377, 2.1772657227943997, 1.1644605353134352, 3.4115713157253182, 4.624373128520938, 0.16349223874495, 4.792091885337534, 2.731703834832329, 2.395639171489625, 1.675104837641737, 0.06120962339605518, 1.8735593084352415, 1.964491135192485, 3.1536642538711868, 3.740175079742955, 4.121815711443334, 3.841866213324182, 4.644771543914707, 0.41617535474767153, 2.727654259429407, 2.236735890034329, 4.259622488446126, 2.860158829196232, 1.8553125220443034, 2.2619136457765086, 0.5844451809672679, 3.995447553007736, 4.060073528639113, 3.4866707256343323, 0.2255645251483407, 2.1460678424026813, 4.418867875505546, 4.613817028945052, 2.8887919531285915, 0.1697423161891698, 2.7104900631519846, 1.3413436391741262, 2.316653050843934, 4.270491994618114, 1.0430698379205772, 2.4160558506920555, 0.3207763459407126, 3.9757926922230125, 0.2447265162475798, 4.8357837434800075, 4.073596487176896, 4.396317682985206, 3.5123155500667016, 4.036598751005636, 4.345115907724809, 2.3368861068557556, 1.3522418193020314, 0.9190108448980416, 0.42559358334551434, 1.7349995170236054, 4.666520618976468, 1.4803227911873218, 3.6091575254418484, 4.311954138473828, 1.3898705853977327, 3.7596188596074605, 1.1082041297647727, 1.687418784407726, 1.225404359792186, 3.085061030595802, 3.8851668123574323, 0.9395687585013551, 4.852236965467592, 3.413939229731646, 4.393061623665032, 3.7364977997828053, 0.8389693542185606, 1.9906015990236514, 3.087718352069696, 4.162168644254114, 1.893180579844499, 3.3045871361690224, 1.1818200233131364, 2.711809575446245, 1.794680497243812, 4.266112449085109, 0.17508270297124262, 1.4699130116068737, 2.6931314455209754, 3.586579793809048, 2.163688943794579, 3.6419624110004154, 0.6879864439117239, 4.5431702655115975, 4.984599315020006, 1.7892256569308445, 0.00844705966244752, 0.35440657173264223, 0.7222344851909052, 1.0303876043047584, 1.7069444130018319, 0.2726515189232315, 3.562565605148852, 1.3312354874255945, 0.6728634698184593, 1.2025580185939566, 4.955123231788483, 0.15786380683993573, 4.894142096924361, 0.5363437906791341, 1.380349511207986, 0.04224417677999914, 4.953132905922347, 1.4468348521401957, 4.129235731742989, 1.717600688489993, 1.7631015400427312, 3.5789923533923984, 3.872630615799765, 1.633535421918288, 3.876995100488432, 4.388058033504295, 1.5776524128974234, 0.022865682097163442, 3.4410293329871875, 4.846023528351076, 2.587174685618863, 2.2653103184481242, 2.9767396943081845, 3.6713295749117063, 3.7443746907034487, 0.8262144871649274, 3.601618489176846, 3.8280496738519245, 1.9684917453013717, 2.048790086622087, 1.6789163363024617, 3.3563887871027287, 2.19601342084246, 3.913579827632482, 0.6348281754947915, 1.8621096256995857, 4.879560694423858, 4.9449474304408785, 4.625507499957518, 2.164850649575861, 0.45296007957325357, 2.1492122596050764, 3.1502437119962816, 0.7401488189416533, 2.9603282266127695, 4.216445223174974, 1.0932052967038879, 2.687013738464195, 1.557978750010558, 4.709095474087413, 3.3190968918095503, 3.209619909686104, 1.7161610767903062, 4.299216811364576, 0.8987731166017254, 1.1556577788376532, 1.302651659096841, 3.217444682769521, 1.5993783739947527, 3.6786321412517826, 1.2693218811913098, 3.367481855189412, 0.758566155536789, 2.1490228951999564, 0.5370700546722296, 0.7419747514492081, 4.768309009470978, 2.8831514221409638, 0.4687336159777594, 3.871047881054028, 2.080216421551389, 0.41367788283564855, 3.363000174941375, 2.675282847479198, 1.2310290910600057, 2.000848672324371, 3.8702040131796887, 0.15325690235020284, 3.343341007688178, 1.1560681126705585, 1.098237177037541, 2.171793196115859, 2.2854534643907805, 0.885890130833914, 2.4465961537425684, 4.312574084128061, 4.861215654321903, 1.9870261342447697, 1.8167189720504444, 4.427499451175647, 3.9376870003578657, 0.3335191854173458, 3.2420011480661555, 1.9537305008752326, 0.37588877155772027, 3.323046303049461, 4.109921550773805, 4.254206841102266], "expected": [3.1689608542795726, 1.2958763635690729, 1.3217134448483032, 4.9423983364547555, 3.856673417781664, 0.8634510720030175, 2.4928155151762024, 2.8219183252945945, 1.2206032385103973, 1.4265399449461538, 1.1566475285299198, 3.6712784233392233, 0.25956130911022274, 1.2530742236325432, 0.05728350945299504, 1.7331381851675531, 1.9370454327591988, 2.147427367007757, 0.031072881531248653, 1.9083589513660275, 0.6730097242363751, 0.24963924177690797, 3.9789279367388133, 4.018026534173187, 1.0023106159258142, 1.0715308957270218, 0.4677900582432053, 0.7897132410392409, 0.8487943410692066, 0.04601137485777739, 1.7699297868907382, 5.125766975728903, 2.5101699240378053, 1.917113701068704, 0.18399407201221638, 0.3199934248455411, 1.767718923455882, 0.2884438889688532, 3.297705217249804, 0.8314422399340241, 2.0933542944375247, 1.5633882990009493, 1.000078953104702, 5.117302362924024, 6.26870651284462, 0.18418502052318197, 3.253036422227569, 3.9446214717278894, 1.6792910653932247, 0.0838947554180315, 0.6397682320862031, 3.3408240224297017, 0.22762986734225105, 1.8046504376247234, 2.0861149852497194, 0.33114854391343507, 0.4018341541753521, 0.3126654780678473, 1.9105004241748356, 5.545665802494197, 1.9957372260239428, 5.638885955051785, 2.9844956736210753, 1.8575278280544052, 9.716811259786772, 0.06560690129227836, 0.3363260740358845, 0.06874686725679266, 0.39272903873796716, 0.6664809709977594, 1.1169853407678545, 0.33614016224005505, 2.7075669560618127, 0.4288748431211966, 3.5330851305397917, 2.624739768954897, 0.2416828084779476, 1.3397151616620242, 1.9187663186656552, 0.4126434082197882, 0.670225346904515, 1.032705837820791, 0.39437155922314054, 0.047008628852361005, 0.5356625822033186, 2.7209351092691003, 0.33315336326983414, 7.12095441875253, 0.049083301659481465, 2.590466461555855, 0.5004689725525674, 0.5109852497287078, 1.918236214456171, 1.0694396219727675, 1.2457261133960318, 0.8495566135066357, 2.3374440362674624, 3.763215471028367, 1.9392132006973632, 5.443147475590713, 1.582874390851253, 6.37176051712057, 5.393487537514373, 2.240424210574878, 7.3747104078278385, 0.13122106282814788, 3.898298259460451, 0.7172731407471442, 0.2849675726301174, 2.140592349249503, 0.3772418437034629, 0.774652932819394, 6.268402948374989, 0.6968478272611315, 0.4282109145624256, 7.673142869970985, 6.105553878609426, 1.172532193557571, 0.1800883202623436, 0.10417677945908393, 1.5091151054368117, 3.086150445094666, 0.28147665873198086, 0.6001440650896738, 4.154825786275177, 0.7139320001083502, 3.412288069316957, 1.6018960785359488, 3.4137637445838367, 2.1340644707779433, 5.036247348750833, 0.13551510366377623, 2.256264810471542, 0.11650839596813173, 2.6243376207930145, 0.3273398154546826, 1.6963559876154348, 0.8404642163709374, 0.22457315233875, 0.808334982801274, 0.09950776291660557, 0.5136853320710508, 2.5072513817782944, 1.5053347325056254, 4.953706484242733, 5.016315664728021, 5.397373625411064, 6.72987766107445, 0.3628291451807826, 0.5599856366956456, 2.598675055426297, 2.31123028744621, 0.5943359949801237, 0.056853268361042285, 0.35074226410838244, 0.466463138937043, 0.5141948288356194, 0.4148973724482979, 2.907709773362595, 9.557948810321685, 6.376839329785794, 1.6708795591231713, 2.541347986599816, 2.9424794988036864, 2.663862014064321, 0.12911017604566846, 0.6868019305347581, 3.394583816602182, 0.2620669112663081, 0.10273110098420965, 1.1028886487001766, 0.4167402665341146, 2.06028872798181, 0.12045643191187032, 8.949500857953188, 2.190380237933342, 4.821067510547328, 0.37940174948436084, 1.1331305613066676, 3.033339630309408, 4.4450067697210915, 1.9325709923105185, 1.5031450651217302, 2.6912607890989912, 0.5667655379685733, 1.3737999553857558, 0.010091922332385803, 4.59779420383181, 0.3477322893460209, 0.1145785385406411, 0.5892427825036877, 3.1854262238797, 0.37613354906294805, 3.1916480442323896, 3.4710142964402375, 0.015738745681581817, 0.2501740642023634, 2.0208763311432847, 3.5938079230510827, 8.445087283729375, 0.03972555114576755, 0.36233837676685476, 2.799409501138311, 0.4558043890091012, 2.073015543783527, 2.0024562730157536, 2.3662683969022864, 2.729732472023159, 1.3139432195742018, 2.436746250853894, 0.39324832662238896, 6.141631945428042, 4.111855338769871, 9.16199183174421, 1.6374002730644346, 4.0438688378933625, 1.7282645299896517, 0.7236793681984638, 0.12398969125668734, 3.8071893559073957, 0.15591589552552704, 6.648457774471649, 7.135951693462849, 4.49658907718446, 0.33003099429007676, 0.2504555893348525, 2.8620372263547105, 1.2362211517835338, 0.08106640154190382, 3.3963268957591928, 0.9655007822259284, 4.613798112684642, 1.0157517828821758, 1.6206726046088211, 2.4725889949388073, 1.9509813954545454, 1.8795633198885326, 1.255989900036766, 0.6321180730316233, 2.8123034905733997, 0.27584362529590195, 4.34961374107223, 1.4209354421123837, 3.92023869903315, 1.3051037913506807, 6.087290051297364, 0.01974762535795798, 0.690267098413177, 0.026048503697916187, 4.297995211895419, 0.10131398368843576, 0.8617701526191538, 0.6477485215539652, 1.9093917393460083, 0.0016980670885069621, 0.6024748113049226, 5.647055184820174, 1.5757565554713515, 1.8053741953155193, 1.2037567097730517, 0.9592337836860354, 1.734653673103015, 1.2999737380880838, 3.634768984883582, 1.4961013846539886, 0.02343472408305929, 2.1668034045912297, 1.6113900606210863, 0.7195269136069807, 0.5104485410345878, 1.4551976994112803, 5.353944579019877, 1.7544089830764313, 0.8316826319798566, 1.174180479745738, 0.559182695287384, 3.9068333510430295, 0.31049962403296716, 4.172386894358982, 0.37654416279271846, 0.3463326585971218, 2.9682497949600886, 2.992801727173173, 10.65972688977349, 3.221907408141764, 0.27246246263381296, 1.833141217229958, 2.0414841001118638, 0.5206592958512802, 0.07179335375410659, 1.0530182372313999, 2.5915059231048954, 0.7469989886828656, 0.1627464660392391, 0.7081613086036637, 0.3042270251143354, 6.603258685488592, 3.7134402044393204, 1.3167932719638118, 1.2122957684660982, 0.1877560139665785, 1.8340946369890476, 0.12093873795198146, 2.146456111820095, 1.3871347596500545, 0.4207831554304996, 0.08098074344983543, 0.16023594147710857, 0.008004679752706948, 2.1599430564319975, 0.1518191848323973, 1.5658971647854087, 0.4816529788276773, 11.692300404928051, 5.637947798862896, 1.9918785253929348, 0.025111432384150287, 0.15898583416229345, 1.6698787999134448, 10.663419135525237, 0.4023034519980922, 0.8279269143542592, 2.5886943367584587, 0.6991438857707035, 2.5380812748531008, 1.9659353012839178, 0.04562625611161446, 1.6160669735863928, 2.16838822443704, 1.8165283043116465, 4.443433964931072, 0.6370185692228669, 0.6788304602071537, 1.5949876962274645, 0.6452609136701312, 1.499656870992392, 0.8971964750843331, 0.9733821312826686, 6.113816693659154, 1.885344163627776, 0.2785002914702737, 3.5317621242813995, 4.041528479118297, 0.37634814103501146, 1.3870273209834483, 0.9221575166384443, 0.16569861252912788, 0.13894387841505537, 0.5735924692066144, 4.336439185740316, 0.13906244480908422, 0.5092978985803597, 0.5563404005725628, 3.2749800387781933, 2.9675893771687063, 0.6132317651735081, 0.5994517298189557, 0.004236214470967421, 1.743403181923124, 3.554836018804861, 4.791436430142905, 1.3696744223995365, 0.28888038140065364, 5.263942701923861, 1.6010586642169296, 0.5971368340787736, 3.773242324223984, 6.757839111033057, 2.624043822175051, 3.2059362005992584, 0.875381033335089, 3.7792241581707913, 7.252228772534085, 7.7390394069996, 0.055184954364140115, 1.8989531228870133, 1.0066232597832434, 0.17060124551652486, 0.9194571433675572, 5.404162340445337, 5.999912858082141, 0.7182982383221317, 0.4081509966305815, 5.6011492056649255, 0.3519732454674452, 1.6794570981662658, 3.2264164197282854, 2.4135996626884446, 10.060884619449228, 2.7978644976570544, 0.2168039334224886, 0.5822881216188457, 2.0726894262508693, 1.1667469581075158, 0.4595221211209755, 0.03916517301917527, 0.3091332251601994, 0.45209247959910004, 2.0275987845176457, 3.119740241991646, 1.6942227843666415, 1.1812219236977581, 0.6659505792293742, 3.3166565818198452, 3.706787134302216, 1.002584169802912, 1.8831644696450376, 3.8701292190372154, 0.1020640000535791, 0.576289084168373, 1.6770053546875234, 2.1548815017632466, 0.23171077994796377, 1.323086216132864, 4.962446220898185, 0.12019890476871055, 2.751284789825008, 0.2636134047937077, 2.1325473131774033, 2.1756570118591507, 0.12552088684808266, 1.6826458099060528, 0.19907663853404683, 6.010195441225483, 0.0015422843086419968, 0.35007577617401425, 3.975954980884109, 0.6552048614501174, 3.14279985851435, 10.426316979870835, 3.982288076151539, 1.5163325148712947, 0.14396108992427364, 4.89888709682563, 0.38419390582221197, 0.295634673911107, 0.07655307776907895, 2.4274967414205997, 0.4648671996036934, 1.605606114819965, 0.05026322218335487, 1.339920038630504, 0.9451937054061488, 1.7758840985287476, 0.8750698309988234, 2.122460383556418, 0.7169552791167153, 0.8934376376457601, 0.7994637989007113, 0.15774445686026323, 0.23860225559919954, 3.2781475121816532, 0.8428191697199422, 1.1482178174807174, 4.83190765366029, 0.44398706283816836, 1.8316744381145813, 0.2566650255017814, 5.218030737050623, 2.4899316998667755, 4.641574233881193, 1.5818538754099827, 0.7015400687206874, 2.7160395171710956, 0.5610467106503384, 3.525033567700824, 2.6268611077665023, 5.680013423905685, 0.31159728814915594, 1.5711296406940247, 0.012495558542070158, 3.0893131319514096, 0.7276751422710557, 2.5039678318493337, 0.18581616166444231, 3.6644599648847973, 0.3553247674123921, 0.3422881057080157, 0.1345137352916094, 0.01371726217362756, 8.366986356278487, 7.764469720080299, 3.2817474955394, 1.8300197904615743, 10.03359190832056, 1.3092834368439694, 0.43300790530399924, 2.295529070635968, 1.443384097217213, 2.9640012590123113, 0.1869900369860291, 3.49726392348065, 0.7025409584162712, 0.9896523317909567, 1.9686966783871283, 1.071730341336165, 0.37452633159230786, 0.46957029445082366, 0.6048187323553996, 0.7861730792109138, 1.0898293494904285, 0.45810622678141494, 1.1398038509939739, 1.5766070195576045, 1.9554963983655225, 0.4148381016589972, 2.394846621168292, 2.058021528726009, 1.4315158164746251, 0.1914944825688322, 0.053967185921507205, 1.3341309938890147, 1.2374395971965877, 14.780451424179878, 1.0679217292644316, 0.3589541985776203, 3.3578420137992175, 0.21896166041453266, 1.7122808582319053, 0.9876000148977242, 3.2934940653964784, 4.941104147108141, 1.5114578423497496, 1.3044033297552216, 1.993983281081282, 6.169683202517716, 1.4030933506819772, 1.3521606586151578, 2.222703364780306, 0.42169237891469497, 0.805245533905191, 2.177024951662258, 0.07240848893073111, 0.8459834491383887, 1.0533448303247541, 0.5425989864869047, 6.2020006831594, 0.7296736115185687, 3.5381032337662277, 0.3427961040030836, 0.1373150316835108, 1.7586778537419363, 1.6489426094211856, 1.0819475685017215, 0.38571278099226114, 4.866313349815666, 2.3246902304980446, 1.8464715338397437, 1.1373889656347722, 0.8841037324388559, 2.1606386751590305, 2.9264967443659926, 1.7531738436048834, 7.524727459428704, 1.0992041018452658, 2.993758554568865, 8.193192768052555, 4.931233559015763, 0.19625496592852004, 3.251688060688245, 4.689166655940403, 0.0809858349810437, 0.5283680767166784, 0.35597554913974194, 1.2960438048539578, 0.7818881507802371, 0.23650062582736267, 0.7055079084338745, 1.3551856003523393, 3.1493696190345952, 4.67162011997545, 1.522933738896136, 4.854418518067908, 1.4618772692995912, 0.01218800866877845, 0.9809036102467733, 5.631290762798612, 2.257293171316334, 0.81692179879572, 0.0289262032014456, 3.765384351668341, 2.035401269715903, 1.9525916226038524, 2.6309077990973018, 0.0030855206504895143, 0.7866540181149296, 0.15745909145696108, 0.2751253761318573, 4.273055989978305, 0.21879065981287388, 0.8611638428773716, 0.582845754471857, 0.2446120947958919, 0.5847600731320433, 2.4462715663835817, 0.10679080058693333, 1.928843249517447, 0.6375897023280408, 2.507178260906731, 0.04734856437852486, 0.0458075947662526, 1.0218997516575905, 1.953712105391838, 1.950559027258778, 3.9764684318102748, 2.9984846807727843, 5.29798330862976, 0.00043075576939377195, 4.084736412472328, 0.13168422896445603, 4.264596570968006, 0.2508510228745171, 4.797451201607144, 0.7660758433538136, 1.935216214978575, 0.9207908045578767, 3.067563219835524, 0.7895834737469916, 3.8985315711320014, 0.9565246835595339, 0.3910231035609348, 2.1462124434548366, 0.3645720283658013, 1.441321701947656, 5.4972841619500805, 0.17973412296443236, 0.5540113925083772, 0.2748969062701825, 2.1952062845179645, 1.561664933425083, 0.04678981672428584, 1.0044443341082485, 2.4985777423031874, 0.21432290790828776, 2.959254140065799, 0.12917804701692578, 0.5787271359154758, 0.8770510514712381, 3.8117315528442344, 1.8302402314754722, 1.0657258540354826, 0.07612050771247261, 10.25090276281381, 0.6357359041649134, 1.5778257546746546, 11.028878934427276, 0.5136821576813537, 0.002249717270165058, 0.8318302625660055, 2.5264010622757547, 5.773657180686572, 0.56655989419889, 0.25029691244973884, 0.6980296466598521, 3.455164926174593, 1.939397961861663, 1.9905992464524447, 0.030944175725027206, 9.307416147054976, 3.3524830288230163, 0.4567473223419785, 0.0760226221381017, 0.008271954176129496, 1.0567148743640495, 1.9742680367776269, 0.6305883336837327, 6.516062015242777, 0.042025046186049256, 3.769913493807383, 2.1448235910227393, 0.10684185149045268, 2.053226127725272, 2.1369813330945084, 5.218459766759609, 0.28564146327450773, 1.4073225687133921, 0.8642531199656727, 0.7335646397016844, 0.5938468984944446, 0.7518411336378106, 3.162071633993885, 0.2918053273988219, 0.3716006645069243, 0.2895631261006142, 2.800854674295539, 0.7305214366771724, 0.5745515704819637, 2.8832725342171757, 0.7277948013976924, 3.8510998019974583, 7.728443867876067, 0.2831673045457492, 3.524349076587441, 3.118939575714205, 0.3932758666011748, 0.6879980545947791, 5.315313305058815, 3.4503430464207936, 1.8760005734326262, 0.11856030500067237, 1.755214018053235, 1.235755971362514, 0.4786745393299732, 0.4813446181829492, 1.3392308162544369, 0.05415819573655552, 0.5872271630163562, 3.2118727427682425, 1.1550048066842764, 4.960399695468618, 5.647846707943322, 2.566746807422141, 3.1535064218601128, 0.12993117554252392, 0.7829521259920401, 2.362941167699629, 0.7812968213431982, 0.03647478460341712, 0.174283715787458, 3.713884732653693, 1.0631559459443698, 0.48889256229899924, 3.3262150339885377, 2.573952647989396, 2.346934414970635, 1.1793008753559655, 2.7748217335132273, 0.5372779894152853, 4.888705454234199, 3.194821391321279, 0.35580548505269477, 0.9760741965999495, 3.56433841074882, 0.8452149066444998, 0.8127292098741078, 2.5478777903170613, 1.2335844994649965, 2.0779637222576137, 0.10897618845065135, 6.936131009507969, 5.1441059007638845, 0.4891641598242338, 5.362272242734748, 1.7575206431306702, 0.2871673368361909, 1.656499174728259, 2.4407892650256957, 0.0063741814331067116, 10.221133502849067, 0.036952197533093215, 2.723220123100247, 0.43311324459731876, 0.2893190178721901, 0.9694423763593402, 2.4681433259964822, 0.4725124381594877, 2.8357366061215923, 5.157068328937806, 0.2995652919688027, 1.1258230050793119, 13.318276827245489, 1.4529581769380178, 0.337161200414425, 1.4597770447369265, 0.1921386095678869, 0.1556443907058375, 0.08693856386926396, 0.4897129509396161, 5.193316739950834, 0.12615592046019972, 2.1950857915458686, 5.593826893190583, 1.4118874684295937, 0.9885471263092728, 0.16491276950458433, 0.3431511099447981, 3.4000732161511307, 2.5309287483721263, 7.16271655497655, 0.5647668748153366, 3.6402482893798807, 3.985845756686512, 0.0346913367467605, 0.9482303355023608, 1.0054609966130195, 0.007747913499155189, 0.2711830780240892, 1.0752296852593368, 4.366214078680352, 0.6244582623577064, 0.044460863591309976, 1.5803997895248243, 0.8204062531196544, 0.34813289763980704, 1.638615298317461, 3.048184825262385, 2.0257412892612163, 4.415000954351541, 3.4211293742358238, 0.635002134156452, 1.3219110112855814, 5.349853378804661, 1.8807053689251576, 2.0603383930436094, 1.2471735690543222, 1.7134655822685423, 0.030841216920735923, 8.493622271497609, 0.4994387358223633, 1.1730436790403604, 0.4875106069827515, 0.05669383400238196, 0.5197369728553048, 0.015791696060783744, 0.47658281923417123, 4.7821994961824075, 4.883311928618503, 1.7547770464475398, 2.1959319475832286, 0.5852353224109466, 4.213929415533692, 0.4582568829589341, 9.560072641572448, 2.4124292586792375, 2.092641418281949, 0.36090705090705316, 0.7280752261893623, 2.0152845729408226, 2.7613902421743752, 0.7778216575913149, 0.3419009786357497, 2.845932628705101, 4.962307869487042, 9.291840611039026, 1.3868851612141884, 0.04753854042945429, 2.9913116803357096, 0.029191222863746764, 0.721884018506695, 5.60319523302046, 2.1337083638636978, 0.43168383617155504, 0.1302884370529669, 9.83634170801985, 0.02473177677704457, 2.7937097698483977, 4.390670818682249, 0.7603814161142838, 1.5560274265076341, 8.466567104481731, 7.6572300970072416, 2.0040085017475193, 0.13163660395778812, 1.1651498890237668, 0.19824157896081918, 0.34432372141395257, 0.31811179749913626, 1.7397609599206219, 4.699073607979455, 0.4771139670913707, 1.3102518353906536, 1.6251675998303403, 0.3149083554199946, 0.4379138296551425, 0.3179023125942793, 3.6303298873242795, 2.3907109211166806, 0.5816183776332238, 5.126134042177658, 0.9064482361367344, 5.3315214344823145, 3.5882536360601294, 0.2796953166958822, 3.04579392719778, 3.2036006057599935, 0.9378439387020444, 2.5108470095550026, 0.0340407836834921, 1.8236947294886374, 0.7927054256040899, 0.6586301364573666, 4.334327027726187, 0.07114520053472304, 0.7862339222706775, 1.4089993846248747, 4.6646420912744055, 3.5011961393330453, 1.3839511166310339, 0.5311015720153542, 4.828073756999805, 2.940307907052826, 0.19040679315159204, 0.000901394324758243, 0.04175515174940504, 0.2504843767435022, 1.836404506919017, 1.3476617184542885, 0.47758737700842, 2.6117695921774593, 0.7147211799472009, 0.043049546692723796, 2.0068825359844475, 1.9945860031569203, 0.08513916447692371, 2.7424920398116304, 0.29862544195057145, 1.890122270656621, 0.07684468999512183, 1.664589486637016, 1.6367650743809716, 1.2262558546153268, 0.3506053327162075, 0.7385682928068423, 3.2571207811210043, 3.534575537920688, 1.3994420594977721, 0.27008476438617035, 1.553024821964164, 2.276485463698001, 0.008847395190414529, 0.06239243935326949, 2.8028009879172235, 3.0910812836505297, 1.281371368788597, 2.354644040004048, 1.3752651673289942, 1.8466039467683002, 0.5945005100009331, 0.054734565544336096, 3.7545241159966043, 1.231544613064901, 0.9850090170815726, 1.8225043015898217, 0.6588253437542065, 0.28394279536564065, 3.8360776849309297, 0.36453538563980054, 1.491402899451121, 4.848921874691065, 2.2559642507775806, 3.466316287386463, 0.6347359707035877, 0.11271265594627294, 0.27134362932686745, 4.342755923871672, 0.5894304868311278, 0.5358103375380427, 4.419288850129321, 0.3710077854270275, 0.08016770904751809, 1.636037686353557, 3.244089102885157, 2.171145223471264, 1.1068899509825174, 0.2824830124263728, 1.955568700368892, 0.07662889556788365, 1.0213091253426858, 0.7942753953783487, 6.086445321562126, 2.4123856162296007, 0.35060555745368804, 0.13976858767450598, 1.568408981768496, 0.976743584323883, 1.8896785172149582, 0.8055004418919038, 0.0887166269677963, 6.292351715037425, 3.9840011816587744, 0.6069349324538568, 0.4608099647534988, 2.667765820594445, 0.47180964270241516, 5.0662457951322875, 2.770485952154715, 1.5901068170771766, 2.268564922188771, 8.698668629958469, 0.029791810219145894, 2.8742516436124497, 0.4531300331221404, 1.062547843539988, 1.0543430325626348, 0.1668771477075307, 0.7233458940378623, 3.3356644132214, 4.710093175249631, 0.9874335922780886, 4.716348738855362, 1.8597555408290094, 5.00512141236547, 2.616258926737648, 0.08267906032006589, 2.608974867651802, 1.7120213516586973, 0.01722727860496021, 3.5765951116503816, 0.7150928637043897, 9.60044743721558]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py index f55d5b02fe0b..09f77c22935e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/fixtures/python/runner.py @@ -69,7 +69,7 @@ def gen(p, sigma, name): def main(): """Generate fixture data.""" # Generate random test values: - n = 10 + n = 1000 p = np.random.rand(n) # in (0,1) sigma = np.random.rand(n) * 5.0 # σ in [0,5) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js index 6b8f27df9160..217d24dd6da4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.factory.js @@ -102,7 +102,7 @@ tape( 'the factory evaluates the half-normal quantile', function test( t ) { q = factory( sigma[i] ); if ( expected[i] !== null ) { y = q( p[i] ); - t.strictEqual( isAlmostSameValue( y, expected[ i ], 40.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 85.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } t.end(); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js index f0d2fc354736..c8e5a7fbad63 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.native.js @@ -95,7 +95,7 @@ tape( 'the native function evaluates the half-normal quantile', opts, function t for ( i = 0; i < p.length; i++ ) { y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { - t.strictEqual( isAlmostSameValue( y, expected[ i ], 40.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 85.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } t.end(); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js index ee055268e83d..fcca1b66bc7f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/quantile/test/test.quantile.js @@ -86,7 +86,7 @@ tape( 'the function evaluates the half-normal quantile', function test( t ) { for ( i = 0; i < p.length; i++ ) { y = quantile( p[i], sigma[i] ); if ( expected[i] !== null ) { - t.strictEqual( isAlmostSameValue( y, expected[ i ], 40.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 85.0 ), true, 'within tolerance. p: '+p[ i ]+'. sigma: '+sigma[ i ]+'. y: '+y+'. expected: '+expected[ i ]+'.' ); } } t.end();