diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/LICENSE b/lib/node_modules/@stdlib/math/base/special/log2f/LICENSE new file mode 100644 index 000000000000..a7566ad6f2c3 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/LICENSE @@ -0,0 +1,192 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +DEPENDENCIES & ATTRIBUTION + +The library links against the following external libraries or contains +implementations from the following external libraries, which have their own +licenses: + +* FreeBSD + +Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunPro, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/README.md b/lib/node_modules/@stdlib/math/base/special/log2f/README.md new file mode 100644 index 000000000000..3af0f2ab6ea5 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/README.md @@ -0,0 +1,196 @@ + + +# Binary Logarithm + +> Evaluate the [binary logarithm][binary-logarithm]. + +
+ +The [binary logarithm][binary-logarithm] (logarithm with base 2) is defined for any positive real number as + +
+ + + +
+ +## Usage + +```javascript +var log2f = require( '@stdlib/math/base/special/log2f' ); +``` + +#### log2F( x ) + +Evaluates the [binary logarithm][binary-logarithm]. + +```javascript +var v = log2f( 4.0 ); +// returns 2.0 + +v = log2f( 0.0 ); +// returns -Infinity + +v = log2f( Infinity ); +// returns Infinity + +v = log2f( NaN ); +// returns NaN +``` + +For negative numbers, the [binary logarithm][binary-logarithm] is **not** defined. + +```javascript +var v = log2f( -4.0 ); +// returns NaN +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var log2f = require( '@stdlib/math/base/special/log2f' ); + +var opts = { + 'dtype': 'float32' +}; +var x = uniform( 100, 0.0, 100.0, opts ); + +logEachMap( 'log2f(%0.4f) = %0.4f', x, log2f ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/log2f.h" +``` + +#### stdlib_base_log2f( x ) + +Evaluates the binary logarithm for single-precision floating point values. + +```c +float out = stdlib_base_log2f( 4.0f ); +// returns 2.0f +``` + +The function accepts the following arguments: + +- **x**: `[in] float` input value. + +```c +float stdlib_base_log2f( const float x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/log2f.h" +#include +#include + +int main( void ) { + float x; + float v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( ( (float)rand() / (float)RAND_MAX ) * 100.0f ); + v = stdlib_base_log2f( x ); + printf( "log2f(%f) = %f\n", x, v ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/benchmark.js new file mode 100644 index 000000000000..eb500e433994 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/benchmark.js @@ -0,0 +1,85 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pkg = require( './../package.json' ).name; +var log2f = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': ( typeof Math.log2f !== 'function' ) // eslint-disable-line stdlib/no-builtin-math +}; + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, 0.0, 1000.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = log2f( x[ i%x.length ] ); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+'::built-in', opts, function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, 0.0, 1000.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = Math.log2f( x[ i%x.length ] ); // eslint-disable-line stdlib/no-builtin-math + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/benchmark.native.js new file mode 100644 index 000000000000..98572208ad13 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/benchmark.native.js @@ -0,0 +1,63 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var log2f = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( log2f instanceof Error ) +}; + + +// MAIN // + +bench( pkg+'::native', opts, function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, 0.0, 1000.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = log2f( x[ i%x.length ] ); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/c/Makefile b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/c/Makefile new file mode 100644 index 000000000000..d564e8b2d6f9 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/c/Makefile @@ -0,0 +1,127 @@ +#/ +# @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 C targets: +c_targets := benchmark.out + + +# RULES # + +#/ +# Compiles C source files. +# +# @param {string} [C_COMPILER] - C compiler +# @param {string} [CFLAGS] - C compiler flags +# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler +# @param {string} CFLAGS - C compiler flags +# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) -o $@ $< -lm + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/c/benchmark.c new file mode 100644 index 000000000000..0155ab2e6ab8 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/benchmark/c/benchmark.c @@ -0,0 +1,135 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include +#include +#include +#include +#include + +#define NAME "log2f" +#define ITERATIONS 1000000 +#define REPEATS 3 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param elapsed elapsed time in seconds +*/ +static void print_results( double elapsed ) { + double rate = (double)ITERATIONS / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", ITERATIONS ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static float rand_float( void ) { + int r = rand(); + return (float)r / ( (float)RAND_MAX + 1.0f ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + float x[ 100 ]; + double elapsed; + double t; + float y; + int i; + + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 1000.0f * rand_float() ) - 0.0f; + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + y = log2f( x[ 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/math/base/special/log2f/binding.gyp b/lib/node_modules/@stdlib/math/base/special/log2f/binding.gyp new file mode 100644 index 000000000000..68a1ca11d160 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/log2f/docs/repl.txt new file mode 100644 index 000000000000..fad245a7ab36 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/docs/repl.txt @@ -0,0 +1,35 @@ + +{{alias}}( x ) + Evaluates the binary logarithm (base two) for single-precision + floating point values. + + For negative numbers, the binary logarithm is not defined. + + Parameters + ---------- + x: number + Input value. + + Returns + ------- + y: number + Function value. + + Examples + -------- + > var y = {{alias}}( 4.0 ) + 2.0 + > y = {{alias}}( 8.0 ) + 3.0 + > y = {{alias}}( 0.0 ) + -Infinity + > y = {{alias}}( {{alias:@stdlib/constants/float32/pinf}} ) + Infinity + > y = {{alias}}( NaN ) + NaN + > y = {{alias}}( -4.0 ) + NaN + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/log2f/docs/types/index.d.ts new file mode 100644 index 000000000000..eda13e9161ad --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/docs/types/index.d.ts @@ -0,0 +1,60 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Evaluates the binary logarithm (base two) for single-precision floating point values. +* +* ## Notes +* +* - For negative numbers, the binary logarithm is not defined. +* +* @param x - input value +* @returns function value +* +* @example +* var v = log2f( 4.0 ); +* // returns 2.0 +* +* @example +* var v = log2f( 8.0 ); +* // returns 3.0 +* +* @example +* var v = log2f( 0.0 ); +* // returns -Infinity +* +* @example +* var v = log2f( Infinity ); +* // returns Infinity +* +* @example +* var v = log2f( NaN ); +* // returns NaN +* +* @example +* var v = log2f( -4.0 ); +* // returns NaN +*/ +declare function log2f( x: number ): number; + + +// EXPORTS // + +export = log2f; diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/docs/types/tests.ts b/lib/node_modules/@stdlib/math/base/special/log2f/docs/types/tests.ts new file mode 100644 index 000000000000..80e898ff9ed3 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/docs/types/tests.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import log2f = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + log2f( 8 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + log2f( true ); // $ExpectError + log2f( false ); // $ExpectError + log2f( null ); // $ExpectError + log2f( undefined ); // $ExpectError + log2f( '5' ); // $ExpectError + log2f( [] ); // $ExpectError + log2f( {} ); // $ExpectError + log2f( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + log2f(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/examples/c/Makefile b/lib/node_modules/@stdlib/math/base/special/log2f/examples/c/Makefile new file mode 100644 index 000000000000..25ced822f96a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/examples/c/example.c b/lib/node_modules/@stdlib/math/base/special/log2f/examples/c/example.c new file mode 100644 index 000000000000..305fea9fe94d --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/examples/c/example.c @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/log2f.h" +#include +#include + +int main( void ) { + float x; + float v; + int i; + + for ( i = 0; i < 100; i++ ) { + x = ( ( (float)rand() / (float)RAND_MAX ) * 100.0f ); + v = stdlib_base_log2f( x ); + printf( "log2f(%f) = %f\n", x, v ); + } +} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/examples/index.js b/lib/node_modules/@stdlib/math/base/special/log2f/examples/index.js new file mode 100644 index 000000000000..53a4b7c9fc71 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var log2f = require( './../lib' ); + +var opts = { + 'dtype': 'float32' +}; +var x = uniform( 100, 0.0, 100.0, opts ); + +logEachMap( 'log2f(%0.4f) = %0.4f', x, log2f ); diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/include.gypi b/lib/node_modules/@stdlib/math/base/special/log2f/include.gypi new file mode 100644 index 000000000000..ecfaf82a3279 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '= HIGH_MAX_NORMAL_EXP ) { + return f32( x + x ); + } + // Case: log(1) = +0 + if ( hx === HIGH_BIASED_EXP_0 ) { + return 0.0; + } + k = f32( k + f32( ( ( hx >> 23 ) - FLOAT32_EXPONENT_BIAS ) | 0 ) ); + hx &= FLOAT32_SIGNIFICAND_MASK; + i = f32( ( ( hx+0x4afb0d ) & HIGH_MIN_NORMAL_EXP )|0 ); // asm type annotation + + // Normalize x or x/2... + x = fromWordf( hx | ( i ^ HIGH_BIASED_EXP_0) ); + k = f32( k + ( ( i >> 23 ) | 0 ) ); + y = f32( k ); + f = f32( x - 1.0 ); + hfsq = f32( 0.5 * f32( f * f ) ); + R = kernelLog1pf( f ); + hi = f32( f - hfsq ); + hx = toWordf( hi ) | 0; + hi = fromWordf( hx & 0xfffff000); + lo = f32( f32( f - hi ) - f32( hfsq ) + f32( R ) ); + return f32( f32( f32( lo + hi ) * IVLN2LO ) + f32( lo * IVLN2HI ) + f32( hi * IVLN2HI ) + f32( y ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = log2f; diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/lib/native.js b/lib/node_modules/@stdlib/math/base/special/log2f/lib/native.js new file mode 100644 index 000000000000..9ed5da860c39 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/lib/native.js @@ -0,0 +1,58 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Evaluates the binary logarithm for single-precision floating point values. +* +* @private +* @param {number} x - input value +* @returns {number} binary logarithm +* +* @example +* var v = log2f( 4.0 ); +* // returns 2.0 +* +* v = log2f( 8.0 ); +* // returns 3.0 +* +* v = log2f( 0.0 ); +* // returns -Infinity +* +* v = log2f( Infinity ); +* // returns Infinity +* +* v = log2f( NaN ); +* // returns NaN +*/ +function log2f( x ) { + return addon( x ); +} + + +// EXPORTS // + +module.exports = log2f; diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/manifest.json b/lib/node_modules/@stdlib/math/base/special/log2f/manifest.json new file mode 100644 index 000000000000..bb3b6608598b --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/manifest.json @@ -0,0 +1,93 @@ +{ + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/napi/unary", + "@stdlib/number/float32/base/to-word", + "@stdlib/number/float32/base/from-word", + "@stdlib/math/base/assert/is-nanf", + "@stdlib/constants/float32/abs-mask", + "@stdlib/constants/float32/significand-mask", + "@stdlib/constants/float32/exponent-bias", + "@stdlib/constants/float32/ninf", + "@stdlib/math/base/special/kernel-log1pf" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/number/float32/base/to-word", + "@stdlib/number/float32/base/from-word", + "@stdlib/math/base/assert/is-nanf", + "@stdlib/constants/float32/abs-mask", + "@stdlib/constants/float32/significand-mask", + "@stdlib/constants/float32/exponent-bias", + "@stdlib/constants/float32/ninf", + "@stdlib/math/base/special/kernel-log1pf" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/number/float32/base/to-word", + "@stdlib/number/float32/base/from-word", + "@stdlib/math/base/assert/is-nanf", + "@stdlib/constants/float32/abs-mask", + "@stdlib/constants/float32/significand-mask", + "@stdlib/constants/float32/exponent-bias", + "@stdlib/constants/float32/ninf", + "@stdlib/math/base/special/kernel-log1pf" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/package.json b/lib/node_modules/@stdlib/math/base/special/log2f/package.json new file mode 100644 index 000000000000..66d686f2c98a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/package.json @@ -0,0 +1,66 @@ +{ + "name": "@stdlib/math/base/special/log2f", + "version": "0.0.0", + "description": "Binary logarithm (base 2).", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "math.log2f", + "log2f", + "binary", + "base 2", + "logarithm", + "log" + ] +} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/src/Makefile b/lib/node_modules/@stdlib/math/base/special/log2f/src/Makefile new file mode 100644 index 000000000000..7733b6180cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/src/addon.c b/lib/node_modules/@stdlib/math/base/special/log2f/src/addon.c new file mode 100644 index 000000000000..689cf16de441 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/src/addon.c @@ -0,0 +1,23 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/log2f.h" +#include "stdlib/math/base/napi/unary.h" + +// cppcheck-suppress shadowFunction +STDLIB_MATH_BASE_NAPI_MODULE_F_F( stdlib_base_log2f ) diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/src/main.c b/lib/node_modules/@stdlib/math/base/special/log2f/src/main.c new file mode 100644 index 000000000000..5f7e2b596a83 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/src/main.c @@ -0,0 +1,110 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/log2f.h" +#include "stdlib/number/float32/base/to_word.h" +#include "stdlib/number/float32/base/from_word.h" +#include "stdlib/math/base/assert/is_nanf.h" +#include "stdlib/constants/float32/abs_mask.h" +#include "stdlib/constants/float32/significand_mask.h" +#include "stdlib/constants/float32/exponent_bias.h" +#include "stdlib/constants/float32/ninf.h" +#include "stdlib/math/base/special/kernel_log1pf.h" +#include + +static const float TWO25 = 3.3554432000e+07; // 0x4c000000 +static const float IVLN2HI = 1.4428710938e+00; // 0x3fb8b000 +static const float IVLN2LO = -1.7605285393e-04; // 0x3de705fc +static const int32_t HIGH_MAX_NORMAL_EXP = 0x7f800000; +static const int32_t HIGH_MIN_NORMAL_EXP = 0x00800000; +static const int32_t HIGH_BIASED_EXP_0 = 0x3f800000; + +/** +* Evaluates the binary logarithm (base two) for single-precision floating point values. +* +* @param x input value +* @return output value +* +* @example +* float out = stdlib_base_log2f( 4.0f ); +* // returns 2.0f +*/ +float stdlib_base_log2f( const float x ) { + uint32_t hx; + int32_t ihx; + float hfsq; + uint32_t hi; + int32_t i; + int32_t k; + float lo; + float xc; + float f; + float R; + float y; + float hii; + + if ( stdlib_base_is_nanf( x ) || x < 0.0 ) { + return 0.0 / 0.0; // NaN + } + if ( x == 0.0 ){ + return STDLIB_CONSTANT_FLOAT32_NINF; + } + xc = x; + stdlib_base_float32_to_word( x, &hx ); + ihx = (int32_t)hx; + k = 0; + if ( ihx < HIGH_MIN_NORMAL_EXP ) { + // Case: x < 2**-126 + if ( ( ihx & STDLIB_CONSTANT_FLOAT32_ABS_MASK ) == 0 ) { + return STDLIB_CONSTANT_FLOAT32_NINF; + } + k -= 25; + + // Subnormal number, scale up x: + xc *= TWO25; + stdlib_base_float32_to_word( xc, &hx ); + ihx = (int32_t)hx; + } + if ( ihx >= HIGH_MAX_NORMAL_EXP ) { + return xc + xc; + } + // Case: log(1) = +0 + if ( ihx == HIGH_BIASED_EXP_0 ) { + return 0; + } + k += ( ( ihx>>23 ) - STDLIB_CONSTANT_FLOAT32_EXPONENT_BIAS ); + ihx &= STDLIB_CONSTANT_FLOAT32_SIGNIFICAND_MASK; + i = ( ihx+0x4afb0d ) & HIGH_MIN_NORMAL_EXP; + + // Normalize x or x/2... + stdlib_base_float32_from_word( (uint32_t)( ihx|( i^HIGH_BIASED_EXP_0 ) ), &xc ); + k += (i>>23); + y = (float)k; + f = xc - (float)1.0; + hfsq = (float)0.5 * f * f; + R = stdlib_base_kernel_log1pf( f ); + if ( sizeof( float_t ) > sizeof( float ) ) + return (R - hfsq + f) * ((float_t)IVLN2LO + IVLN2HI) + y; + + hi = f - hfsq; + stdlib_base_float32_to_word( ihx, &hi ); + hii = (float)hi; + stdlib_base_float32_from_word( (uint32_t)( ihx & 0xfffff000 ) , &hii ); + lo = ( f - hii ) - hfsq + R; + return ( lo + hii ) * IVLN2LO + lo * IVLN2HI + hii * IVLN2HI + y; +} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..308c3be89c85 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/REQUIRE @@ -0,0 +1,2 @@ +julia 1.5 +JSON 0.21 diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/large_positive.json b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/large_positive.json new file mode 100644 index 000000000000..b86c49720aae --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/large_positive.json @@ -0,0 +1 @@ +{"expected":[4.321928,4.326258,4.3305755,4.33488,4.339172,4.3434505,4.347717,4.35197,4.3562117,4.3604403,4.3646564,4.3688607,4.3730526,4.377232,4.3814,4.3855557,4.3896995,4.3938313,4.397951,4.4020596,4.406156,4.410241,4.4143147,4.4183764,4.422427,4.4264665,4.4304943,4.434511,4.438517,4.4425116,4.446495,4.4504676,4.454429,4.4583797,4.46232,4.466249,4.4701676,4.474076,4.477973,4.48186,4.4857364,4.4896026,4.4934583,4.497304,4.501139,4.5049644,4.508779,4.512584,4.516379,4.520164,4.523939,4.5277042,4.53146,4.5352054,4.5389414,4.5426674,4.5463843,4.5500913,4.553789,4.557477,4.561156,4.5648255,4.5684853,4.5721364,4.575778,4.5794106,4.5830336,4.586648,4.5902534,4.5938497,4.597437,4.601015,4.6045847,4.6081457,4.6116977,4.6152406,4.6187754,4.622301,4.6258187,4.6293273,4.6328278,4.6363196,4.639803,4.6432776,4.6467443,4.6502028,4.6536527,4.6570945,4.660528,4.663954,4.6673713,4.67078,4.6741815,4.677575,4.68096,4.6843376,4.687707,4.6910686,4.6944222,4.6977687,4.7011065,4.7044373,4.7077603,4.7110753,4.714383,4.7176833,4.720976,4.724261,4.7275386,4.7308087,4.7340717,4.737327,4.740575,4.743816,4.7470493,4.7502756,4.7534947,4.7567067,4.7599115,4.763109,4.7662997,4.7694836,4.7726603,4.77583,4.778992,4.782148,4.785297,4.788439,4.791574,4.7947025,4.797824,4.8009386,4.804047,4.8071485,4.810243,4.8133316,4.816413,4.819488,4.8225565,4.8256183,4.828674,4.8317227,4.8347654,4.837802,4.8408318,4.843855,4.8468723,4.849883,4.8528876,4.855886,4.858878,4.861864,4.864844,4.8678174,4.8707848,4.873746,4.8767014,4.8796506,4.882594,4.8855314,4.8884625,4.891388,4.8943076,4.897221,4.900129,4.9030304,4.9059267,4.908817,4.911701,4.91458,4.917453,4.92032,4.9231815,4.9260373,4.928888,4.931732,4.9345713,4.9374046,4.9402328,4.943055,4.945872,4.9486833,4.951489,4.9542894,4.9570847,4.959874,4.9626584,4.9654374,4.9682107,4.970979,4.973742,4.9764996,4.979252,4.981999,4.9847407,4.987478,4.990209,4.9929357,4.9956565,4.998373,5.001084,5.00379,5.0064907,5.0091863,5.011877,5.0145626,5.0172434,5.0199194,5.02259,5.025256,5.027917,5.0305734,5.0332246,5.0358706,5.038512,5.0411487,5.043781,5.0464077,5.04903,5.0516477,5.0542603,5.0568686,5.0594716,5.0620704,5.0646644,5.0672536,5.0698385,5.0724187,5.074994,5.077565,5.080131,5.082693,5.0852504,5.087803,5.090351,5.092895,5.095434,5.0979686,5.100499,5.103025,5.1055465,5.1080637,5.110576,5.1130843,5.115588,5.1180882,5.1205835,5.1230745,5.1255608,5.128043,5.130522,5.1329956,5.135465,5.1379304,5.140392,5.142849,5.145302,5.1477504,5.150195,5.1526356,5.1550717,5.157504,5.159932,5.162356,5.164776,5.167192,5.169604,5.1720114,5.1744156,5.176815,5.179211,5.181603,5.183991,5.1863747,5.188755,5.191131,5.193503,5.1958714,5.198236,5.2005963,5.2029533,5.205306,5.207655,5.21,5.212342,5.2146792,5.217013,5.219343,5.2216697,5.223992,5.2263107,5.228626,5.2309375,5.233245,5.235549,5.237849,5.240146,5.2424393,5.2447286,5.247014,5.249296,5.251575,5.25385,5.256121,5.258389,5.260653,5.2629137,5.265171,5.2674246,5.269675,5.2719216,5.2741647,5.2764044,5.2786403,5.280873,5.2831025,5.285328,5.2875504,5.2897696,5.291985,5.294197,5.296406,5.298611,5.300813,5.303012,5.3052073,5.3073993,5.309588,5.3117733,5.3139553,5.316134,5.31831,5.320482,5.322651,5.324816,5.3269787,5.329138,5.331294,5.3334465,5.335596,5.3377423,5.3398857,5.3420258,5.3441625,5.3462963,5.348427,5.350554,5.3526783,5.3547993,5.3569174,5.359032,5.361144,5.3632526,5.3653584,5.3674607,5.3695602,5.3716564,5.37375,5.37584,5.377928,5.380012,5.3820934,5.3841715,5.386247,5.3883195,5.3903885,5.392455,5.3945184,5.3965793,5.398637,5.400691,5.402743,5.404792,5.4068375,5.4088807,5.4109206,5.412958,5.4149923,5.4170237,5.4190526,5.421078,5.423101,5.4251213,5.4271383,5.429153,5.4311647,5.4331737,5.4351797,5.437183,5.439183,5.441181,5.4431763,5.4451685,5.447158,5.4491444,5.4511285,5.4531097,5.455088,5.457064,5.4590373,5.4610076,5.4629755,5.4649405,5.466903,5.4688625,5.47082,5.472774,5.474726,5.476675,5.4786215,5.4805655,5.4825068,5.4844456,5.4863815,5.488315,5.490246,5.492174,5.4941,5.496023,5.497944,5.4998617,5.501777,5.5036902,5.505601,5.5075088,5.509414,5.511317,5.5132174,5.5151153,5.5170107,5.5189033,5.520794,5.5226817,5.524567,5.52645,5.528331,5.530209,5.5320845,5.533958,5.5358286,5.537697,5.5395627,5.5414267,5.5432878,5.5451465,5.547003,5.5488567,5.5507083,5.5525575,5.5544043,5.5562487,5.5580907,5.559931,5.561768,5.5636034,5.565436,5.5672665,5.5690947,5.5709205,5.572744,5.574565,5.576384,5.578201,5.5800147,5.581827,5.5836368,5.5854445,5.5872498,5.5890527,5.590853,5.592652,5.594448,5.596242,5.598034,5.5998235,5.6016107,5.603396,5.605179,5.60696,5.608738,5.6105146,5.6122885,5.614061,5.6158304,5.617598,5.619364,5.621127,5.622888,5.624647,5.626404,5.6281586,5.6299114,5.631662,5.6334105,5.6351566,5.6369004,5.638643,5.640383,5.6421204,5.643856],"x":[20.0,20.060120240480963,20.120240480961925,20.180360721442884,20.240480961923847,20.30060120240481,20.360721442885772,20.420841683366735,20.480961923847694,20.541082164328657,20.60120240480962,20.661322645290582,20.721442885771545,20.781563126252504,20.841683366733466,20.90180360721443,20.96192384769539,21.022044088176354,21.082164328657313,21.142284569138276,21.20240480961924,21.2625250501002,21.322645290581164,21.382765531062123,21.442885771543086,21.50300601202405,21.56312625250501,21.62324649298597,21.683366733466933,21.743486973947896,21.803607214428858,21.86372745490982,21.92384769539078,21.983967935871743,22.044088176352705,22.104208416833668,22.16432865731463,22.22444889779559,22.284569138276552,22.344689378757515,22.404809619238478,22.46492985971944,22.5250501002004,22.585170340681362,22.645290581162325,22.705410821643287,22.76553106212425,22.82565130260521,22.88577154308617,22.945891783567134,23.006012024048097,23.06613226452906,23.12625250501002,23.18637274549098,23.246492985971944,23.306613226452907,23.36673346693387,23.42685370741483,23.48697394789579,23.547094188376754,23.607214428857716,23.66733466933868,23.727454909819638,23.7875751503006,23.847695390781563,23.907815631262526,23.96793587174349,24.028056112224448,24.08817635270541,24.148296593186373,24.208416833667336,24.268537074148295,24.328657314629258,24.38877755511022,24.448897795591183,24.509018036072145,24.569138276553105,24.629258517034067,24.68937875751503,24.749498997995993,24.809619238476955,24.869739478957914,24.929859719438877,24.98997995991984,25.050100200400802,25.110220440881765,25.170340681362724,25.230460921843687,25.29058116232465,25.350701402805612,25.410821643286575,25.470941883767534,25.531062124248496,25.59118236472946,25.65130260521042,25.711422845691384,25.771543086172343,25.831663326653306,25.89178356713427,25.95190380761523,26.012024048096194,26.072144288577153,26.132264529058116,26.19238476953908,26.25250501002004,26.312625250501004,26.372745490981963,26.432865731462925,26.492985971943888,26.55310621242485,26.613226452905813,26.673346693386772,26.733466933867735,26.793587174348698,26.85370741482966,26.91382765531062,26.973947895791582,27.034068136272545,27.094188376753507,27.15430861723447,27.21442885771543,27.274549098196392,27.334669338677354,27.394789579158317,27.45490981963928,27.51503006012024,27.5751503006012,27.635270541082164,27.695390781563127,27.75551102204409,27.81563126252505,27.87575150300601,27.935871743486974,27.995991983967937,28.0561122244489,28.11623246492986,28.17635270541082,28.236472945891784,28.296593186372746,28.35671342685371,28.416833667334668,28.47695390781563,28.537074148296593,28.597194388777556,28.65731462925852,28.717434869739478,28.77755511022044,28.837675350701403,28.897795591182366,28.95791583166333,29.018036072144287,29.07815631262525,29.138276553106213,29.198396793587175,29.258517034068138,29.318637274549097,29.37875751503006,29.438877755511022,29.498997995991985,29.559118236472944,29.619238476953907,29.67935871743487,29.739478957915832,29.799599198396795,29.859719438877754,29.919839679358716,29.97995991983968,30.04008016032064,30.100200400801604,30.160320641282564,30.220440881763526,30.28056112224449,30.34068136272545,30.400801603206414,30.460921843687373,30.521042084168336,30.5811623246493,30.64128256513026,30.701402805611224,30.761523046092183,30.821643286573146,30.881763527054108,30.94188376753507,31.002004008016034,31.062124248496993,31.122244488977955,31.182364729458918,31.24248496993988,31.302605210420843,31.362725450901802,31.422845691382765,31.482965931863728,31.54308617234469,31.603206412825653,31.663326653306612,31.723446893787575,31.783567134268537,31.8436873747495,31.903807615230463,31.96392785571142,32.02404809619239,32.08416833667334,32.144288577154306,32.20440881763527,32.26452905811623,32.324649298597194,32.38476953907816,32.44488977955912,32.50501002004008,32.565130260521045,32.62525050100201,32.68537074148296,32.745490981963925,32.80561122244489,32.86573146292585,32.92585170340681,32.985971943887776,33.04609218436874,33.1062124248497,33.166332665330664,33.22645290581163,33.28657314629258,33.346693386773545,33.40681362725451,33.46693386773547,33.52705410821643,33.587174348697395,33.64729458917836,33.70741482965932,33.76753507014028,33.82765531062124,33.8877755511022,33.947895791583164,34.00801603206413,34.06813627254509,34.12825651302605,34.188376753507015,34.24849699398798,34.30861723446894,34.3687374749499,34.42885771543086,34.48897795591182,34.549098196392784,34.609218436873746,34.66933867735471,34.72945891783567,34.789579158316634,34.8496993987976,34.90981963927856,34.96993987975952,35.03006012024048,35.09018036072144,35.1503006012024,35.210420841683366,35.27054108216433,35.33066132264529,35.390781563126254,35.450901803607216,35.51102204408818,35.57114228456914,35.6312625250501,35.69138276553106,35.75150300601202,35.811623246492985,35.87174348697395,35.93186372745491,35.99198396793587,36.052104208416836,36.1122244488978,36.17234468937876,36.23246492985972,36.29258517034068,36.35270541082164,36.412825651302605,36.47294589178357,36.53306613226453,36.59318637274549,36.653306613226455,36.71342685370742,36.77354709418837,36.833667334669336,36.8937875751503,36.95390781563126,37.014028056112224,37.07414829659319,37.13426853707415,37.19438877755511,37.254509018036075,37.31462925851704,37.37474949899799,37.434869739478955,37.49498997995992,37.55511022044088,37.61523046092184,37.675350701402806,37.73547094188377,37.79559118236473,37.855711422845694,37.91583166332666,37.97595190380761,38.036072144288575,38.09619238476954,38.1563126252505,38.21643286573146,38.276553106212425,38.33667334669339,38.39679358717435,38.45691382765531,38.517034068136276,38.57715430861723,38.637274549098194,38.69739478957916,38.75751503006012,38.81763527054108,38.877755511022045,38.93787575150301,38.99799599198397,39.05811623246493,39.11823647294589,39.17835671342685,39.23847695390781,39.298597194388776,39.35871743486974,39.4188376753507,39.478957915831664,39.53907815631263,39.59919839679359,39.65931863727455,39.71943887775551,39.77955911823647,39.83967935871743,39.899799599198396,39.95991983967936,40.02004008016032,40.08016032064128,40.140280561122246,40.20040080160321,40.26052104208417,40.32064128256513,40.38076152304609,40.44088176352705,40.501002004008015,40.56112224448898,40.62124248496994,40.6813627254509,40.741482965931866,40.80160320641283,40.86172344689379,40.921843687374746,40.98196392785571,41.04208416833667,41.102204408817634,41.1623246492986,41.22244488977956,41.28256513026052,41.342685370741485,41.40280561122245,41.46292585170341,41.523046092184366,41.58316633266533,41.64328657314629,41.703406813627254,41.763527054108216,41.82364729458918,41.88376753507014,41.943887775551104,42.00400801603207,42.06412825651302,42.124248496993985,42.18436873747495,42.24448897795591,42.30460921843687,42.364729458917836,42.4248496993988,42.48496993987976,42.545090180360724,42.605210420841686,42.66533066132264,42.725450901803605,42.78557114228457,42.84569138276553,42.90581162324649,42.965931863727455,43.02605210420842,43.08617234468938,43.14629258517034,43.206412825651306,43.26653306613226,43.326653306613224,43.38677354709419,43.44689378757515,43.50701402805611,43.567134268537075,43.62725450901804,43.687374749499,43.74749498997996,43.807615230460925,43.86773547094188,43.92785571142284,43.987975951903806,44.04809619238477,44.10821643286573,44.168336673346694,44.22845691382766,44.28857715430862,44.34869739478958,44.408817635270545,44.4689378757515,44.52905811623246,44.589178356713425,44.64929859719439,44.70941883767535,44.76953907815631,44.829659318637276,44.88977955911824,44.9498997995992,45.01002004008016,45.07014028056112,45.13026052104208,45.190380761523045,45.25050100200401,45.31062124248497,45.37074148296593,45.430861723446895,45.49098196392786,45.55110220440882,45.611222444889776,45.67134268537074,45.7314629258517,45.791583166332664,45.85170340681363,45.91182364729459,45.97194388777555,46.032064128256515,46.09218436873748,46.15230460921844,46.212424849699396,46.27254509018036,46.33266533066132,46.392785571142284,46.452905811623246,46.51302605210421,46.57314629258517,46.633266533066134,46.6933867735471,46.75350701402806,46.813627254509015,46.87374749498998,46.93386773547094,46.9939879759519,47.054108216432866,47.11422845691383,47.17434869739479,47.234468937875754,47.294589178356716,47.35470941883767,47.414829659318634,47.4749498997996,47.53507014028056,47.59519038076152,47.655310621242485,47.71543086172345,47.77555110220441,47.83567134268537,47.895791583166336,47.95591182364729,48.016032064128254,48.07615230460922,48.13627254509018,48.19639278557114,48.256513026052104,48.31663326653307,48.37675350701403,48.43687374749499,48.496993987975955,48.55711422845691,48.61723446893787,48.677354709418836,48.7374749498998,48.79759519038076,48.857715430861724,48.91783567134269,48.97795591182365,49.03807615230461,49.098196392785574,49.15831663326653,49.21843687374749,49.278557114228455,49.33867735470942,49.39879759519038,49.45891783567134,49.519038076152306,49.57915831663327,49.63927855711423,49.699398797595194,49.75951903807615,49.81963927855711,49.879759519038075,49.93987975951904,50.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/medium_positive.json b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/medium_positive.json new file mode 100644 index 000000000000..de57747aae51 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/medium_positive.json @@ -0,0 +1 @@ +{"expected":[1.5849625,1.6012535,1.6173626,1.6332937,1.649051,1.6646379,1.6800582,1.6953155,1.7104131,1.7253543,1.7401423,1.7547804,1.7692714,1.7836183,1.7978239,1.8118911,1.8258224,1.8396204,1.8532877,1.8668268,1.88024,1.8935295,1.9066979,1.919747,1.9326793,1.9454966,1.958201,1.9707947,1.9832792,1.9956567,2.0079288,2.0200975,2.0321646,2.0441313,2.0559995,2.0677712,2.0794473,2.09103,2.1025202,2.1139195,2.1252296,2.1364517,2.1475873,2.1586375,2.1696038,2.1804872,2.1912892,2.2020109,2.2126536,2.2232182,2.2337062,2.2441182,2.2544558,2.26472,2.2749114,2.2850316,2.2950811,2.305061,2.3149726,2.3248165,2.3345935,2.3443048,2.3539512,2.3635335,2.3730526,2.3825092,2.3919044,2.4012387,2.410513,2.419728,2.4288845,2.4379835,2.4470253,2.4560108,2.4649405,2.4738154,2.4826362,2.4914033,2.5001173,2.5087793,2.5173893,2.5259483,2.534457,2.5429156,2.5513248,2.5596855,2.567998,2.5762627,2.5844805,2.5926518,2.600777,2.6088567,2.6168914,2.6248815,2.6328278,2.6407304,2.6485898,2.6564069,2.664182,2.671915,2.679607,2.6872582,2.694869,2.70244,2.7099712,2.7174635,2.7249172,2.7323322,2.7397096,2.7470493,2.754352,2.761618,2.7688472,2.7760408,2.7831984,2.7903206,2.797408,2.8044608,2.8114793,2.8184638,2.8254144,2.832332,2.8392165,2.8460681,2.8528876,2.859675,2.8664303,2.8731544,2.8798473,2.8865092,2.8931403,2.8997414,2.9063122,2.9128532,2.919365,2.9258473,2.9323006,2.9387252,2.9451213,2.9514892,2.957829,2.9641411,2.9704258,2.9766831,2.9829135,2.9891171,2.995294,3.0014448,3.0075696,3.013668,3.019741,3.0257888,3.031811,3.0378082,3.0437808,3.0497286,3.055652,3.061551,3.0674262,3.0732777,3.0791054,3.0849094,3.0906906,3.0964484,3.1021836,3.1078959,3.1135857,3.119253,3.1248982,3.1305215,3.136123,3.1417027,3.147261,3.152798,3.1583138,3.1638086,3.1692824,3.1747355,3.1801684,3.1855805,3.1909726,3.1963446,3.2016966,3.207029,3.2123415,3.217635,3.2229085,3.2281632,3.2333987,3.2386153,3.243813,3.2489922,3.254153,3.2592952,3.264419,3.2695248,3.2746127,3.2796826,3.284735,3.2897694,3.2947865,3.299786,3.3047686,3.3097339,3.314682,3.3196132,3.3245277,3.3294256,3.334307,3.3391716,3.3440201,3.3488524,3.3536685,3.3584685,3.3632526,3.3680208,3.3727734,3.3775105,3.382232,3.386938,3.391629,3.3963044,3.400965,3.4056106,3.4102411,3.4148567,3.419458,3.4240441,3.428616,3.4331737,3.4377167,3.4422455,3.4467602,3.4512606,3.4557471,3.4602199,3.4646788,3.4691238,3.4735553,3.4779732,3.4823775,3.4867685,3.491146,3.4955106,3.499862,3.5042,3.5085251,3.5128374,3.5171368,3.5214233,3.5256972,3.5299587,3.5342073,3.5384436,3.5426674,3.546879,3.5510783,3.5552654,3.5594404,3.5636032,3.5677543,3.5718932,3.5760205,3.5801358,3.5842395,3.5883317,3.592412,3.596481,3.6005387,3.6045847,3.6086197,3.6126432,3.6166556,3.620657,3.6246471,3.6286263,3.6325946,3.6365519,3.6404986,3.6444342,3.6483593,3.652274,3.6561778,3.660071,3.6639538,3.6678262,3.671688,3.67554,3.6793814,3.6832125,3.6870337,3.6908448,3.6946456,3.6984367,3.7022178,3.705989,3.7097504,3.713502,3.7172437,3.7209759,3.7246983,3.7284114,3.7321148,3.7358086,3.7394931,3.7431684,3.746834,3.7504904,3.7541378,3.7577758,3.7614048,3.7650244,3.7686353,3.7722368,3.7758296,3.7794135,3.7829883,3.7865546,3.7901118,3.7936604,3.7972002,3.8007314,3.8042538,3.8077679,3.8112733,3.8147702,3.8182588,3.821739,3.8252106,3.8286738,3.832129,3.8355758,3.8390143,3.842445,3.8458672,3.8492813,3.8526874,3.8560855,3.8594756,3.8628578,3.8662322,3.8695984,3.872957,3.8763077,3.8796508,3.882986,3.8863137,3.8896334,3.8929458,3.8962505,3.8995476,3.9028373,3.9061193,3.909394,3.9126613,3.9159212,3.9191737,3.922419,3.925657,3.9288876,3.9321113,3.9353275,3.9385366,3.9417386,3.9449337,3.9481213,3.9513023,3.954476,3.957643,3.9608028,3.9639559,3.967102,3.9702413,3.973374,3.9764996,3.9796185,3.9827306,3.9858363,3.988935,3.9920273,3.995113,3.9981918,4.0012646,4.00433,4.0073895,4.0104427,4.0134892,4.016529,4.0195627,4.02259,4.0256114,4.028626,4.0316343,4.0346365,4.0376325,4.0406218,4.0436053,4.0465827,4.049554,4.052519,4.055478,4.058431,4.061378,4.0643187,4.0672536,4.070183,4.073106,4.076023,4.078934,4.0818396,4.084739,4.087633,4.090521,4.093403,4.0962796,4.09915,4.102015,4.1048746,4.107728,4.110576,4.1134186,4.1162553,4.1190867,4.1219125,4.1247325,4.1275473,4.1303563,4.13316,4.1359587,4.1387515,4.141539,4.144321,4.147098,4.1498694,4.1526356,4.1553965,4.1581516,4.160902,4.163647,4.166387,4.1691217,4.171851,4.1745753,4.1772947,4.180009,4.182718,4.1854215,4.1881204,4.1908145,4.193503,4.196187,4.198866,4.2015395,4.2042084,4.2068725,4.2095313,4.212186,4.214835,4.217479,4.220119,4.222754,4.2253838,4.2280087,4.2306294,4.233245,4.235856,4.238462,4.2410636,4.2436604,4.2462525,4.2488403,4.251423,4.2540016,4.256575,4.2591443,4.2617087,4.264269,4.2668242,4.269375,4.2719216,4.274463,4.277001,4.279534,4.2820625,4.2845864,4.287106,4.289622,4.2921324,4.294639,4.2971416,4.299639,4.302133,4.304622,4.3071074,4.309588,4.3120646,4.3145366,4.3170047,4.3194685,4.321928],"x":[3.0,3.0340681362725452,3.06813627254509,3.1022044088176353,3.1362725450901805,3.1703406813627253,3.2044088176352705,3.2384769539078158,3.2725450901803605,3.306613226452906,3.340681362725451,3.374749498997996,3.408817635270541,3.4428857715430863,3.476953907815631,3.5110220440881763,3.5450901803607215,3.5791583166332663,3.6132264529058116,3.647294589178357,3.6813627254509016,3.715430861723447,3.749498997995992,3.783567134268537,3.817635270541082,3.8517034068136273,3.8857715430861726,3.9198396793587174,3.9539078156312626,3.987975951903808,4.022044088176353,4.056112224448897,4.090180360721443,4.124248496993988,4.158316633266533,4.192384769539078,4.226452905811623,4.260521042084168,4.294589178356714,4.328657314629258,4.362725450901803,4.396793587174349,4.430861723446894,4.4649298597194385,4.498997995991984,4.533066132264529,4.567134268537074,4.601202404809619,4.635270541082164,4.669338677354709,4.703406813627255,4.7374749498997994,4.771543086172345,4.80561122244489,4.839679358717435,4.87374749498998,4.907815631262525,4.94188376753507,4.975951903807616,5.01002004008016,5.044088176352705,5.078156312625251,5.112224448897796,5.1462925851703405,5.180360721442886,5.214428857715431,5.248496993987976,5.282565130260521,5.316633266533066,5.350701402805611,5.384769539078157,5.4188376753507015,5.452905811623246,5.486973947895792,5.521042084168337,5.5551102204408815,5.589178356713427,5.623246492985972,5.657314629258517,5.6913827655310625,5.725450901803607,5.759519038076152,5.793587174348698,5.8276553106212425,5.861723446893787,5.895791583166333,5.929859719438878,5.963927855711423,5.997995991983968,6.032064128256513,6.066132264529058,6.1002004008016035,6.134268537074148,6.168336673346693,6.202404809619239,6.236472945891784,6.270541082164328,6.304609218436874,6.338677354709419,6.372745490981964,6.406813627254509,6.440881763527054,6.474949899799599,6.509018036072145,6.543086172344689,6.577154308617234,6.61122244488978,6.645290581162325,6.679358717434869,6.713426853707415,6.74749498997996,6.781563126252505,6.81563126252505,6.849699398797595,6.88376753507014,6.917835671342686,6.95190380761523,6.985971943887775,7.020040080160321,7.054108216432866,7.0881763527054105,7.122244488977956,7.156312625250501,7.190380761523046,7.224448897795591,7.258517034068136,7.292585170340681,7.326653306613227,7.3607214428857715,7.394789579158316,7.428857715430862,7.462925851703407,7.4969939879759515,7.531062124248497,7.565130260521042,7.599198396793587,7.6332665330661325,7.667334669338677,7.701402805611222,7.735470941883768,7.7695390781563125,7.803607214428857,7.837675350701403,7.871743486973948,7.905811623246493,7.939879759519038,7.973947895791583,8.008016032064129,8.042084168336673,8.076152304609218,8.110220440881763,8.144288577154308,8.178356713426854,8.2124248496994,8.246492985971944,8.280561122244489,8.314629258517034,8.348697394789578,8.382765531062125,8.41683366733467,8.450901803607215,8.48496993987976,8.519038076152304,8.553106212424849,8.587174348697395,8.62124248496994,8.655310621242485,8.68937875751503,8.723446893787575,8.75751503006012,8.791583166332666,8.82565130260521,8.859719438877756,8.8937875751503,8.927855711422845,8.96192384769539,8.995991983967937,9.030060120240481,9.064128256513026,9.098196392785571,9.132264529058116,9.16633266533066,9.200400801603207,9.234468937875752,9.268537074148297,9.302605210420841,9.336673346693386,9.370741482965931,9.404809619238478,9.438877755511022,9.472945891783567,9.507014028056112,9.541082164328657,9.575150300601202,9.609218436873748,9.643286573146293,9.677354709418838,9.711422845691382,9.745490981963927,9.779559118236472,9.813627254509019,9.847695390781563,9.881763527054108,9.915831663326653,9.949899799599198,9.983967935871744,10.01803607214429,10.052104208416834,10.086172344689379,10.120240480961924,10.154308617234468,10.188376753507015,10.22244488977956,10.256513026052104,10.29058116232465,10.324649298597194,10.358717434869739,10.392785571142285,10.42685370741483,10.460921843687375,10.49498997995992,10.529058116232465,10.56312625250501,10.597194388777556,10.6312625250501,10.665330661322646,10.69939879759519,10.733466933867735,10.76753507014028,10.801603206412826,10.835671342685371,10.869739478957916,10.90380761523046,10.937875751503006,10.97194388777555,11.006012024048097,11.040080160320642,11.074148296593187,11.108216432865731,11.142284569138276,11.176352705410821,11.210420841683367,11.244488977955912,11.278557114228457,11.312625250501002,11.346693386773547,11.380761523046091,11.414829659318638,11.448897795591183,11.482965931863728,11.517034068136272,11.551102204408817,11.585170340681362,11.619238476953909,11.653306613226453,11.687374749498998,11.721442885771543,11.755511022044088,11.789579158316633,11.823647294589179,11.857715430861724,11.891783567134269,11.925851703406813,11.959919839679358,11.993987975951903,12.02805611222445,12.062124248496994,12.09619238476954,12.130260521042084,12.164328657314629,12.198396793587174,12.23246492985972,12.266533066132265,12.30060120240481,12.334669338677354,12.3687374749499,12.402805611222444,12.43687374749499,12.470941883767535,12.50501002004008,12.539078156312625,12.57314629258517,12.607214428857715,12.641282565130261,12.675350701402806,12.70941883767535,12.743486973947896,12.77755511022044,12.811623246492985,12.845691382765532,12.879759519038076,12.913827655310621,12.947895791583166,12.98196392785571,13.016032064128256,13.050100200400802,13.084168336673347,13.118236472945892,13.152304609218437,13.186372745490981,13.220440881763528,13.254509018036073,13.288577154308618,13.322645290581162,13.356713426853707,13.390781563126252,13.424849699398798,13.458917835671343,13.492985971943888,13.527054108216433,13.561122244488978,13.595190380761522,13.629258517034069,13.663326653306614,13.697394789579159,13.731462925851703,13.765531062124248,13.799599198396793,13.83366733466934,13.867735470941884,13.901803607214429,13.935871743486974,13.969939879759519,14.004008016032063,14.03807615230461,14.072144288577155,14.1062124248497,14.140280561122244,14.17434869739479,14.208416833667334,14.24248496993988,14.276553106212425,14.31062124248497,14.344689378757515,14.37875751503006,14.412825651302605,14.446893787575151,14.480961923847696,14.51503006012024,14.549098196392785,14.58316633266533,14.617234468937875,14.651302605210422,14.685370741482966,14.719438877755511,14.753507014028056,14.7875751503006,14.821643286573146,14.855711422845692,14.889779559118237,14.923847695390782,14.957915831663327,14.991983967935871,15.026052104208416,15.060120240480963,15.094188376753507,15.128256513026052,15.162324649298597,15.196392785571142,15.230460921843687,15.264529058116233,15.298597194388778,15.332665330661323,15.366733466933868,15.400801603206412,15.434869739478957,15.468937875751504,15.503006012024048,15.537074148296593,15.571142284569138,15.605210420841683,15.639278557114228,15.673346693386774,15.707414829659319,15.741482965931864,15.775551102204409,15.809619238476953,15.843687374749498,15.877755511022045,15.91182364729459,15.945891783567134,15.97995991983968,16.014028056112224,16.04809619238477,16.082164328657313,16.11623246492986,16.150300601202403,16.18436873747495,16.218436873747496,16.25250501002004,16.286573146292586,16.32064128256513,16.354709418837675,16.38877755511022,16.422845691382765,16.45691382765531,16.490981963927855,16.5250501002004,16.559118236472944,16.593186372745492,16.627254509018037,16.661322645290582,16.695390781563127,16.72945891783567,16.763527054108216,16.79759519038076,16.831663326653306,16.86573146292585,16.899799599198396,16.93386773547094,16.96793587174349,17.002004008016034,17.03607214428858,17.070140280561123,17.104208416833668,17.138276553106213,17.172344689378757,17.206412825651302,17.240480961923847,17.274549098196392,17.308617234468937,17.34268537074148,17.37675350701403,17.410821643286575,17.44488977955912,17.478957915831664,17.51302605210421,17.547094188376754,17.5811623246493,17.615230460921843,17.649298597194388,17.683366733466933,17.717434869739478,17.751503006012022,17.78557114228457,17.819639278557116,17.85370741482966,17.887775551102205,17.92184368737475,17.955911823647295,17.98997995991984,18.024048096192384,18.05811623246493,18.092184368737474,18.12625250501002,18.160320641282564,18.194388777555112,18.228456913827657,18.2625250501002,18.296593186372746,18.33066132264529,18.364729458917836,18.39879759519038,18.432865731462925,18.46693386773547,18.501002004008015,18.53507014028056,18.569138276553105,18.603206412825653,18.637274549098198,18.671342685370742,18.705410821643287,18.739478957915832,18.773547094188377,18.80761523046092,18.841683366733466,18.87575150300601,18.909819639278556,18.9438877755511,18.977955911823646,19.012024048096194,19.04609218436874,19.080160320641284,19.11422845691383,19.148296593186373,19.182364729458918,19.216432865731463,19.250501002004007,19.284569138276552,19.318637274549097,19.352705410821642,19.386773547094187,19.420841683366735,19.45490981963928,19.488977955911825,19.52304609218437,19.557114228456914,19.59118236472946,19.625250501002004,19.65931863727455,19.693386773547093,19.727454909819638,19.761523046092183,19.795591182364728,19.829659318637276,19.86372745490982,19.897795591182366,19.93186372745491,19.965931863727455,20.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/runner.jl new file mode 100644 index 000000000000..82123064f208 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/runner.jl @@ -0,0 +1,94 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import JSON + +""" + gen( x, filepath ) + +Generate fixture data and write to file. + +# Arguments + +* `x`: domain +* `filepath::AbstractString`: filepath of the output file + +# Examples + +``` julia +julia> x = range( 0, stop = 1000, length = 2001 ); +julia> gen( x, \"./data.json\" ); +``` +""" +function gen( x, filepath ) + y = Array{Float32}( undef, length(x) ); + for i in eachindex(x) + y[i] = log2( x[i] ); + end + + data = Dict([ + ("x", x), + ("expected", y) + ]); + + outfile = open( filepath, "w" ); + write( outfile, JSON.json(data) ); + write( outfile, "\n" ); + close( outfile ); +end + +# Get the filename: +file = @__FILE__; + +# Extract the directory in which this file resides: +dir = dirname( file ); + +# Subnormal values: +x = range( 1.0e-39, stop = 1.40129846e-45, length = 500 ); +out = joinpath( dir, "subnormal.json" ); +gen( x, out ); + +# Positive tiny values: +x = range( 1.0e-30, stop = 1.0e-38, length = 500 ); +out = joinpath( dir, "tiny_positive.json" ); +gen( x, out ); + +# Small(er) values: +x = range( 1.0e-30, stop = 0.8, length = 500 ); +out = joinpath( dir, "smaller.json" ); +gen( x, out ); + +# Positive small values: +x = range( 0.8, stop = 3.0, length = 500 ); +out = joinpath( dir, "small_positive.json" ); +gen( x, out ); + +# Positive medium values: +x = range( 3.0, stop = 20.0, length = 500 ); +out = joinpath( dir, "medium_positive.json" ); +gen( x, out ); + +# Large positive values: +x = range( 20.0, stop = 50.0, length = 500 ); +out = joinpath( dir, "large_positive.json" ); +gen( x, out ); + +# Very large positive values: +x = range( 50.0, stop = 500.0, length = 500 ); +out = joinpath( dir, "very_large_positive.json" ); +gen( x, out ); diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/small_positive.json b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/small_positive.json new file mode 100644 index 000000000000..66dc7ce88aa4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/small_positive.json @@ -0,0 +1 @@ +{"expected":[-0.32192808,-0.3139992,-0.30611363,-0.29827094,-0.29047066,-0.2827123,-0.27499548,-0.2673197,-0.25968453,-0.25208956,-0.24453437,-0.23701854,-0.22954166,-0.22210333,-0.21470316,-0.20734075,-0.20001571,-0.19272768,-0.18547629,-0.17826116,-0.17108193,-0.16393825,-0.15682977,-0.14975615,-0.14271705,-0.13571212,-0.12874103,-0.12180346,-0.1148991,-0.10802762,-0.10118872,-0.094382085,-0.087607406,-0.0808644,-0.07415275,-0.0674722,-0.060822427,-0.054203168,-0.04761414,-0.04105507,-0.03452568,-0.028025715,-0.0215549,-0.015112979,-0.008699695,-0.0023147939,0.004041974,0.010370855,0.016672095,0.022945931,0.029192604,0.035412345,0.041605387,0.047771957,0.053912282,0.060026582,0.06611508,0.07217799,0.07821553,0.084227905,0.09021533,0.09617801,0.102116145,0.10802994,0.11391959,0.119785294,0.12562725,0.13144565,0.13724066,0.14301251,0.14876135,0.15448736,0.16019075,0.16587166,0.17153032,0.17716685,0.18278144,0.18837428,0.19394551,0.19949533,0.20502385,0.2105313,0.21601778,0.22148348,0.22692855,0.23235315,0.23775743,0.24314155,0.24850564,0.25384986,0.25917435,0.26447928,0.26976475,0.27503094,0.28027797,0.285506,0.29071516,0.29590556,0.30107734,0.30623066,0.31136566,0.31648242,0.32158113,0.32666185,0.33172473,0.33676994,0.34179756,0.34680772,0.35180053,0.35677612,0.3617346,0.36667612,0.37160078,0.37650865,0.3813999,0.38627464,0.39113292,0.39597493,0.40080073,0.40561044,0.4104042,0.41518205,0.41994414,0.42469057,0.42942142,0.4341368,0.43883684,0.44352162,0.44819123,0.45284575,0.45748535,0.46211004,0.46671996,0.4713152,0.47589585,0.48046198,0.48501375,0.4895512,0.49407437,0.49858344,0.50307846,0.50755954,0.51202667,0.5164801,0.5209198,0.52534586,0.5297584,0.53415745,0.53854316,0.5429155,0.54727477,0.5516208,0.5559538,0.5602739,0.564581,0.5688753,0.5731569,0.5774258,0.5816821,0.5859259,0.5901573,0.5943762,0.59858286,0.6027773,0.6069596,0.6111298,0.61528796,0.6194342,0.62356853,0.62769103,0.63180184,0.6359009,0.6399884,0.64406437,0.6481288,0.6521818,0.65622354,0.6602539,0.6642731,0.6682811,0.6722779,0.6762638,0.68023866,0.6842026,0.6881557,0.69209796,0.6960295,0.69995034,0.7038606,0.7077602,0.7116494,0.7155281,0.71939635,0.7232543,0.727102,0.7309394,0.7347666,0.73858374,0.7423908,0.7461878,0.74997485,0.753752,0.7575193,0.7612767,0.7650244,0.76876247,0.7724908,0.7762095,0.7799187,0.78361833,0.7873085,0.7909893,0.7946607,0.7983228,0.8019756,0.8056192,0.8092536,0.81287885,0.81649506,0.8201022,0.82370037,0.8272896,0.83086985,0.8344413,0.8380039,0.84155774,0.84510285,0.84863925,0.852167,0.8556862,0.8591968,0.86269885,0.86619246,0.8696776,0.87315434,0.87662274,0.88008285,0.8835346,0.8869782,0.8904135,0.89384073,0.89725983,0.9006708,0.9040738,0.90746874,0.9108557,0.9142347,0.9176059,0.9209691,0.92432463,0.92767227,0.9310122,0.9343444,0.937669,0.94098586,0.9442951,0.94759685,0.950891,0.9541777,0.9574568,0.9607286,0.96399295,0.96724993,0.9704996,0.97374195,0.976977,0.9802048,0.9834255,0.9866389,0.9898452,0.99304444,0.99623656,0.99942166,1.0025997,1.0057708,1.0089349,1.0120921,1.0152425,1.0183859,1.0215224,1.0246522,1.0277753,1.0308915,1.0340011,1.037104,1.0402002,1.0432898,1.0463728,1.0494492,1.0525191,1.0555824,1.0586393,1.0616896,1.0647336,1.0677711,1.0708023,1.0738271,1.0768455,1.0798577,1.0828637,1.0858634,1.0888567,1.091844,1.094825,1.0977999,1.1007687,1.1037314,1.106688,1.1096386,1.1125832,1.1155217,1.1184542,1.1213809,1.1243016,1.1272165,1.1301253,1.1330284,1.1359257,1.1388171,1.1417028,1.1445826,1.1474568,1.1503252,1.153188,1.1560451,1.1588964,1.1617423,1.1645825,1.1674172,1.1702462,1.1730697,1.1758877,1.1787003,1.1815073,1.1843089,1.1871051,1.1898959,1.1926812,1.1954613,1.1982359,1.2010052,1.2037692,1.206528,1.2092814,1.2120297,1.2147727,1.2175105,1.2202431,1.2229705,1.2256929,1.22841,1.2311221,1.233829,1.236531,1.2392278,1.2419196,1.2446065,1.2472882,1.2499651,1.252637,1.255304,1.2579659,1.2606231,1.2632753,1.2659227,1.2685652,1.2712029,1.2738358,1.2764639,1.2790872,1.2817057,1.2843195,1.2869285,1.2895329,1.2921326,1.2947276,1.2973179,1.2999035,1.3024846,1.3050611,1.3076329,1.3102002,1.312763,1.3153211,1.3178748,1.320424,1.3229685,1.3255087,1.3280444,1.3305756,1.3331025,1.3356248,1.3381429,1.3406564,1.3431656,1.3456706,1.3481711,1.3506674,1.3531592,1.3556468,1.3581301,1.3606092,1.363084,1.3655546,1.3680209,1.370483,1.3729409,1.3753947,1.3778443,1.3802897,1.382731,1.3851682,1.3876013,1.3900303,1.3924551,1.3948759,1.3972926,1.3997054,1.402114,1.4045187,1.4069194,1.4093161,1.4117088,1.4140975,1.4164823,1.4188632,1.4212402,1.4236132,1.4259824,1.4283476,1.430709,1.4330665,1.4354202,1.43777,1.440116,1.4424583,1.4447967,1.4471313,1.4494622,1.4517893,1.4541125,1.4564322,1.4587481,1.4610603,1.4633688,1.4656736,1.4679747,1.4702721,1.4725659,1.474856,1.4771426,1.4794255,1.4817048,1.4839805,1.4862527,1.4885212,1.4907862,1.4930476,1.4953055,1.4975599,1.4998107,1.5020581,1.5043019,1.5065423,1.5087792,1.5110127,1.5132426,1.5154692,1.5176922,1.519912,1.5221282,1.5243411,1.5265507,1.5287567,1.5309595,1.5331588,1.5353549,1.5375476,1.539737,1.5419229,1.5441058,1.5462852,1.5484613,1.5506343,1.5528039,1.5549701,1.5571333,1.5592932,1.5614498,1.5636033,1.5657535,1.5679004,1.5700443,1.5721849,1.5743223,1.5764567,1.5785879,1.5807159,1.5828408,1.5849625],"x":[0.8,0.8044088176352705,0.8088176352705411,0.8132264529058116,0.8176352705410822,0.8220440881763527,0.8264529058116232,0.8308617234468938,0.8352705410821644,0.8396793587174348,0.8440881763527054,0.848496993987976,0.8529058116232465,0.857314629258517,0.8617234468937875,0.8661322645290581,0.8705410821643287,0.8749498997995993,0.8793587174348697,0.8837675350701403,0.8881763527054108,0.8925851703406814,0.8969939879759519,0.9014028056112224,0.905811623246493,0.9102204408817636,0.914629258517034,0.9190380761523046,0.9234468937875752,0.9278557114228457,0.9322645290581162,0.9366733466933868,0.9410821643286573,0.9454909819639279,0.9498997995991983,0.9543086172344689,0.9587174348697395,0.96312625250501,0.9675350701402805,0.9719438877755511,0.9763527054108216,0.9807615230460922,0.9851703406813628,0.9895791583166332,0.9939879759519038,0.9983967935871744,1.0028056112224448,1.0072144288577154,1.011623246492986,1.0160320641282565,1.020440881763527,1.0248496993987977,1.0292585170340682,1.0336673346693386,1.0380761523046091,1.0424849699398797,1.0468937875751503,1.0513026052104208,1.0557114228456914,1.060120240480962,1.0645290581162326,1.068937875751503,1.0733466933867735,1.077755511022044,1.0821643286573146,1.0865731462925852,1.0909819639278557,1.0953907815631263,1.0997995991983969,1.1042084168336674,1.1086172344689378,1.1130260521042084,1.117434869739479,1.1218436873747495,1.12625250501002,1.1306613226452906,1.1350701402805612,1.1394789579158318,1.143887775551102,1.1482965931863727,1.1527054108216432,1.1571142284569138,1.1615230460921844,1.165931863727455,1.1703406813627255,1.174749498997996,1.1791583166332664,1.183567134268537,1.1879759519038076,1.1923847695390781,1.1967935871743487,1.2012024048096193,1.2056112224448898,1.2100200400801604,1.214428857715431,1.2188376753507013,1.2232464929859719,1.2276553106212424,1.232064128256513,1.2364729458917836,1.2408817635270541,1.2452905811623247,1.2496993987975953,1.2541082164328656,1.2585170340681362,1.2629258517034068,1.2673346693386773,1.271743486973948,1.2761523046092185,1.280561122244489,1.2849699398797596,1.28937875751503,1.2937875751503005,1.298196392785571,1.3026052104208417,1.3070140280561122,1.3114228456913828,1.3158316633266534,1.320240480961924,1.3246492985971945,1.3290581162324648,1.3334669338677354,1.337875751503006,1.3422845691382765,1.346693386773547,1.3511022044088177,1.3555110220440882,1.3599198396793588,1.3643286573146292,1.3687374749498997,1.3731462925851703,1.3775551102204409,1.3819639278557114,1.386372745490982,1.3907815631262526,1.3951903807615231,1.3995991983967937,1.404008016032064,1.4084168336673346,1.4128256513026052,1.4172344689378757,1.4216432865731463,1.4260521042084169,1.4304609218436874,1.434869739478958,1.4392785571142284,1.443687374749499,1.4480961923847695,1.45250501002004,1.4569138276553106,1.4613226452905812,1.4657314629258518,1.4701402805611223,1.4745490981963927,1.4789579158316633,1.4833667334669338,1.4877755511022044,1.492184368737475,1.4965931863727455,1.501002004008016,1.5054108216432867,1.5098196392785572,1.5142284569138276,1.5186372745490981,1.5230460921843687,1.5274549098196393,1.5318637274549098,1.5362725450901804,1.540681362725451,1.5450901803607215,1.549498997995992,1.5539078156312625,1.558316633266533,1.5627254509018036,1.5671342685370742,1.5715430861723447,1.5759519038076153,1.5803607214428859,1.5847695390781562,1.5891783567134268,1.5935871743486973,1.597995991983968,1.6024048096192385,1.606813627254509,1.6112224448897796,1.6156312625250502,1.6200400801603208,1.624448897795591,1.6288577154308617,1.6332665330661322,1.6376753507014028,1.6420841683366734,1.646492985971944,1.6509018036072145,1.655310621242485,1.6597194388777554,1.664128256513026,1.6685370741482966,1.6729458917835671,1.6773547094188377,1.6817635270541083,1.6861723446893788,1.6905811623246494,1.6949899799599197,1.6993987975951903,1.7038076152304609,1.7082164328657314,1.712625250501002,1.7170340681362726,1.7214428857715431,1.7258517034068137,1.7302605210420843,1.7346693386773546,1.7390781563126252,1.7434869739478958,1.7478957915831663,1.752304609218437,1.7567134268537075,1.761122244488978,1.7655310621242486,1.769939879759519,1.7743486973947895,1.77875751503006,1.7831663326653306,1.7875751503006012,1.7919839679358718,1.7963927855711423,1.800801603206413,1.8052104208416833,1.8096192384769538,1.8140280561122244,1.818436873747495,1.8228456913827655,1.827254509018036,1.8316633266533067,1.8360721442885772,1.8404809619238478,1.8448897795591181,1.8492985971943887,1.8537074148296593,1.8581162324649299,1.8625250501002004,1.866933867735471,1.8713426853707416,1.8757515030060121,1.8801603206412825,1.884569138276553,1.8889779559118236,1.8933867735470942,1.8977955911823647,1.9022044088176353,1.9066132264529059,1.9110220440881764,1.9154308617234468,1.9198396793587174,1.924248496993988,1.9286573146292585,1.933066132264529,1.9374749498997996,1.9418837675350702,1.9462925851703408,1.9507014028056113,1.9551102204408817,1.9595190380761522,1.9639278557114228,1.9683366733466934,1.972745490981964,1.9771543086172345,1.981563126252505,1.9859719438877756,1.990380761523046,1.9947895791583166,1.9991983967935871,2.003607214428858,2.0080160320641283,2.0124248496993986,2.0168336673346694,2.0212424849699397,2.0256513026052105,2.030060120240481,2.0344689378757517,2.038877755511022,2.043286573146293,2.047695390781563,2.0521042084168335,2.0565130260521043,2.0609218436873746,2.0653306613226454,2.0697394789579158,2.0741482965931866,2.078557114228457,2.0829659318637272,2.087374749498998,2.0917835671342684,2.096192384769539,2.1006012024048095,2.1050100200400803,2.1094188376753507,2.1138276553106214,2.118236472945892,2.122645290581162,2.127054108216433,2.1314629258517033,2.135871743486974,2.1402805611222444,2.144689378757515,2.1490981963927855,2.1535070140280563,2.1579158316633267,2.162324649298597,2.166733466933868,2.171142284569138,2.175551102204409,2.1799599198396793,2.18436873747495,2.1887775551102204,2.1931863727454908,2.1975951903807616,2.202004008016032,2.2064128256513027,2.210821643286573,2.215230460921844,2.219639278557114,2.224048096192385,2.2284569138276553,2.2328657314629257,2.2372745490981965,2.241683366733467,2.2460921843687376,2.250501002004008,2.2549098196392787,2.259318637274549,2.26372745490982,2.26813627254509,2.2725450901803605,2.2769539078156313,2.2813627254509017,2.2857715430861725,2.290180360721443,2.2945891783567136,2.298997995991984,2.3034068136272543,2.307815631262525,2.3122244488977954,2.3166332665330662,2.3210420841683366,2.3254509018036074,2.3298597194388777,2.3342685370741485,2.338677354709419,2.343086172344689,2.34749498997996,2.3519038076152303,2.356312625250501,2.3607214428857715,2.3651302605210422,2.3695390781563126,2.3739478957915834,2.3783567134268537,2.382765531062124,2.387174348697395,2.391583166332665,2.395991983967936,2.4004008016032063,2.404809619238477,2.4092184368737475,2.413627254509018,2.4180360721442886,2.422444889779559,2.4268537074148298,2.4312625250501,2.435671342685371,2.4400801603206412,2.444488977955912,2.4488977955911824,2.4533066132264527,2.4577154308617235,2.462124248496994,2.4665330661322646,2.470941883767535,2.4753507014028058,2.479759519038076,2.484168336673347,2.4885771543086173,2.4929859719438876,2.4973947895791584,2.5018036072144287,2.5062124248496995,2.51062124248497,2.5150300601202407,2.519438877755511,2.5238476953907814,2.528256513026052,2.5326653306613225,2.5370741482965933,2.5414829659318636,2.5458917835671344,2.5503006012024048,2.5547094188376755,2.559118236472946,2.5635270541082162,2.567935871743487,2.5723446893787574,2.576753507014028,2.5811623246492985,2.5855711422845693,2.5899799599198396,2.5943887775551104,2.598797595190381,2.603206412825651,2.607615230460922,2.6120240480961923,2.616432865731463,2.6208416833667334,2.625250501002004,2.6296593186372745,2.634068136272545,2.6384769539078157,2.642885771543086,2.647294589178357,2.651703406813627,2.656112224448898,2.6605210420841683,2.664929859719439,2.6693386773547094,2.6737474949899798,2.6781563126252506,2.682565130260521,2.6869739478957917,2.691382765531062,2.695791583166333,2.700200400801603,2.704609218436874,2.7090180360721443,2.7134268537074147,2.7178356713426854,2.722244488977956,2.7266533066132266,2.731062124248497,2.7354709418837677,2.739879759519038,2.7442885771543084,2.748697394789579,2.7531062124248495,2.7575150300601203,2.7619238476953907,2.7663326653306615,2.770741482965932,2.7751503006012026,2.779559118236473,2.7839679358717433,2.788376753507014,2.7927855711422844,2.797194388777555,2.8016032064128256,2.8060120240480964,2.8104208416833667,2.8148296593186375,2.819238476953908,2.823647294589178,2.828056112224449,2.8324649298597193,2.83687374749499,2.8412825651302605,2.8456913827655312,2.8501002004008016,2.854509018036072,2.8589178356713427,2.863326653306613,2.867735470941884,2.872144288577154,2.876553106212425,2.8809619238476953,2.885370741482966,2.8897795591182365,2.894188376753507,2.8985971943887776,2.903006012024048,2.9074148296593187,2.911823647294589,2.91623246492986,2.9206412825651302,2.925050100200401,2.9294589178356714,2.9338677354709417,2.9382765531062125,2.942685370741483,2.9470941883767536,2.951503006012024,2.9559118236472948,2.960320641282565,2.9647294589178355,2.9691382765531062,2.9735470941883766,2.9779559118236474,2.9823647294589177,2.9867735470941885,2.991182364729459,2.9955911823647297,3.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/smaller.json b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/smaller.json new file mode 100644 index 000000000000..bb3fc8479989 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/smaller.json @@ -0,0 +1 @@ +{"expected":[-99.657845,-9.284824,-8.284824,-7.6998615,-7.284824,-6.962896,-6.6998615,-6.477469,-6.284824,-6.114899,-5.962896,-5.8253922,-5.6998615,-5.5843844,-5.477469,-5.3779335,-5.284824,-5.1973615,-5.114899,-5.0368967,-4.962896,-4.8925066,-4.8253922,-4.761262,-4.6998615,-4.640968,-4.5843844,-4.529937,-4.477469,-4.426843,-4.3779335,-4.330628,-4.284824,-4.24043,-4.1973615,-4.155541,-4.114899,-4.075371,-4.0368967,-3.9994218,-3.962896,-3.927272,-3.8925066,-3.8585594,-3.8253925,-3.792971,-3.7612622,-3.7302353,-3.6998615,-3.6701143,-3.6409678,-3.6123989,-3.5843844,-3.5569036,-3.5299366,-3.5034645,-3.4774692,-3.451934,-3.4268432,-3.4021811,-3.3779335,-3.3540869,-3.3306277,-3.3075442,-3.2848241,-3.2624562,-3.2404299,-3.218735,-3.1973612,-3.1762996,-3.1555412,-3.135077,-3.1148992,-3.0949996,-3.0753708,-3.0560055,-3.0368967,-3.0180376,-2.9994218,-2.9810433,-2.962896,-2.9449742,-2.927272,-2.9097846,-2.8925066,-2.8754332,-2.8585594,-2.8418806,-2.8253925,-2.8090906,-2.792971,-2.7770295,-2.7612622,-2.7456653,-2.7302353,-2.7149684,-2.6998615,-2.6849113,-2.6701143,-2.6554675,-2.6409678,-2.6266127,-2.6123989,-2.5983236,-2.5843844,-2.5705786,-2.5569036,-2.5433571,-2.5299366,-2.5166397,-2.5034645,-2.4904082,-2.4774692,-2.4646451,-2.451934,-2.4393342,-2.4268432,-2.4144595,-2.4021811,-2.3900063,-2.3779335,-2.3659608,-2.3540869,-2.3423097,-2.3306277,-2.3190398,-2.3075442,-2.2961395,-2.2848241,-2.2735968,-2.2624562,-2.2514012,-2.2404299,-2.2295418,-2.218735,-2.2080085,-2.1973612,-2.1867921,-2.1762996,-2.165883,-2.1555412,-2.1452727,-2.135077,-2.1249528,-2.1148992,-2.104915,-2.0949996,-2.0851517,-2.0753708,-2.0656555,-2.0560055,-2.0464194,-2.0368967,-2.0274363,-2.0180376,-2.0086997,-1.9994218,-1.9902034,-1.9810433,-1.9719411,-1.962896,-1.9539073,-1.9449741,-1.936096,-1.9272721,-1.9185019,-1.9097847,-1.9011198,-1.8925067,-1.8839446,-1.8754332,-1.8669716,-1.8585594,-1.8501959,-1.8418806,-1.833613,-1.8253925,-1.8172185,-1.8090906,-1.8010083,-1.792971,-1.7849783,-1.7770295,-1.7691243,-1.7612622,-1.7534426,-1.7456653,-1.7379296,-1.7302352,-1.7225816,-1.7149684,-1.7073953,-1.6998616,-1.6923671,-1.6849113,-1.6774938,-1.6701143,-1.6627723,-1.6554675,-1.6481994,-1.640968,-1.6337724,-1.6266127,-1.6194882,-1.6123987,-1.605344,-1.5983236,-1.5913371,-1.5843844,-1.5774649,-1.5705786,-1.5637249,-1.5569036,-1.5501145,-1.5433571,-1.5366312,-1.5299366,-1.5232729,-1.5166398,-1.5100371,-1.5034643,-1.4969215,-1.4904082,-1.4839242,-1.4774692,-1.4710429,-1.4646451,-1.4582756,-1.4519341,-1.4456203,-1.439334,-1.4330751,-1.426843,-1.420638,-1.4144593,-1.4083072,-1.402181,-1.3960809,-1.3900063,-1.3839573,-1.3779335,-1.3719348,-1.3659608,-1.3600116,-1.3540868,-1.3481861,-1.3423096,-1.3364569,-1.3306278,-1.3248222,-1.3190398,-1.3132806,-1.3075442,-1.3018305,-1.2961394,-1.2904707,-1.2848241,-1.2791996,-1.2735969,-1.2680159,-1.2624563,-1.2569181,-1.2514011,-1.2459052,-1.24043,-1.2349756,-1.2295417,-1.2241281,-1.2187349,-1.2133617,-1.2080085,-1.2026751,-1.1973612,-1.1920669,-1.186792,-1.1815363,-1.1762997,-1.1710819,-1.1658831,-1.1607028,-1.1555411,-1.1503978,-1.1452727,-1.1401658,-1.135077,-1.130006,-1.1249528,-1.1199172,-1.114899,-1.1098984,-1.104915,-1.0999488,-1.0949996,-1.0900673,-1.0851518,-1.080253,-1.0753708,-1.070505,-1.0656556,-1.0608224,-1.0560054,-1.0512044,-1.0464194,-1.0416502,-1.0368966,-1.0321586,-1.0274363,-1.0227293,-1.0180376,-1.0133611,-1.0086997,-1.0040534,-0.9994219,-0.9948053,-0.9902034,-0.9856161,-0.98104334,-0.9764851,-0.9719412,-0.96741146,-0.962896,-0.9583946,-0.95390725,-0.94943374,-0.9449741,-0.9405282,-0.93609595,-0.9316773,-0.9272721,-0.92288035,-0.9185019,-0.9141367,-0.9097847,-0.90544575,-0.9011198,-0.89680684,-0.89250666,-0.8882193,-0.8839447,-0.87968266,-0.87543315,-0.87119615,-0.8669716,-0.86275935,-0.85855937,-0.85437155,-0.8501959,-0.84603226,-0.8418806,-0.8377409,-0.833613,-0.82949686,-0.8253925,-0.82129973,-0.81721854,-0.81314886,-0.8090907,-0.8050438,-0.80100834,-0.7969841,-0.792971,-0.7889691,-0.7849782,-0.78099835,-0.77702945,-0.77307147,-0.76912427,-0.76518786,-0.7612621,-0.7573471,-0.75344265,-0.74954873,-0.7456653,-0.74179226,-0.73792964,-0.73407733,-0.7302352,-0.7264034,-0.7225817,-0.7187701,-0.7149685,-0.71117693,-0.70739526,-0.70362353,-0.6998616,-0.6961095,-0.6923671,-0.68863434,-0.68491125,-0.68119776,-0.6774938,-0.6737993,-0.6701143,-0.6664386,-0.6627723,-0.65911525,-0.65546745,-0.6518289,-0.6481995,-0.6445792,-0.6409679,-0.6373657,-0.63377243,-0.63018805,-0.6266126,-0.623046,-0.6194882,-0.61593914,-0.61239874,-0.60886705,-0.605344,-0.6018295,-0.5983236,-0.5948261,-0.59133714,-0.5878566,-0.5843844,-0.5809205,-0.577465,-0.57401764,-0.5705786,-0.5671477,-0.56372494,-0.56031024,-0.55690366,-0.55350506,-0.55011445,-0.5467318,-0.54335713,-0.53999025,-0.5366312,-0.53328,-0.5299366,-0.5266009,-0.5232729,-0.51995254,-0.51663977,-0.51333463,-0.51003706,-0.50674695,-0.5034644,-0.50018924,-0.49692154,-0.49366122,-0.49040824,-0.48716256,-0.4839242,-0.48069307,-0.47746918,-0.47425246,-0.4710429,-0.46784046,-0.46464515,-0.46145687,-0.45827562,-0.45510137,-0.4519341,-0.44877374,-0.4456203,-0.44247377,-0.43933403,-0.43620116,-0.43307507,-0.42995572,-0.4268431,-0.4237372,-0.42063797,-0.41754535,-0.41445938,-0.41138,-0.40830716,-0.40524086,-0.40218106,-0.39912772,-0.39608085,-0.3930404,-0.39000633,-0.38697866,-0.3839573,-0.38094226,-0.3779335,-0.374931,-0.37193477,-0.36894473,-0.36596087,-0.36298317,-0.3600116,-0.35704613,-0.35408676,-0.35113344,-0.34818617,-0.34524488,-0.3423096,-0.33938026,-0.33645687,-0.3335394,-0.3306278,-0.32772207,-0.32482216,-0.32192808],"x":[1.0e-30,0.0016032064128256513,0.0032064128256513026,0.0048096192384769546,0.006412825651302605,0.008016032064128258,0.009619238476953909,0.011222444889779559,0.01282565130260521,0.014428857715430862,0.016032064128256515,0.017635270541082167,0.019238476953907818,0.02084168336673347,0.022444889779559118,0.02404809619238477,0.02565130260521042,0.027254509018036072,0.028857715430861724,0.030460921843687375,0.03206412825651303,0.03366733466933868,0.03527054108216433,0.036873747494989985,0.038476953907815636,0.04008016032064129,0.04168336673346694,0.04328657314629259,0.044889779559118236,0.04649298597194389,0.04809619238476954,0.04969939879759519,0.05130260521042084,0.05290581162324649,0.054509018036072145,0.056112224448897796,0.05771543086172345,0.0593186372745491,0.06092184368737475,0.0625250501002004,0.06412825651302606,0.0657314629258517,0.06733466933867736,0.06893787575150301,0.07054108216432867,0.07214428857715431,0.07374749498997997,0.07535070140280561,0.07695390781563127,0.07855711422845692,0.08016032064128258,0.08176352705410822,0.08336673346693388,0.08496993987975952,0.08657314629258518,0.08817635270541083,0.08977955911823647,0.09138276553106213,0.09298597194388777,0.09458917835671343,0.09619238476953908,0.09779559118236474,0.09939879759519038,0.10100200400801604,0.10260521042084168,0.10420841683366734,0.10581162324649299,0.10741482965931864,0.10901803607214429,0.11062124248496995,0.11222444889779559,0.11382765531062125,0.1154308617234469,0.11703406813627255,0.1186372745490982,0.12024048096192386,0.1218436873747495,0.12344689378757516,0.1250501002004008,0.12665330661322646,0.12825651302605212,0.12985971943887775,0.1314629258517034,0.13306613226452907,0.13466933867735473,0.13627254509018036,0.13787575150300602,0.13947895791583168,0.14108216432865733,0.14268537074148296,0.14428857715430862,0.14589178356713428,0.14749498997995994,0.14909819639278557,0.15070140280561123,0.1523046092184369,0.15390781563126255,0.15551102204408818,0.15711422845691383,0.1587174348697395,0.16032064128256515,0.16192384769539078,0.16352705410821644,0.1651302605210421,0.16673346693386776,0.1683366733466934,0.16993987975951905,0.1715430861723447,0.17314629258517036,0.174749498997996,0.17635270541082165,0.1779559118236473,0.17955911823647294,0.1811623246492986,0.18276553106212426,0.18436873747494992,0.18597194388777555,0.1875751503006012,0.18917835671342687,0.19078156312625252,0.19238476953907815,0.1939879759519038,0.19559118236472947,0.19719438877755513,0.19879759519038076,0.20040080160320642,0.20200400801603208,0.20360721442885774,0.20521042084168337,0.20681362725450902,0.20841683366733468,0.21002004008016034,0.21162324649298597,0.21322645290581163,0.2148296593186373,0.21643286573146295,0.21803607214428858,0.21963927855711424,0.2212424849699399,0.22284569138276555,0.22444889779559118,0.22605210420841684,0.2276553106212425,0.22925851703406816,0.2308617234468938,0.23246492985971945,0.2340681362725451,0.23567134268537077,0.2372745490981964,0.23887775551102206,0.2404809619238477,0.24208416833667337,0.243687374749499,0.24529058116232466,0.24689378757515032,0.24849699398797598,0.2501002004008016,0.2517034068136273,0.2533066132264529,0.25490981963927856,0.25651302605210424,0.2581162324649299,0.2597194388777555,0.2613226452905812,0.2629258517034068,0.2645290581162325,0.26613226452905814,0.26773547094188377,0.26933867735470945,0.2709418837675351,0.2725450901803607,0.2741482965931864,0.27575150300601203,0.27735470941883766,0.27895791583166335,0.280561122244489,0.28216432865731467,0.2837675350701403,0.28537074148296593,0.2869739478957916,0.28857715430861725,0.2901803607214429,0.29178356713426856,0.2933867735470942,0.2949899799599199,0.2965931863727455,0.29819639278557114,0.2997995991983968,0.30140280561122246,0.3030060120240481,0.3046092184368738,0.3062124248496994,0.3078156312625251,0.3094188376753507,0.31102204408817635,0.31262525050100204,0.31422845691382767,0.3158316633266533,0.317434869739479,0.3190380761523046,0.3206412825651303,0.32224448897795593,0.32384769539078156,0.32545090180360725,0.3270541082164329,0.3286573146292585,0.3302605210420842,0.33186372745490983,0.3334669338677355,0.33507014028056115,0.3366733466933868,0.33827655310621246,0.3398797595190381,0.3414829659318637,0.3430861723446894,0.34468937875751504,0.3462925851703407,0.34789579158316636,0.349498997995992,0.3511022044088177,0.3527054108216433,0.35430861723446894,0.3559118236472946,0.35751503006012025,0.3591182364729459,0.36072144288577157,0.3623246492985972,0.3639278557114229,0.3655310621242485,0.36713426853707415,0.36873747494989983,0.37034068136272547,0.3719438877755511,0.3735470941883768,0.3751503006012024,0.3767535070140281,0.37835671342685373,0.37995991983967936,0.38156312625250505,0.3831663326653307,0.3847695390781563,0.386372745490982,0.3879759519038076,0.3895791583166333,0.39118236472945894,0.3927855711422846,0.39438877755511026,0.3959919839679359,0.3975951903807615,0.3991983967935872,0.40080160320641284,0.4024048096192385,0.40400801603206415,0.4056112224448898,0.40721442885771547,0.4088176352705411,0.41042084168336673,0.4120240480961924,0.41362725450901805,0.41523046092184374,0.41683366733466937,0.418436873747495,0.4200400801603207,0.4216432865731463,0.42324649298597194,0.42484969939879763,0.42645290581162326,0.42805611222444895,0.4296593186372746,0.4312625250501002,0.4328657314629259,0.4344689378757515,0.43607214428857716,0.43767535070140284,0.4392785571142285,0.44088176352705416,0.4424849699398798,0.4440881763527054,0.4456913827655311,0.44729458917835674,0.44889779559118237,0.45050100200400806,0.4521042084168337,0.4537074148296593,0.455310621242485,0.45691382765531063,0.4585170340681363,0.46012024048096195,0.4617234468937876,0.46332665330661327,0.4649298597194389,0.46653306613226453,0.4681362725450902,0.46973947895791585,0.47134268537074153,0.47294589178356716,0.4745490981963928,0.4761523046092185,0.4777555110220441,0.47935871743486974,0.4809619238476954,0.48256513026052106,0.48416833667334674,0.4857715430861724,0.487374749498998,0.4889779559118237,0.4905811623246493,0.49218436873747495,0.49378757515030064,0.49539078156312627,0.49699398797595196,0.4985971943887776,0.5002004008016032,0.5018036072144288,0.5034068136272546,0.5050100200400802,0.5066132264529059,0.5082164328657315,0.5098196392785571,0.5114228456913827,0.5130260521042085,0.5146292585170341,0.5162324649298597,0.5178356713426854,0.519438877755511,0.5210420841683367,0.5226452905811624,0.524248496993988,0.5258517034068136,0.5274549098196393,0.529058116232465,0.5306613226452906,0.5322645290581163,0.5338677354709419,0.5354709418837675,0.5370741482965932,0.5386773547094189,0.5402805611222445,0.5418837675350702,0.5434869739478958,0.5450901803607214,0.5466933867735472,0.5482965931863728,0.5498997995991984,0.5515030060120241,0.5531062124248497,0.5547094188376753,0.5563126252505011,0.5579158316633267,0.5595190380761523,0.561122244488978,0.5627254509018036,0.5643286573146293,0.565931863727455,0.5675350701402806,0.5691382765531062,0.5707414829659319,0.5723446893787576,0.5739478957915832,0.5755511022044089,0.5771543086172345,0.5787575150300601,0.5803607214428858,0.5819639278557115,0.5835671342685371,0.5851703406813628,0.5867735470941884,0.588376753507014,0.5899799599198398,0.5915831663326654,0.593186372745491,0.5947895791583167,0.5963927855711423,0.597995991983968,0.5995991983967937,0.6012024048096193,0.6028056112224449,0.6044088176352705,0.6060120240480962,0.6076152304609219,0.6092184368737475,0.6108216432865732,0.6124248496993988,0.6140280561122244,0.6156312625250502,0.6172344689378758,0.6188376753507014,0.6204408817635271,0.6220440881763527,0.6236472945891783,0.6252505010020041,0.6268537074148297,0.6284569138276553,0.630060120240481,0.6316633266533066,0.6332665330661323,0.634869739478958,0.6364729458917836,0.6380761523046092,0.6396793587174349,0.6412825651302606,0.6428857715430862,0.6444889779559119,0.6460921843687375,0.6476953907815631,0.6492985971943888,0.6509018036072145,0.6525050100200401,0.6541082164328658,0.6557114228456914,0.657314629258517,0.6589178356713428,0.6605210420841684,0.662124248496994,0.6637274549098197,0.6653306613226453,0.666933867735471,0.6685370741482967,0.6701402805611223,0.6717434869739479,0.6733466933867736,0.6749498997995992,0.6765531062124249,0.6781563126252506,0.6797595190380762,0.6813627254509018,0.6829659318637274,0.6845691382765532,0.6861723446893788,0.6877755511022045,0.6893787575150301,0.6909819639278557,0.6925851703406815,0.6941883767535071,0.6957915831663327,0.6973947895791583,0.698997995991984,0.7006012024048096,0.7022044088176354,0.703807615230461,0.7054108216432866,0.7070140280561122,0.7086172344689379,0.7102204408817636,0.7118236472945892,0.7134268537074149,0.7150300601202405,0.7166332665330661,0.7182364729458918,0.7198396793587175,0.7214428857715431,0.7230460921843688,0.7246492985971944,0.72625250501002,0.7278557114228458,0.7294589178356714,0.731062124248497,0.7326653306613227,0.7342685370741483,0.735871743486974,0.7374749498997997,0.7390781563126253,0.7406813627254509,0.7422845691382766,0.7438877755511022,0.7454909819639279,0.7470941883767536,0.7486973947895792,0.7503006012024048,0.7519038076152305,0.7535070140280562,0.7551102204408818,0.7567134268537075,0.7583166332665331,0.7599198396793587,0.7615230460921845,0.7631262525050101,0.7647294589178357,0.7663326653306614,0.767935871743487,0.7695390781563126,0.7711422845691384,0.772745490981964,0.7743486973947896,0.7759519038076153,0.7775551102204409,0.7791583166332666,0.7807615230460923,0.7823647294589179,0.7839679358717435,0.7855711422845691,0.7871743486973949,0.7887775551102205,0.7903807615230461,0.7919839679358718,0.7935871743486974,0.795190380761523,0.7967935871743488,0.7983967935871744,0.8]} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/subnormal.json b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/subnormal.json new file mode 100644 index 000000000000..c5d419cc4532 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/subnormal.json @@ -0,0 +1 @@ +{"expected":[-129.55519,-129.55809,-129.56099,-129.56389,-129.5668,-129.56972,-129.57265,-129.57558,-129.5785,-129.58145,-129.5844,-129.58736,-129.59032,-129.59328,-129.59625,-129.59923,-129.60222,-129.60521,-129.6082,-129.6112,-129.61421,-129.61722,-129.62024,-129.62328,-129.62631,-129.62935,-129.6324,-129.63545,-129.6385,-129.64157,-129.64465,-129.64772,-129.65082,-129.6539,-129.657,-129.66011,-129.66322,-129.66634,-129.66946,-129.6726,-129.67574,-129.6789,-129.68204,-129.6852,-129.68837,-129.69154,-129.69472,-129.6979,-129.70111,-129.70432,-129.70752,-129.71074,-129.71396,-129.7172,-129.72043,-129.72368,-129.72693,-129.7302,-129.73346,-129.73672,-129.74002,-129.7433,-129.7466,-129.74991,-129.75322,-129.75655,-129.75987,-129.7632,-129.76654,-129.7699,-129.77325,-129.77663,-129.78,-129.78339,-129.78677,-129.79018,-129.79358,-129.797,-129.80042,-129.80385,-129.80728,-129.81073,-129.8142,-129.81766,-129.82112,-129.8246,-129.8281,-129.83159,-129.8351,-129.83861,-129.84213,-129.84567,-129.84921,-129.85275,-129.85631,-129.85988,-129.86345,-129.86703,-129.87064,-129.87424,-129.87785,-129.88147,-129.8851,-129.88873,-129.89238,-129.89604,-129.8997,-129.90338,-129.90707,-129.91077,-129.91446,-129.91818,-129.9219,-129.92563,-129.92938,-129.93314,-129.93689,-129.94066,-129.94444,-129.94824,-129.95204,-129.95584,-129.95967,-129.9635,-129.96735,-129.97119,-129.97505,-129.97893,-129.98282,-129.98671,-129.99062,-129.99452,-129.99846,-130.0024,-130.00633,-130.0103,-130.01427,-130.01825,-130.02223,-130.02625,-130.03026,-130.03427,-130.03831,-130.04236,-130.04642,-130.05049,-130.05457,-130.05865,-130.06276,-130.06688,-130.07101,-130.07515,-130.0793,-130.08347,-130.08763,-130.09183,-130.09602,-130.10023,-130.10446,-130.1087,-130.11295,-130.11722,-130.12149,-130.12578,-130.13007,-130.13438,-130.13872,-130.14305,-130.1474,-130.15176,-130.15614,-130.16054,-130.16495,-130.16936,-130.1738,-130.17824,-130.1827,-130.18718,-130.19167,-130.19617,-130.20068,-130.2052,-130.20975,-130.21431,-130.21889,-130.22346,-130.22807,-130.23268,-130.23732,-130.24196,-130.24663,-130.2513,-130.256,-130.2607,-130.26543,-130.27016,-130.27492,-130.27968,-130.28447,-130.28928,-130.29408,-130.29892,-130.30377,-130.30864,-130.31352,-130.31842,-130.32333,-130.32826,-130.33322,-130.33818,-130.34317,-130.34816,-130.35318,-130.35822,-130.36327,-130.36835,-130.37343,-130.37854,-130.38367,-130.38881,-130.39397,-130.39915,-130.40434,-130.40956,-130.4148,-130.42006,-130.42534,-130.43063,-130.43594,-130.44127,-130.44662,-130.452,-130.4574,-130.46281,-130.46825,-130.4737,-130.47917,-130.48466,-130.49019,-130.49573,-130.50128,-130.50687,-130.51247,-130.5181,-130.52374,-130.5294,-130.5351,-130.54082,-130.54654,-130.5523,-130.55809,-130.56389,-130.56972,-130.57558,-130.58145,-130.58736,-130.59328,-130.59923,-130.6052,-130.6112,-130.61722,-130.62328,-130.62935,-130.63545,-130.64157,-130.64772,-130.6539,-130.66011,-130.66634,-130.67259,-130.67888,-130.6852,-130.69154,-130.6979,-130.70432,-130.71074,-130.7172,-130.72368,-130.7302,-130.73672,-130.7433,-130.74991,-130.75653,-130.7632,-130.7699,-130.77663,-130.78339,-130.79016,-130.797,-130.80385,-130.81073,-130.81764,-130.8246,-130.83159,-130.83861,-130.84566,-130.85275,-130.85988,-130.86703,-130.87424,-130.88147,-130.88873,-130.89604,-130.90338,-130.91075,-130.91818,-130.92563,-130.93312,-130.94066,-130.94823,-130.95584,-130.9635,-130.97119,-130.97893,-130.98671,-130.99452,-131.0024,-131.0103,-131.01825,-131.02623,-131.03427,-131.04236,-131.05048,-131.05865,-131.06688,-131.07515,-131.08347,-131.09183,-131.10023,-131.1087,-131.1172,-131.12576,-131.13438,-131.14305,-131.15176,-131.16054,-131.16936,-131.17824,-131.18716,-131.19615,-131.2052,-131.21431,-131.22346,-131.23268,-131.24196,-131.2513,-131.2607,-131.27016,-131.27968,-131.28926,-131.29892,-131.30864,-131.31842,-131.32826,-131.33818,-131.34816,-131.35822,-131.36833,-131.37854,-131.38881,-131.39914,-131.40956,-131.42006,-131.43062,-131.44127,-131.452,-131.4628,-131.4737,-131.48466,-131.49571,-131.50685,-131.51808,-131.5294,-131.5408,-131.5523,-131.56389,-131.57558,-131.58734,-131.59923,-131.61119,-131.62326,-131.63544,-131.64772,-131.66011,-131.67259,-131.6852,-131.6979,-131.71072,-131.72366,-131.73672,-131.7499,-131.7632,-131.77661,-131.79016,-131.80383,-131.81764,-131.83159,-131.84566,-131.85988,-131.87422,-131.88873,-131.90337,-131.91817,-131.93312,-131.94823,-131.9635,-131.97893,-131.99452,-132.01028,-132.02623,-132.04234,-132.05865,-132.07513,-132.09181,-132.10869,-132.12576,-132.14304,-132.16052,-132.17824,-132.19615,-132.2143,-132.23268,-132.2513,-132.27016,-132.28926,-132.30862,-132.32826,-132.34816,-132.36833,-132.3888,-132.40956,-132.43062,-132.452,-132.47368,-132.49571,-132.51808,-132.5408,-132.56389,-132.58734,-132.61119,-132.63544,-132.6601,-132.68518,-132.71072,-132.73671,-132.76318,-132.79016,-132.81764,-132.84564,-132.87422,-132.90337,-132.9331,-132.96349,-132.9945,-133.02621,-133.05864,-133.09181,-133.12575,-133.16052,-133.19614,-133.23267,-133.27014,-133.30861,-133.34814,-133.38878,-133.4306,-133.47366,-133.51807,-133.56386,-133.61118,-133.66008,-133.71071,-133.76317,-133.81761,-133.87419,-133.93309,-133.99449,-134.05861,-134.12573,-134.19612,-134.27011,-134.34811,-134.43057,-134.51804,-134.61113,-134.71066,-134.81758,-134.93304,-135.05856,-135.19606,-135.34805,-135.51797,-135.7106,-135.93297,-136.19597,-136.51784,-136.9328,-137.5176,-138.51709,-149.0],"x":[1.0e-39,9.979959947921812e-40,9.959919895843624e-40,9.939879843765438e-40,9.919839791687251e-40,9.899799739609064e-40,9.879759687530876e-40,9.859719635452689e-40,9.839679583374501e-40,9.819639531296315e-40,9.799599479218128e-40,9.77955942713994e-40,9.759519375061753e-40,9.739479322983565e-40,9.71943927090538e-40,9.699399218827192e-40,9.679359166749005e-40,9.659319114670817e-40,9.63927906259263e-40,9.619239010514444e-40,9.599198958436256e-40,9.579158906358069e-40,9.559118854279881e-40,9.539078802201694e-40,9.519038750123506e-40,9.49899869804532e-40,9.478958645967133e-40,9.458918593888946e-40,9.438878541810758e-40,9.41883848973257e-40,9.398798437654385e-40,9.378758385576197e-40,9.35871833349801e-40,9.338678281419822e-40,9.318638229341635e-40,9.298598177263449e-40,9.278558125185261e-40,9.258518073107074e-40,9.238478021028887e-40,9.218437968950699e-40,9.198397916872512e-40,9.178357864794326e-40,9.158317812716138e-40,9.13827776063795e-40,9.118237708559763e-40,9.098197656481576e-40,9.07815760440339e-40,9.058117552325202e-40,9.038077500247015e-40,9.018037448168828e-40,8.99799739609064e-40,8.977957344012454e-40,8.957917291934267e-40,8.93787723985608e-40,8.917837187777892e-40,8.897797135699704e-40,8.877757083621517e-40,8.857717031543331e-40,8.837676979465143e-40,8.817636927386956e-40,8.797596875308769e-40,8.777556823230581e-40,8.757516771152395e-40,8.737476719074208e-40,8.71743666699602e-40,8.697396614917833e-40,8.677356562839645e-40,8.65731651076146e-40,8.637276458683272e-40,8.617236406605084e-40,8.597196354526897e-40,8.57715630244871e-40,8.557116250370522e-40,8.537076198292336e-40,8.517036146214149e-40,8.496996094135961e-40,8.476956042057774e-40,8.456915989979586e-40,8.4368759379014e-40,8.416835885823213e-40,8.396795833745025e-40,8.376755781666838e-40,8.35671572958865e-40,8.336675677510465e-40,8.316635625432277e-40,8.29659557335409e-40,8.276555521275902e-40,8.256515469197715e-40,8.236475417119527e-40,8.216435365041341e-40,8.196395312963154e-40,8.176355260884966e-40,8.156315208806779e-40,8.136275156728592e-40,8.116235104650406e-40,8.096195052572218e-40,8.07615500049403e-40,8.056114948415843e-40,8.036074896337656e-40,8.01603484425947e-40,7.995994792181282e-40,7.975954740103095e-40,7.955914688024907e-40,7.93587463594672e-40,7.915834583868533e-40,7.895794531790347e-40,7.87575447971216e-40,7.855714427633972e-40,7.835674375555784e-40,7.815634323477597e-40,7.795594271399411e-40,7.775554219321223e-40,7.755514167243036e-40,7.735474115164848e-40,7.715434063086661e-40,7.695394011008475e-40,7.675353958930288e-40,7.6553139068521e-40,7.635273854773913e-40,7.615233802695725e-40,7.595193750617538e-40,7.575153698539352e-40,7.555113646461164e-40,7.535073594382977e-40,7.51503354230479e-40,7.494993490226602e-40,7.474953438148416e-40,7.454913386070229e-40,7.434873333992041e-40,7.414833281913854e-40,7.394793229835666e-40,7.37475317775748e-40,7.354713125679293e-40,7.3346730736011054e-40,7.314633021522918e-40,7.294592969444731e-40,7.274552917366544e-40,7.254512865288356e-40,7.23447281321017e-40,7.214432761131982e-40,7.194392709053795e-40,7.174352656975608e-40,7.1543126048974206e-40,7.134272552819234e-40,7.1142325007410464e-40,7.094192448662859e-40,7.074152396584672e-40,7.054112344506485e-40,7.034072292428297e-40,7.014032240350111e-40,6.993992188271923e-40,6.9739521361937365e-40,6.953912084115549e-40,6.9338720320373616e-40,6.913831979959175e-40,6.8937919278809874e-40,6.8737518758028e-40,6.853711823724613e-40,6.833671771646426e-40,6.813631719568239e-40,6.793591667490052e-40,6.773551615411864e-40,6.7535115633336775e-40,6.73347151125549e-40,6.7134314591773026e-40,6.693391407099116e-40,6.6733513550209284e-40,6.653311302942742e-40,6.633271250864554e-40,6.613231198786367e-40,6.59319114670818e-40,6.573151094629993e-40,6.553111042551805e-40,6.5330709904736185e-40,6.513030938395431e-40,6.492990886317244e-40,6.472950834239057e-40,6.4529107821608694e-40,6.432870730082683e-40,6.412830678004495e-40,6.392790625926308e-40,6.372750573848121e-40,6.352710521769934e-40,6.332670469691747e-40,6.3126304176135595e-40,6.292590365535372e-40,6.272550313457185e-40,6.252510261378998e-40,6.2324702093008104e-40,6.212430157222624e-40,6.192390105144436e-40,6.17235005306625e-40,6.152310000988062e-40,6.132269948909875e-40,6.112229896831688e-40,6.0921898447535005e-40,6.072149792675313e-40,6.052109740597126e-40,6.032069688518939e-40,6.012029636440752e-40,5.991989584362565e-40,5.971949532284377e-40,5.951909480206191e-40,5.931869428128003e-40,5.911829376049816e-40,5.891789323971629e-40,5.8717492718934415e-40,5.851709219815255e-40,5.831669167737067e-40,5.81162911565888e-40,5.791589063580693e-40,5.771549011502506e-40,5.751508959424318e-40,5.731468907346132e-40,5.711428855267944e-40,5.6913888031897575e-40,5.67134875111157e-40,5.6513086990333825e-40,5.631268646955196e-40,5.611228594877008e-40,5.591188542798821e-40,5.571148490720634e-40,5.551108438642447e-40,5.53106838656426e-40,5.511028334486073e-40,5.490988282407885e-40,5.4709482303296985e-40,5.450908178251511e-40,5.4308681261733235e-40,5.410828074095137e-40,5.390788022016949e-40,5.370747969938763e-40,5.350707917860575e-40,5.330667865782388e-40,5.310627813704201e-40,5.290587761626014e-40,5.270547709547826e-40,5.2505076574696395e-40,5.230467605391452e-40,5.210427553313265e-40,5.190387501235078e-40,5.17034744915689e-40,5.150307397078704e-40,5.130267345000516e-40,5.110227292922329e-40,5.090187240844142e-40,5.070147188765955e-40,5.050107136687768e-40,5.0300670846095805e-40,5.010027032531393e-40,4.989986980453206e-40,4.969946928375019e-40,4.949906876296831e-40,4.929866824218645e-40,4.909826772140457e-40,4.8897867200622706e-40,4.869746667984083e-40,4.849706615905896e-40,4.829666563827709e-40,4.8096265117495215e-40,4.789586459671334e-40,4.769546407593147e-40,4.74950635551496e-40,4.729466303436773e-40,4.709426251358586e-40,4.689386199280398e-40,4.6693461472022116e-40,4.649306095124024e-40,4.629266043045837e-40,4.60922599096765e-40,4.5891859388894625e-40,4.569145886811276e-40,4.549105834733088e-40,4.529065782654901e-40,4.509025730576714e-40,4.488985678498527e-40,4.468945626420339e-40,4.4489055743421526e-40,4.428865522263965e-40,4.4088254701857784e-40,4.388785418107591e-40,4.3687453660294035e-40,4.348705313951217e-40,4.328665261873029e-40,4.308625209794842e-40,4.288585157716655e-40,4.268545105638468e-40,4.248505053560281e-40,4.2284650014820936e-40,4.208424949403906e-40,4.1883848973257194e-40,4.168344845247532e-40,4.1483047931693445e-40,4.128264741091158e-40,4.10822468901297e-40,4.088184636934784e-40,4.068144584856596e-40,4.048104532778409e-40,4.028064480700222e-40,4.0080244286220346e-40,3.987984376543847e-40,3.9679443244656604e-40,3.947904272387473e-40,3.927864220309286e-40,3.907824168231099e-40,3.887784116152911e-40,3.867744064074725e-40,3.847704011996537e-40,3.82766395991835e-40,3.807623907840163e-40,3.7875838557619756e-40,3.767543803683789e-40,3.7475037516056014e-40,3.727463699527414e-40,3.707423647449227e-40,3.68738359537104e-40,3.6673435432928527e-40,3.6473034912146657e-40,3.627263439136478e-40,3.607223387058291e-40,3.587183334980104e-40,3.567143282901917e-40,3.5471032308237295e-40,3.5270631787455424e-40,3.5070231266673553e-40,3.4869830745891683e-40,3.4669430225109808e-40,3.4469029704327937e-40,3.4268629183546067e-40,3.4068228662764196e-40,3.386782814198232e-40,3.366742762120045e-40,3.346702710041858e-40,3.326662657963671e-40,3.3066226058854834e-40,3.2865825538072963e-40,3.2665425017291093e-40,3.246502449650922e-40,3.2264623975727347e-40,3.2064223454945476e-40,3.1863822934163606e-40,3.1663422413381735e-40,3.146302189259986e-40,3.126262137181799e-40,3.106222085103612e-40,3.086182033025425e-40,3.0661419809472373e-40,3.0461019288690503e-40,3.026061876790863e-40,3.006021824712676e-40,2.9859817726344886e-40,2.9659417205563016e-40,2.9459016684781145e-40,2.9258616163999274e-40,2.90582156432174e-40,2.885781512243553e-40,2.865741460165366e-40,2.8457014080871787e-40,2.8256613560089913e-40,2.805621303930804e-40,2.785581251852617e-40,2.76554119977443e-40,2.7455011476962426e-40,2.7254610956180555e-40,2.7054210435398684e-40,2.6853809914616814e-40,2.665340939383494e-40,2.645300887305307e-40,2.6252608352271197e-40,2.6052207831489327e-40,2.585180731070745e-40,2.565140678992558e-40,2.545100626914371e-40,2.525060574836184e-40,2.5050205227579965e-40,2.4849804706798094e-40,2.4649404186016224e-40,2.4449003665234353e-40,2.424860314445248e-40,2.4048202623670607e-40,2.3847802102888737e-40,2.3647401582106866e-40,2.344700106132499e-40,2.324660054054312e-40,2.304620001976125e-40,2.284579949897938e-40,2.2645398978197504e-40,2.2444998457415634e-40,2.2244597936633763e-40,2.2044197415851892e-40,2.1843796895070017e-40,2.1643396374288147e-40,2.1442995853506276e-40,2.1242595332724405e-40,2.104219481194253e-40,2.084179429116066e-40,2.064139377037879e-40,2.044099324959692e-40,2.0240592728815044e-40,2.0040192208033173e-40,1.9839791687251302e-40,1.963939116646943e-40,1.9438990645687557e-40,1.9238590124905686e-40,1.9038189604123815e-40,1.8837789083341945e-40,1.863738856256007e-40,1.84369880417782e-40,1.8236587520996328e-40,1.8036187000214456e-40,1.7835786479432585e-40,1.7635385958650712e-40,1.7434985437868841e-40,1.7234584917086969e-40,1.7034184396305098e-40,1.6833783875523225e-40,1.6633383354741355e-40,1.6432982833959482e-40,1.6232582313177611e-40,1.6032181792395738e-40,1.5831781271613868e-40,1.5631380750831995e-40,1.5430980230050124e-40,1.5230579709268251e-40,1.503017918848638e-40,1.4829778667704508e-40,1.4629378146922635e-40,1.4428977626140765e-40,1.4228577105358892e-40,1.4028176584577021e-40,1.3827776063795148e-40,1.3627375543013278e-40,1.3426975022231405e-40,1.3226574501449534e-40,1.3026173980667661e-40,1.282577345988579e-40,1.2625372939103918e-40,1.2424972418322047e-40,1.2224571897540175e-40,1.2024171376758304e-40,1.1823770855976431e-40,1.162337033519456e-40,1.1422969814412688e-40,1.1222569293630817e-40,1.1022168772848944e-40,1.0821768252067073e-40,1.06213677312852e-40,1.042096721050333e-40,1.0220566689721457e-40,1.0020166168939587e-40,9.819765648157714e-41,9.619365127375843e-41,9.41896460659397e-41,9.2185640858121e-41,9.018163565030228e-41,8.817763044248356e-41,8.617362523466484e-41,8.416962002684613e-41,8.216561481902741e-41,8.016160961120869e-41,7.815760440338998e-41,7.615359919557126e-41,7.414959398775254e-41,7.214558877993382e-41,7.014158357211511e-41,6.813757836429639e-41,6.613357315647767e-41,6.412956794865895e-41,6.212556274084024e-41,6.012155753302152e-41,5.81175523252028e-41,5.611354711738409e-41,5.410954190956537e-41,5.210553670174665e-41,5.010153149392793e-41,4.809752628610922e-41,4.60935210782905e-41,4.408951587047178e-41,4.2085510662653064e-41,4.0081505454834347e-41,3.807750024701563e-41,3.6073495039196913e-41,3.4069489831378195e-41,3.206548462355948e-41,3.006147941574076e-41,2.8057474207922044e-41,2.6053469000103326e-41,2.404946379228461e-41,2.204545858446589e-41,2.0041453376647172e-41,1.8037448168828455e-41,1.6033442961009737e-41,1.402943775319102e-41,1.2025432545372303e-41,1.0021427337553587e-41,8.01742212973487e-42,6.013416921916152e-42,4.0094117140974344e-42,2.0054065062787172e-42,1.40129846e-45]} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/tiny_positive.json b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/tiny_positive.json new file mode 100644 index 000000000000..26353b552f29 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/tiny_positive.json @@ -0,0 +1 @@ +{"expected":[-99.657845,-99.660736,-99.663635,-99.66654,-99.66946,-99.67237,-99.67529,-99.67822,-99.68116,-99.6841,-99.68705,-99.69,-99.69296,-99.69592,-99.6989,-99.70187,-99.70486,-99.70785,-99.710846,-99.71385,-99.71686,-99.71987,-99.72289,-99.72592,-99.72896,-99.731995,-99.73504,-99.7381,-99.74116,-99.744225,-99.74729,-99.750374,-99.75346,-99.75655,-99.75965,-99.76276,-99.76587,-99.76899,-99.77212,-99.775246,-99.77839,-99.78153,-99.78469,-99.78785,-99.791016,-99.79419,-99.79737,-99.80056,-99.80376,-99.80696,-99.810165,-99.813385,-99.816605,-99.81984,-99.823074,-99.826324,-99.829575,-99.83284,-99.836105,-99.83938,-99.84266,-99.845955,-99.84925,-99.852554,-99.855865,-99.859184,-99.86252,-99.86585,-99.869194,-99.87254,-99.87591,-99.87927,-99.882645,-99.88603,-99.88942,-99.892815,-99.896225,-99.89964,-99.90306,-99.906494,-99.909935,-99.91338,-99.91683,-99.920296,-99.923775,-99.92725,-99.93074,-99.934235,-99.937744,-99.94126,-99.94478,-99.94831,-99.95185,-99.95541,-99.95896,-99.962524,-99.9661,-99.96969,-99.97328,-99.97688,-99.98049,-99.984116,-99.98775,-99.99138,-99.99503,-99.99869,-100.00235,-100.00603,-100.00971,-100.013405,-100.01711,-100.02083,-100.02455,-100.02828,-100.03202,-100.035774,-100.039536,-100.04331,-100.04709,-100.05088,-100.05469,-100.058495,-100.06232,-100.06615,-100.06999,-100.073845,-100.077705,-100.08158,-100.085464,-100.089355,-100.09326,-100.097176,-100.101105,-100.10504,-100.108986,-100.112946,-100.11691,-100.120895,-100.124886,-100.12888,-100.1329,-100.136925,-100.14096,-100.145004,-100.14906,-100.15313,-100.15721,-100.16131,-100.16541,-100.169525,-100.17365,-100.177795,-100.181946,-100.18611,-100.190285,-100.19447,-100.19868,-100.20289,-100.20711,-100.21135,-100.2156,-100.21986,-100.22414,-100.228424,-100.23272,-100.23704,-100.24136,-100.2457,-100.25005,-100.25442,-100.2588,-100.26318,-100.26759,-100.27201,-100.27644,-100.28089,-100.28535,-100.289825,-100.29431,-100.29881,-100.30333,-100.30785,-100.3124,-100.316956,-100.32153,-100.32612,-100.33072,-100.335335,-100.339966,-100.34461,-100.34927,-100.35395,-100.35864,-100.36335,-100.36807,-100.37281,-100.37756,-100.38233,-100.387115,-100.39192,-100.396736,-100.40157,-100.40642,-100.411285,-100.41617,-100.42107,-100.42598,-100.430916,-100.43587,-100.44083,-100.445816,-100.45081,-100.45583,-100.46087,-100.46592,-100.47099,-100.47608,-100.481186,-100.48631,-100.491455,-100.49662,-100.5018,-100.506996,-100.512215,-100.51745,-100.522705,-100.527985,-100.53328,-100.53859,-100.54392,-100.54928,-100.55465,-100.56004,-100.56546,-100.57089,-100.57635,-100.58182,-100.58732,-100.592834,-100.59837,-100.60393,-100.60951,-100.61511,-100.620735,-100.62639,-100.63206,-100.63775,-100.643456,-100.64919,-100.65495,-100.660736,-100.66654,-100.67237,-100.67822,-100.6841,-100.69,-100.69592,-100.70187,-100.70785,-100.71385,-100.71987,-100.72592,-100.731995,-100.7381,-100.744225,-100.750374,-100.75655,-100.76276,-100.76899,-100.775246,-100.78153,-100.78785,-100.79419,-100.80056,-100.80696,-100.813385,-100.81984,-100.826324,-100.83284,-100.83938,-100.845955,-100.852554,-100.859184,-100.86585,-100.87254,-100.87927,-100.88603,-100.892815,-100.89964,-100.906494,-100.91338,-100.920296,-100.92725,-100.934235,-100.94126,-100.94831,-100.95541,-100.962524,-100.96969,-100.97688,-100.984116,-100.99138,-100.99869,-101.00603,-101.013405,-101.02083,-101.02828,-101.035774,-101.04331,-101.05088,-101.058495,-101.06615,-101.073845,-101.08158,-101.089355,-101.097176,-101.10504,-101.112946,-101.120895,-101.12888,-101.136925,-101.145004,-101.15313,-101.16131,-101.169525,-101.177795,-101.18611,-101.19447,-101.20289,-101.21135,-101.21986,-101.228424,-101.23704,-101.2457,-101.25442,-101.26318,-101.27201,-101.28089,-101.289825,-101.29881,-101.30785,-101.316956,-101.32612,-101.335335,-101.34461,-101.35395,-101.36335,-101.37281,-101.38233,-101.39192,-101.40157,-101.411285,-101.42107,-101.430916,-101.44083,-101.45081,-101.46087,-101.47099,-101.481186,-101.491455,-101.5018,-101.512215,-101.522705,-101.53328,-101.54392,-101.55465,-101.56545,-101.57635,-101.58732,-101.59837,-101.60951,-101.620735,-101.63206,-101.643456,-101.65495,-101.66654,-101.67822,-101.69,-101.70187,-101.71385,-101.72592,-101.7381,-101.750374,-101.76276,-101.775246,-101.78785,-101.80056,-101.813385,-101.826324,-101.83938,-101.852554,-101.86585,-101.87927,-101.892815,-101.906494,-101.920296,-101.934235,-101.94831,-101.962524,-101.97688,-101.99138,-102.00603,-102.02083,-102.035774,-102.05088,-102.06615,-102.08158,-102.097176,-102.112946,-102.12888,-102.145004,-102.16131,-102.177795,-102.19447,-102.21135,-102.228424,-102.2457,-102.26318,-102.28089,-102.29881,-102.316956,-102.335335,-102.35395,-102.37281,-102.39192,-102.411285,-102.430916,-102.45081,-102.47099,-102.491455,-102.512215,-102.53328,-102.55465,-102.57635,-102.59837,-102.620735,-102.643456,-102.66654,-102.69,-102.71385,-102.7381,-102.76276,-102.78785,-102.813385,-102.83938,-102.86585,-102.892815,-102.920296,-102.94831,-102.97688,-103.00603,-103.035774,-103.06615,-103.097176,-103.12888,-103.16131,-103.19447,-103.228424,-103.26318,-103.29881,-103.335335,-103.37281,-103.411285,-103.45081,-103.491455,-103.53328,-103.57635,-103.620735,-103.66654,-103.713844,-103.76276,-103.813385,-103.86585,-103.920296,-103.97688,-104.035774,-104.097176,-104.16131,-104.228424,-104.29881,-104.37281,-104.45081,-104.53327,-104.620735,-104.713844,-104.813385,-104.920296,-105.035774,-105.16131,-105.29881,-105.45081,-105.620735,-105.813385,-106.035774,-106.29881,-106.620735,-107.035774,-107.620735,-108.620735,-126.23327],"x":[1.0e-30,9.979959920040082e-31,9.95991984008016e-31,9.939879760120242e-31,9.91983968016032e-31,9.899799600200402e-31,9.879759520240483e-31,9.859719440280562e-31,9.839679360320643e-31,9.819639280360722e-31,9.799599200400803e-31,9.779559120440882e-31,9.759519040480963e-31,9.739478960521044e-31,9.719438880561123e-31,9.699398800601204e-31,9.679358720641283e-31,9.659318640681364e-31,9.639278560721445e-31,9.619238480761524e-31,9.599198400801605e-31,9.579158320841684e-31,9.559118240881765e-31,9.539078160921844e-31,9.519038080961925e-31,9.498998001002005e-31,9.478957921042085e-31,9.458917841082165e-31,9.438877761122245e-31,9.418837681162326e-31,9.398797601202406e-31,9.378757521242486e-31,9.358717441282566e-31,9.338677361322646e-31,9.318637281362726e-31,9.298597201402806e-31,9.278557121442886e-31,9.258517041482967e-31,9.238476961523046e-31,9.218436881563127e-31,9.198396801603207e-31,9.178356721643287e-31,9.158316641683368e-31,9.138276561723447e-31,9.118236481763528e-31,9.098196401803607e-31,9.078156321843688e-31,9.058116241883767e-31,9.038076161923848e-31,9.01803608196393e-31,8.997996002004008e-31,8.97795592204409e-31,8.957915842084168e-31,8.93787576212425e-31,8.91783568216433e-31,8.89779560220441e-31,8.87775552224449e-31,8.85771544228457e-31,8.83767536232465e-31,8.81763528236473e-31,8.79759520240481e-31,8.777555122444891e-31,8.75751504248497e-31,8.737474962525051e-31,8.71743488256513e-31,8.697394802605211e-31,8.677354722645292e-31,8.657314642685371e-31,8.637274562725452e-31,8.617234482765531e-31,8.597194402805612e-31,8.577154322845693e-31,8.557114242885772e-31,8.537074162925853e-31,8.517034082965932e-31,8.496994003006013e-31,8.476953923046092e-31,8.456913843086173e-31,8.436873763126254e-31,8.416833683166333e-31,8.396793603206414e-31,8.376753523246493e-31,8.356713443286574e-31,8.336673363326655e-31,8.316633283366734e-31,8.296593203406815e-31,8.276553123446894e-31,8.256513043486975e-31,8.236472963527054e-31,8.216432883567135e-31,8.196392803607216e-31,8.176352723647295e-31,8.156312643687376e-31,8.136272563727455e-31,8.116232483767536e-31,8.096192403807617e-31,8.076152323847696e-31,8.056112243887777e-31,8.036072163927856e-31,8.016032083967937e-31,7.995992004008016e-31,7.975951924048097e-31,7.955911844088178e-31,7.935871764128257e-31,7.915831684168338e-31,7.895791604208417e-31,7.875751524248498e-31,7.855711444288578e-31,7.835671364328658e-31,7.815631284368738e-31,7.795591204408819e-31,7.775551124448899e-31,7.755511044488979e-31,7.735470964529059e-31,7.715430884569139e-31,7.695390804609219e-31,7.6753507246493e-31,7.65531064468938e-31,7.63527056472946e-31,7.61523048476954e-31,7.59519040480962e-31,7.5751503248497e-31,7.5551102448897805e-31,7.5350701649298605e-31,7.5150300849699405e-31,7.4949900050100205e-31,7.4749499250501005e-31,7.4549098450901806e-31,7.4348697651302614e-31,7.4148296851703415e-31,7.3947896052104215e-31,7.3747495252505015e-31,7.3547094452905815e-31,7.3346693653306615e-31,7.314629285370742e-31,7.294589205410822e-31,7.274549125450902e-31,7.254509045490982e-31,7.234468965531062e-31,7.214428885571143e-31,7.194388805611223e-31,7.174348725651303e-31,7.154308645691383e-31,7.134268565731463e-31,7.114228485771543e-31,7.094188405811624e-31,7.074148325851704e-31,7.054108245891784e-31,7.034068165931864e-31,7.014028085971944e-31,6.993988006012024e-31,6.973947926052105e-31,6.953907846092185e-31,6.933867766132265e-31,6.913827686172345e-31,6.893787606212425e-31,6.873747526252505e-31,6.853707446292586e-31,6.833667366332666e-31,6.813627286372746e-31,6.793587206412826e-31,6.773547126452906e-31,6.753507046492986e-31,6.733466966533067e-31,6.713426886573147e-31,6.693386806613227e-31,6.673346726653307e-31,6.653306646693387e-31,6.633266566733467e-31,6.613226486773548e-31,6.593186406813628e-31,6.573146326853708e-31,6.553106246893788e-31,6.533066166933868e-31,6.513026086973948e-31,6.492986007014029e-31,6.472945927054109e-31,6.452905847094189e-31,6.432865767134269e-31,6.412825687174349e-31,6.392785607214429e-31,6.37274552725451e-31,6.35270544729459e-31,6.33266536733467e-31,6.31262528737475e-31,6.29258520741483e-31,6.27254512745491e-31,6.252505047494991e-31,6.232464967535071e-31,6.212424887575151e-31,6.192384807615231e-31,6.172344727655311e-31,6.152304647695391e-31,6.132264567735472e-31,6.112224487775552e-31,6.092184407815632e-31,6.072144327855712e-31,6.052104247895792e-31,6.032064167935872e-31,6.012024087975953e-31,5.991984008016033e-31,5.971943928056113e-31,5.951903848096193e-31,5.931863768136273e-31,5.911823688176354e-31,5.891783608216434e-31,5.871743528256514e-31,5.851703448296594e-31,5.831663368336674e-31,5.811623288376754e-31,5.791583208416835e-31,5.771543128456915e-31,5.751503048496995e-31,5.731462968537075e-31,5.711422888577155e-31,5.691382808617235e-31,5.6713427286573155e-31,5.6513026486973955e-31,5.6312625687374755e-31,5.6112224887775555e-31,5.5911824088176355e-31,5.5711423288577156e-31,5.5511022488977964e-31,5.5310621689378765e-31,5.5110220889779565e-31,5.4909820090180365e-31,5.4709419290581165e-31,5.4509018490981965e-31,5.430861769138277e-31,5.410821689178357e-31,5.390781609218437e-31,5.370741529258517e-31,5.350701449298597e-31,5.330661369338677e-31,5.310621289378758e-31,5.290581209418838e-31,5.270541129458918e-31,5.250501049498998e-31,5.230460969539078e-31,5.210420889579158e-31,5.190380809619239e-31,5.170340729659319e-31,5.150300649699399e-31,5.130260569739479e-31,5.110220489779559e-31,5.090180409819639e-31,5.07014032985972e-31,5.0501002498998e-31,5.03006016993988e-31,5.01002008997996e-31,4.98998001002004e-31,4.96993993006012e-31,4.949899850100201e-31,4.929859770140281e-31,4.909819690180361e-31,4.889779610220441e-31,4.869739530260521e-31,4.849699450300601e-31,4.829659370340682e-31,4.809619290380762e-31,4.789579210420842e-31,4.769539130460922e-31,4.749499050501002e-31,4.729458970541082e-31,4.709418890581163e-31,4.689378810621243e-31,4.669338730661323e-31,4.649298650701403e-31,4.629258570741483e-31,4.609218490781564e-31,4.589178410821644e-31,4.569138330861724e-31,4.549098250901804e-31,4.529058170941884e-31,4.509018090981964e-31,4.488978011022045e-31,4.468937931062125e-31,4.448897851102205e-31,4.428857771142285e-31,4.408817691182365e-31,4.388777611222445e-31,4.368737531262526e-31,4.348697451302606e-31,4.328657371342686e-31,4.308617291382766e-31,4.288577211422846e-31,4.268537131462926e-31,4.248497051503007e-31,4.228456971543087e-31,4.208416891583167e-31,4.188376811623247e-31,4.168336731663327e-31,4.148296651703407e-31,4.128256571743488e-31,4.108216491783568e-31,4.088176411823648e-31,4.068136331863728e-31,4.048096251903808e-31,4.028056171943888e-31,4.008016091983969e-31,3.987976012024049e-31,3.967935932064129e-31,3.947895852104209e-31,3.927855772144289e-31,3.907815692184369e-31,3.887775612224449e-31,3.8677355322645296e-31,3.8476954523046096e-31,3.8276553723446896e-31,3.80761529238477e-31,3.78757521242485e-31,3.76753513246493e-31,3.7474950525050105e-31,3.7274549725450905e-31,3.7074148925851705e-31,3.687374812625251e-31,3.667334732665331e-31,3.647294652705411e-31,3.6272545727454915e-31,3.6072144927855715e-31,3.5871744128256515e-31,3.567134332865732e-31,3.547094252905812e-31,3.527054172945892e-31,3.5070140929859724e-31,3.4869740130260524e-31,3.4669339330661324e-31,3.446893853106213e-31,3.426853773146293e-31,3.406813693186373e-31,3.3867736132264533e-31,3.3667335332665334e-31,3.3466934533066134e-31,3.326653373346694e-31,3.306613293386774e-31,3.286573213426854e-31,3.2665331334669343e-31,3.2464930535070143e-31,3.2264529735470943e-31,3.2064128935871747e-31,3.1863728136272548e-31,3.1663327336673348e-31,3.146292653707415e-31,3.1262525737474952e-31,3.1062124937875752e-31,3.0861724138276557e-31,3.0661323338677357e-31,3.0460922539078157e-31,3.026052173947896e-31,3.006012093987976e-31,2.985972014028056e-31,2.9659319340681366e-31,2.9458918541082166e-31,2.9258517741482966e-31,2.905811694188377e-31,2.885771614228457e-31,2.865731534268537e-31,2.8456914543086176e-31,2.8256513743486976e-31,2.8056112943887776e-31,2.785571214428858e-31,2.765531134468938e-31,2.745491054509018e-31,2.7254509745490985e-31,2.7054108945891785e-31,2.6853708146292585e-31,2.665330734669339e-31,2.645290654709419e-31,2.6252505747494994e-31,2.6052104947895794e-31,2.5851704148296595e-31,2.56513033486974e-31,2.54509025490982e-31,2.5250501749499e-31,2.5050100949899804e-31,2.4849700150300604e-31,2.4649299350701404e-31,2.444889855110221e-31,2.424849775150301e-31,2.404809695190381e-31,2.3847696152304613e-31,2.3647295352705413e-31,2.3446894553106213e-31,2.3246493753507018e-31,2.304609295390782e-31,2.284569215430862e-31,2.2645291354709422e-31,2.2444890555110223e-31,2.2244489755511023e-31,2.2044088955911827e-31,2.1843688156312627e-31,2.1643287356713427e-31,2.144288655711423e-31,2.124248575751503e-31,2.104208495791583e-31,2.0841684158316637e-31,2.0641283358717437e-31,2.0440882559118237e-31,2.024048175951904e-31,2.004008095991984e-31,1.983968016032064e-31,1.9639279360721444e-31,1.9438878561122246e-31,1.9238477761523048e-31,1.9038076961923848e-31,1.883767616232465e-31,1.8637275362725453e-31,1.8436874563126253e-31,1.8236473763527055e-31,1.8036072963927858e-31,1.7835672164328658e-31,1.763527136472946e-31,1.7434870565130262e-31,1.7234469765531063e-31,1.7034068965931865e-31,1.6833668166332667e-31,1.663326736673347e-31,1.643286656713427e-31,1.6232465767535072e-31,1.6032064967935874e-31,1.5831664168336674e-31,1.5631263368737477e-31,1.5430862569138279e-31,1.5230461769539079e-31,1.5030060969939881e-31,1.4829660170340683e-31,1.4629259370741484e-31,1.4428858571142286e-31,1.4228457771543088e-31,1.4028056971943888e-31,1.382765617234469e-31,1.3627255372745493e-31,1.3426854573146293e-31,1.3226453773547095e-31,1.3026052973947898e-31,1.2825652174348698e-31,1.26252513747495e-31,1.2424850575150302e-31,1.2224449775551102e-31,1.2024048975951905e-31,1.1823648176352707e-31,1.1623247376753507e-31,1.142284657715431e-31,1.1222445777555112e-31,1.1022044977955912e-31,1.0821644178356714e-31,1.0621243378757516e-31,1.0420842579158316e-31,1.0220441779559119e-31,1.002004097995992e-31,9.819640180360722e-32,9.619239380761523e-32,9.418838581162326e-32,9.218437781563127e-32,9.018036981963928e-32,8.81763618236473e-32,8.617235382765532e-32,8.416834583166333e-32,8.216433783567135e-32,8.016032983967936e-32,7.815632184368739e-32,7.61523138476954e-32,7.414830585170341e-32,7.214429785571143e-32,7.014028985971945e-32,6.813628186372746e-32,6.613227386773548e-32,6.412826587174349e-32,6.21242578757515e-32,6.012024987975953e-32,5.811624188376754e-32,5.611223388777555e-32,5.410822589178357e-32,5.210421789579159e-32,5.01002098997996e-32,4.809620190380762e-32,4.6092193907815633e-32,4.408818591182365e-32,4.208417791583167e-32,4.0080169919839685e-32,3.80761619238477e-32,3.6072153927855715e-32,3.406814593186373e-32,3.2064137935871744e-32,3.006012993987976e-32,2.805612194388778e-32,2.605211394789579e-32,2.4048105951903809e-32,2.2044097955911826e-32,2.004008995991984e-32,1.8036081963927858e-32,1.6032073967935873e-32,1.4028065971943888e-32,1.2024057975951905e-32,1.0020049979959921e-32,8.016041983967936e-33,6.012033987975952e-33,4.008025991983968e-33,2.004017995991984e-33,1.0e-38]} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/very_large_positive.json b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/very_large_positive.json new file mode 100644 index 000000000000..d12e925f049e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/fixtures/julia/very_large_positive.json @@ -0,0 +1 @@ +{"expected":[5.643856,5.669645,5.6949806,5.719879,5.744355,5.768423,5.7920957,5.8153863,5.838307,5.8608694,5.883084,5.904962,5.9265127,5.9477468,5.9686728,5.9892993,6.009635,6.0296884,6.0494666,6.0689774,6.0882277,6.107225,6.125975,6.1444845,6.16276,6.180806,6.1986294,6.2162356,6.233629,6.250816,6.2678,6.2845864,6.30118,6.317585,6.333805,6.349845,6.365709,6.3814,6.396922,6.412279,6.4274745,6.4425116,6.457393,6.472123,6.486704,6.501139,6.5154314,6.529583,6.5435977,6.557477,6.5712247,6.584842,6.5983324,6.6116977,6.62494,6.638062,6.6510663,6.663954,6.6767273,6.6893888,6.70194,6.714383,6.72672,6.7389517,6.751081,6.763109,6.775038,6.7868686,6.798603,6.810243,6.8217897,6.833245,6.8446097,6.855886,6.8670745,6.8781767,6.8891945,6.900129,6.9109807,6.9217515,6.9324427,6.943055,6.95359,6.9640484,6.974432,6.9847407,6.994977,7.005141,7.0152335,7.025256,7.0352097,7.045095,7.054913,7.0646644,7.074351,7.083972,7.09353,7.103025,7.1124578,7.1218295,7.13114,7.140392,7.1495843,7.1587186,7.167795,7.176815,7.185779,7.194688,7.2035418,7.212342,7.2210884,7.229782,7.238424,7.247014,7.2555537,7.264043,7.2724824,7.280873,7.289215,7.297509,7.3057556,7.3139553,7.3221087,7.3302164,7.338279,7.3462963,7.354269,7.362199,7.370085,7.377928,7.3857284,7.393487,7.4012046,7.4088807,7.4165163,7.4241114,7.4316673,7.439183,7.4466605,7.454099,7.4615,7.4688625,7.476188,7.4834766,7.4907284,7.497944,7.5051236,7.5122676,7.5193763,7.52645,7.5334897,7.540495,7.5474663,7.5544043,7.561309,7.568181,7.57502,7.581827,7.588602,7.5953455,7.6020575,7.608738,7.6153884,7.622008,7.6285973,7.6351566,7.641686,7.648186,7.6546574,7.6611,7.6675134,7.6738987,7.6802554,7.686585,7.6928864,7.6991606,7.705407,7.7116275,7.7178206,7.7239876,7.7301283,7.736243,7.7423315,7.7483945,7.754432,7.760445,7.766433,7.7723956,7.778334,7.784248,7.790138,7.796004,7.801846,7.807665,7.81346,7.819232,7.824981,7.830707,7.836411,7.842092,7.847751,7.853388,7.8590026,7.8645954,7.8701673,7.875717,7.8812456,7.8867536,7.89224,7.897706,7.9031515,7.908576,7.9139805,7.919365,7.9247293,7.9300737,7.935398,7.9407034,7.945989,7.9512553,7.956503,7.961731,7.9669404,7.972131,7.977303,7.982456,7.9875917,7.9927087,7.9978075,8.002889,8.007952,8.012997,8.018024,8.023035,8.028028,8.033004,8.037962,8.042904,8.047829,8.052737,8.057629,8.062503,8.067362,8.072204,8.07703,8.08184,8.086634,8.091412,8.096174,8.100921,8.105651,8.110367,8.1150675,8.119752,8.124422,8.129077,8.133717,8.138341,8.142951,8.147547,8.152127,8.156693,8.161245,8.165783,8.170306,8.174815,8.179311,8.183792,8.188259,8.192713,8.197153,8.201579,8.205992,8.210391,8.214777,8.21915,8.223509,8.227855,8.232188,8.236508,8.240815,8.24511,8.249392,8.25366,8.257916,8.26216,8.266393,8.270612,8.274818,8.279013,8.2831955,8.287365,8.291524,8.29567,8.299805,8.303927,8.308038,8.312138,8.316225,8.320301,8.324366,8.328419,8.33246,8.336491,8.34051,8.344519,8.3485155,8.352501,8.356476,8.36044,8.364393,8.368336,8.372268,8.376188,8.380098,8.383999,8.387888,8.391767,8.395635,8.399493,8.403341,8.407178,8.411006,8.414823,8.41863,8.422427,8.426214,8.429992,8.433759,8.437516,8.441264,8.445003,8.44873,8.45245,8.456159,8.459859,8.463549,8.46723,8.4709015,8.474564,8.478216,8.48186,8.485495,8.48912,8.492736,8.496344,8.499942,8.503531,8.507112,8.510683,8.514246,8.517799,8.521345,8.524881,8.528409,8.531928,8.5354395,8.538941,8.542435,8.54592,8.5493965,8.552865,8.556326,8.559777,8.563221,8.566656,8.570084,8.573503,8.576914,8.5803175,8.583713,8.587099,8.590478,8.593849,8.597213,8.600569,8.603916,8.607256,8.610588,8.613914,8.61723,8.62054,8.623841,8.627135,8.630423,8.633701,8.636973,8.640238,8.643495,8.646745,8.649987,8.653222,8.65645,8.659671,8.662884,8.666091,8.66929,8.6724825,8.675667,8.678845,8.682016,8.685181,8.688338,8.691488,8.694632,8.697768,8.700898,8.704021,8.707138,8.710247,8.71335,8.716447,8.719536,8.722619,8.725696,8.7287655,8.731829,8.734886,8.737937,8.74098,8.744019,8.747049,8.750074,8.753093,8.756105,8.759111,8.762111,8.765104,8.768091,8.771072,8.774048,8.777017,8.779979,8.782936,8.785887,8.788831,8.79177,8.794703,8.797629,8.8005495,8.803465,8.806374,8.809277,8.812174,8.815065,8.817951,8.820831,8.823706,8.826574,8.829436,8.8322935,8.835145,8.837992,8.840832,8.843666,8.846496,8.8493185,8.852137,8.85495,8.857757,8.8605585,8.863355,8.866145,8.868931,8.871711,8.874486,8.8772545,8.880019,8.882778,8.885531,8.88828,8.891023,8.893761,8.896493,8.89922,8.901943,8.90466,8.907372,8.910079,8.912782,8.915479,8.91817,8.920857,8.923539,8.926216,8.928887,8.931555,8.9342165,8.936874,8.939527,8.942174,8.944817,8.9474535,8.950087,8.952715,8.9553385,8.957957,8.96057,8.96318,8.965784],"x":[50.0,50.901803607214426,51.80360721442886,52.705410821643284,53.607214428857716,54.50901803607214,55.410821643286575,56.312625250501,57.21442885771543,58.11623246492986,59.01803607214429,59.91983967935872,60.82164328657315,61.723446893787575,62.62525050100201,63.52705410821643,64.42885771543087,65.33066132264528,66.23246492985972,67.13426853707415,68.03607214428858,68.937875751503,69.83967935871743,70.74148296593187,71.6432865731463,72.54509018036072,73.44689378757515,74.34869739478958,75.25050100200401,76.15230460921843,77.05410821643287,77.9559118236473,78.85771543086172,79.75951903807615,80.66132264529058,81.56312625250501,82.46492985971943,83.36673346693387,84.2685370741483,85.17034068136273,86.07214428857715,86.97394789579158,87.87575150300601,88.77755511022045,89.67935871743487,90.5811623246493,91.48296593186373,92.38476953907815,93.28657314629258,94.18837675350701,95.09018036072145,95.99198396793587,96.8937875751503,97.79559118236473,98.69739478957916,99.59919839679358,100.50100200400801,101.40280561122245,102.30460921843688,103.2064128256513,104.10821643286573,105.01002004008016,105.91182364729458,106.81362725450902,107.71543086172345,108.61723446893788,109.5190380761523,110.42084168336673,111.32264529058116,112.2244488977956,113.12625250501002,114.02805611222445,114.92985971943888,115.83166332665331,116.73346693386773,117.63527054108216,118.5370741482966,119.43887775551102,120.34068136272545,121.24248496993988,122.14428857715431,123.04609218436873,123.94789579158316,124.8496993987976,125.75150300601203,126.65330661322645,127.55511022044088,128.4569138276553,129.35871743486973,130.26052104208418,131.1623246492986,132.06412825651302,132.96593186372746,133.86773547094188,134.7695390781563,135.67134268537075,136.57314629258516,137.4749498997996,138.37675350701403,139.27855711422845,140.1803607214429,141.0821643286573,141.98396793587173,142.88577154308618,143.7875751503006,144.68937875751504,145.59118236472946,146.49298597194388,147.39478957915833,148.29659318637275,149.19839679358716,150.1002004008016,151.00200400801603,151.90380761523045,152.8056112224449,153.7074148296593,154.60921843687376,155.51102204408818,156.4128256513026,157.31462925851704,158.21643286573146,159.11823647294588,160.02004008016033,160.92184368737475,161.82364729458916,162.7254509018036,163.62725450901803,164.52905811623248,165.4308617234469,166.3326653306613,167.23446893787576,168.13627254509018,169.0380761523046,169.93987975951904,170.84168336673346,171.7434869739479,172.64529058116233,173.54709418837675,174.4488977955912,175.3507014028056,176.25250501002003,177.15430861723448,178.0561122244489,178.9579158316633,179.85971943887776,180.76152304609218,181.66332665330663,182.56513026052104,183.46693386773546,184.3687374749499,185.27054108216433,186.17234468937875,187.0741482965932,187.9759519038076,188.87775551102203,189.77955911823648,190.6813627254509,191.58316633266534,192.48496993987976,193.38677354709418,194.28857715430863,195.19038076152304,196.09218436873746,196.9939879759519,197.89579158316633,198.79759519038078,199.6993987975952,200.6012024048096,201.50300601202406,202.40480961923848,203.3066132264529,204.20841683366734,205.11022044088176,206.01202404809618,206.91382765531063,207.81563126252505,208.7174348697395,209.6192384769539,210.52104208416833,211.42284569138278,212.3246492985972,213.2264529058116,214.12825651302606,215.03006012024048,215.9318637274549,216.83366733466934,217.73547094188376,218.6372745490982,219.53907815631263,220.44088176352705,221.3426853707415,222.2444889779559,223.14629258517033,224.04809619238478,224.9498997995992,225.85170340681364,226.75350701402806,227.65531062124248,228.55711422845692,229.45891783567134,230.36072144288576,231.2625250501002,232.16432865731463,233.06613226452905,233.9679358717435,234.8697394789579,235.77154308617236,236.67334669338678,237.5751503006012,238.47695390781564,239.37875751503006,240.28056112224448,241.18236472945893,242.08416833667334,242.98597194388776,243.8877755511022,244.78957915831663,245.69138276553107,246.5931863727455,247.4949899799599,248.39679358717436,249.29859719438878,250.2004008016032,251.10220440881764,252.00400801603206,252.9058116232465,253.80761523046093,254.70941883767534,255.6112224448898,256.5130260521042,257.4148296593186,258.3166332665331,259.2184368737475,260.1202404809619,261.02204408817636,261.9238476953908,262.8256513026052,263.72745490981964,264.6292585170341,265.5310621242485,266.4328657314629,267.3346693386774,268.23647294589176,269.1382765531062,270.04008016032066,270.94188376753505,271.8436873747495,272.74549098196394,273.64729458917833,274.5490981963928,275.4509018036072,276.35270541082167,277.25450901803606,278.1563126252505,279.05811623246495,279.95991983967934,280.8617234468938,281.76352705410824,282.6653306613226,283.5671342685371,284.4689378757515,285.3707414829659,286.27254509018036,287.1743486973948,288.0761523046092,288.97795591182364,289.8797595190381,290.7815631262525,291.6833667334669,292.5851703406814,293.4869739478958,294.3887775551102,295.29058116232466,296.1923847695391,297.0941883767535,297.99599198396794,298.8977955911824,299.7995991983968,300.7014028056112,301.60320641282567,302.50501002004006,303.4068136272545,304.30861723446895,305.21042084168334,306.1122244488978,307.01402805611224,307.9158316633266,308.8176352705411,309.7194388777555,310.6212424849699,311.52304609218436,312.4248496993988,313.32665330661325,314.22845691382764,315.1302605210421,316.03206412825654,316.9338677354709,317.8356713426854,318.7374749498998,319.6392785571142,320.54108216432866,321.4428857715431,322.3446893787575,323.24649298597194,324.1482965931864,325.0501002004008,325.9519038076152,326.85370741482967,327.75551102204406,328.6573146292585,329.55911823647295,330.4609218436874,331.3627254509018,332.26452905811624,333.1663326653307,334.0681362725451,334.9699398797595,335.87174348697397,336.77354709418836,337.6753507014028,338.57715430861725,339.47895791583164,340.3807615230461,341.28256513026054,342.1843687374749,343.0861723446894,343.9879759519038,344.8897795591182,345.79158316633266,346.6933867735471,347.59519038076155,348.49699398797594,349.3987975951904,350.30060120240483,351.2024048096192,352.10420841683367,353.0060120240481,353.9078156312625,354.80961923847696,355.7114228456914,356.6132264529058,357.51503006012024,358.4168336673347,359.3186372745491,360.2204408817635,361.12224448897797,362.02404809619236,362.9258517034068,363.82765531062125,364.72945891783564,365.6312625250501,366.53306613226454,367.434869739479,368.3366733466934,369.2384769539078,370.14028056112227,371.04208416833666,371.9438877755511,372.84569138276555,373.74749498997994,374.6492985971944,375.55110220440883,376.4529058116232,377.3547094188377,378.2565130260521,379.1583166332665,380.06012024048096,380.9619238476954,381.8637274549098,382.76553106212424,383.6673346693387,384.56913827655313,385.4709418837675,386.37274549098197,387.2745490981964,388.1763527054108,389.07815631262525,389.9799599198397,390.8817635270541,391.78356713426854,392.685370741483,393.5871743486974,394.4889779559118,395.39078156312627,396.29258517034066,397.1943887775551,398.09619238476955,398.99799599198394,399.8997995991984,400.80160320641284,401.7034068136273,402.6052104208417,403.5070140280561,404.40881763527057,405.31062124248496,406.2124248496994,407.11422845691385,408.01603206412824,408.9178356713427,409.81963927855713,410.7214428857715,411.62324649298597,412.5250501002004,413.4268537074148,414.32865731462925,415.2304609218437,416.1322645290581,417.03406813627254,417.935871743487,418.8376753507014,419.7394789579158,420.64128256513027,421.5430861723447,422.4448897795591,423.34669338677355,424.248496993988,425.1503006012024,426.05210420841684,426.9539078156313,427.8557114228457,428.7575150300601,429.65931863727457,430.56112224448896,431.4629258517034,432.36472945891785,433.26653306613224,434.1683366733467,435.07014028056113,435.9719438877755,436.87374749498997,437.7755511022044,438.67735470941886,439.57915831663325,440.4809619238477,441.38276553106215,442.28456913827654,443.186372745491,444.08817635270543,444.9899799599198,445.89178356713427,446.7935871743487,447.6953907815631,448.59719438877755,449.498997995992,450.4008016032064,451.30260521042084,452.2044088176353,453.1062124248497,454.0080160320641,454.90981963927857,455.811623246493,456.7134268537074,457.61523046092185,458.5170340681363,459.4188376753507,460.32064128256513,461.2224448897796,462.12424849699397,463.0260521042084,463.92785571142286,464.82965931863725,465.7314629258517,466.63326653306615,467.53507014028054,468.436873747495,469.33867735470943,470.2404809619238,471.14228456913827,472.0440881763527,472.9458917835671,473.84769539078155,474.749498997996,475.65130260521045,476.55310621242484,477.4549098196393,478.35671342685373,479.2585170340681,480.16032064128257,481.062124248497,481.9639278557114,482.86573146292585,483.7675350701403,484.6693386773547,485.57114228456913,486.4729458917836,487.37474949899797,488.2765531062124,489.17835671342687,490.08016032064126,490.9819639278557,491.88376753507015,492.7855711422846,493.687374749499,494.58917835671343,495.4909819639279,496.39278557114227,497.2945891783567,498.19639278557116,499.09819639278555,500.0]} diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/test.js b/lib/node_modules/@stdlib/math/base/special/log2f/test/test.js new file mode 100644 index 000000000000..a7e62bb8c8fb --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/test.js @@ -0,0 +1,191 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); +var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' ); +var log2f = require( './../lib' ); + + +// FIXTURES // + +var veryLargePositive = require( './fixtures/julia/very_large_positive.json' ); +var largePositive = require( './fixtures/julia/large_positive.json' ); +var mediumPositive = require( './fixtures/julia/medium_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); +var smaller = require( './fixtures/julia/smaller.json' ); +var tinyPositive = require( './fixtures/julia/tiny_positive.json' ); +var subnormal = require( './fixtures/julia/subnormal.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof log2f, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (very large positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = veryLargePositive.expected; + x = veryLargePositive.x; + for ( i = 0; i < x.length; i++ ) { + y = log2f( x[i] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (large positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = largePositive.expected; + x = largePositive.x; + for ( i = 0; i < x.length; i++ ) { + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (medium positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = mediumPositive.expected; + x = mediumPositive.x; + for ( i = 0; i < x.length; i++ ) { + y = log2f( x[i] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (small positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = smallPositive.expected; + x = smallPositive.x; + for ( i = 0; i < x.length; i++ ) { + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 152, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (smaller positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = smaller.expected; + x = smaller.x; + for ( i = 0; i < x.length; i++ ) { + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 8, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (tiny positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = tinyPositive.expected; + x = tinyPositive.x; + for ( i = 0; i < x.length; i++ ) { + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (subnormal values)', function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = subnormal.expected; + x = subnormal.x; + for ( i = 0; i < x.length; i++ ) { + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 9, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `-infinity` if provided `0`', function test( t ) { + t.equal( log2f( 0.0 ), NINF, 'equals -infinity' ); + t.end(); +}); + +tape( 'the function returns `+infinity` if provided `+infinity`', function test( t ) { + t.equal( log2f( PINF ), PINF, 'equals +infinity' ); + t.end(); +}); + +tape( 'the function returns `NaN` if provided a negative number', function test( t ) { + var v = log2f( -1.0 ); + t.equal( isnanf( v ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'the function returns positive zero if provided `1.0`', function test( t ) { + var v = log2f( 1.0 ); + t.equal( isPositiveZero( v ), true, 'returns +0' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/log2f/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/log2f/test/test.native.js new file mode 100644 index 000000000000..d73626086b21 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/log2f/test/test.native.js @@ -0,0 +1,207 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' ); +var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var log2f = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( log2f instanceof Error ) +}; + + +// FIXTURES // + +var veryLargePositive = require( './fixtures/julia/very_large_positive.json' ); +var largePositive = require( './fixtures/julia/large_positive.json' ); +var mediumPositive = require( './fixtures/julia/medium_positive.json' ); +var smallPositive = require( './fixtures/julia/small_positive.json' ); +var smaller = require( './fixtures/julia/smaller.json' ); +var tinyPositive = require( './fixtures/julia/tiny_positive.json' ); +var subnormal = require( './fixtures/julia/subnormal.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof log2f, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (very large positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = veryLargePositive.expected; + x = veryLargePositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ]); + y = log2f( x[i] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (large positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = largePositive.expected; + x = largePositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ]); + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (medium positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = mediumPositive.expected; + x = mediumPositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ]); + y = log2f( x[i] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (small positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = smallPositive.expected; + x = smallPositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ]); + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 152, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (smaller positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = smaller.expected; + x = smaller.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ]); + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 8, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (tiny positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = tinyPositive.expected; + x = tinyPositive.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ]); + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 1, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function evaluates the binary logarithm of `x` (subnormal values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + var e; + + expected = subnormal.expected; + x = subnormal.x; + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ]); + y = log2f( x[ i ] ); + e = f32( expected[ i ] ); + t.strictEqual( ulpdiff( y, e ) <= 9, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `-infinity` if provided `0`', opts, function test( t ) { + t.equal( log2f( 0.0 ), NINF, 'equals -infinity' ); + t.end(); +}); + +tape( 'the function returns `+infinity` if provided `+infinity`', opts, function test( t ) { + t.equal( log2f( PINF ), PINF, 'equals +infinity' ); + t.end(); +}); + +tape( 'the function returns `NaN` if provided a negative number', opts, function test( t ) { + var v = log2f( -1.0 ); + t.equal( isnanf( v ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'the function returns positive zero if provided `1.0`', opts, function test( t ) { + var v = log2f( 1.0 ); + t.equal( isPositiveZero( v ), true, 'returns +0' ); + t.end(); +});