diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/README.md b/lib/node_modules/@stdlib/math/base/special/secdf/README.md new file mode 100644 index 000000000000..39fd317147dc --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/README.md @@ -0,0 +1,192 @@ + + +# secdf + +> Compute the [secant][secant] of a single-precision floating-point number (in degrees). + +
+ +## Usage + +```javascript +var secdf = require( '@stdlib/math/base/special/secdf' ); +``` + +#### secdf( x ) + +Computes the [secant][secant] of a single-precision floating-point number (in degrees). + +```javascript +var v = secdf( 30.0 ); +// returns ~1.15 + +v = secdf( 45.0 ); +// returns ~1.41 + +v = secdf( 60.0 ); +// returns ~2.0 + +v = secdf( 90.0 ); +// returns Infinity + +v = secdf( 0.0 ); +// returns 1.0 + +v = secdf( NaN ); +// returns NaN +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var secdf = require( '@stdlib/math/base/special/secdf' ); + +var opts = { + 'dtype': 'float32' +}; +var x = uniform( 100, -180.0, 180.0, opts ); + +logEachMap( 'secdf(%0.4f) = %0.4f', x, secdf ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/secdf.h" +``` + +#### stdlib_base_secdf( x ) + +Computes the [secant][secant] of a single-precision floating-point number (in degrees). + +```c +float out = stdlib_base_secdf( 30.0f ); +// returns ~1.15f + +out = stdlib_base_secdf( 45.0f ); +// returns ~1.41f +``` + +The function accepts the following arguments: + +- **x**: `[in] float` input value. + +```c +float stdlib_base_secdf( const float x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/secdf.h" +#include + +int main( void ) { + const float x[] = { 0.0f, 30.0f, 45.0f, 60.0f, 90.0f }; + + float y; + int i; + for ( i = 0; i < 5; i++ ) { + y = stdlib_base_secdf( x[ i ] ); + printf( "secdf(%f) = %f\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/benchmark.js new file mode 100644 index 000000000000..371ae82047fc --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/benchmark.js @@ -0,0 +1,54 @@ +/** +* @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 secdf = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, -180.0, 180.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = secdf( 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/secdf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/benchmark.native.js new file mode 100644 index 000000000000..c24f69b5db7a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/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 secdf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( secdf instanceof Error ) +}; + + +// MAIN // + +bench( pkg+'::native', opts, function benchmark( b ) { + var x; + var y; + var i; + + x = uniform( 100, -180.0, 180.0, { + 'dtype': 'float32' + }); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = secdf( 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/secdf/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/c/native/Makefile new file mode 100644 index 000000000000..a4bd7b38fd74 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/c/native/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/c/native/benchmark.c new file mode 100644 index 000000000000..58dddb97bb9b --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/benchmark/c/native/benchmark.c @@ -0,0 +1,138 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/secdf.h" +#include +#include +#include +#include +#include + +#define NAME "secdf" +#define ITERATIONS 1000000 +#define REPEATS 3 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param elapsed elapsed time in seconds +*/ +static void print_results( double elapsed ) { + double rate = (double)ITERATIONS / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", ITERATIONS ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [min,max). +* +* @param min minimum value (inclusive) +* @param max maximum value (exclusive) +* @return random number +*/ +static float random_uniform( const float min, const float max ) { + float v = (float)rand() / ( (float)RAND_MAX + 1.0f ); + return min + ( v*(max-min) ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + float x[ 100 ]; + double elapsed; + double t; + float y; + int i; + + for ( i = 0; i < 100; i++ ) { + x[ i ] = random_uniform( -180.0f, 180.0f ); + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + y = stdlib_base_secdf( 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::native::%s\n", NAME ); + elapsed = benchmark(); + print_results( elapsed ); + printf( "ok %d benchmark finished\n", i+1 ); + } + print_summary( REPEATS, REPEATS ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/binding.gyp b/lib/node_modules/@stdlib/math/base/special/secdf/binding.gyp new file mode 100644 index 000000000000..68a1ca11d160 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/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/secdf/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/secdf/docs/repl.txt new file mode 100644 index 000000000000..20ed682d697d --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/docs/repl.txt @@ -0,0 +1,29 @@ + +{{alias}}( x ) + Computes the secant of a single-precision floating-point number (in + degrees). + + Parameters + ---------- + x: number + Input value (in degrees). + + Returns + ------- + y: number + Secant. + + Examples + -------- + > var y = {{alias}}( 1.0 ) + ~1.0 + > y = {{alias}}( {{alias:@stdlib/constants/float32/pi}} ) + ~1.0 + > y = {{alias}}( -{{alias:@stdlib/constants/float32/pi}} ) + ~1.0 + > y = {{alias}}( NaN ) + NaN + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/secdf/docs/types/index.d.ts new file mode 100644 index 000000000000..48aa7e9317e3 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/docs/types/index.d.ts @@ -0,0 +1,56 @@ +/* +* @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 + +/** +* Computes the secant of a single-precision floating-point number (in degrees). +* +* @param x - input value (in degrees) +* @returns secant +* +* @example +* var v = secdf( 30.0 ); +* // returns ~1.15 +* +* @example +* var v = secdf( 45.0 ); +* // returns ~1.41 +* +* @example +* var v = secdf( 60.0 ); +* // returns ~2.0 +* +* @example +* var v = secdf( 90.0 ); +* // returns Infinity +* +* @example +* var v = secdf( 0.0 ); +* // returns 1.0 +* +* @example +* var v = secdf( NaN ); +* // returns NaN +*/ +declare function secdf( x: number ): number; + + +// EXPORTS // + +export = secdf; diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/secdf/docs/types/test.ts new file mode 100644 index 000000000000..4b85d617d1ad --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import secdf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + secdf( 60.0 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + secdf( true ); // $ExpectError + secdf( false ); // $ExpectError + secdf( null ); // $ExpectError + secdf( undefined ); // $ExpectError + secdf( '5' ); // $ExpectError + secdf( [] ); // $ExpectError + secdf( {} ); // $ExpectError + secdf( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + secdf(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/examples/c/Makefile b/lib/node_modules/@stdlib/math/base/special/secdf/examples/c/Makefile new file mode 100644 index 000000000000..25ced822f96a --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/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/secdf/examples/c/example.c b/lib/node_modules/@stdlib/math/base/special/secdf/examples/c/example.c new file mode 100644 index 000000000000..1df4e23b16e6 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/examples/c/example.c @@ -0,0 +1,31 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/secdf.h" +#include + +int main( void ) { + const float x[] = { 0.0f, 30.0f, 45.0f, 60.0f, 90.0f }; + + float y; + int i; + for ( i = 0; i < 5; i++ ) { + y = stdlib_base_secdf( x[ i ] ); + printf( "secdf(%f) = %f\n", x[ i ], y ); + } +} diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/examples/index.js b/lib/node_modules/@stdlib/math/base/special/secdf/examples/index.js new file mode 100644 index 000000000000..37b3f2f1bb0c --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/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 secdf = require( './../lib' ); + +var opts = { + 'dtype': 'float32' +}; +var x = uniform( 100, -180.0, 180.0, opts ); + +logEachMap( 'secdf(%0.4f) = %0.4f', x, secdf ); diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/include.gypi b/lib/node_modules/@stdlib/math/base/special/secdf/include.gypi new file mode 100644 index 000000000000..ecfaf82a3279 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "secant", + "cosine", + "inverse", + "trig", + "trigonometry", + "angle" + ] +} diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/src/Makefile b/lib/node_modules/@stdlib/math/base/special/secdf/src/Makefile new file mode 100644 index 000000000000..7733b6180cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/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/secdf/src/addon.c b/lib/node_modules/@stdlib/math/base/special/secdf/src/addon.c new file mode 100644 index 000000000000..8ba3468e75d9 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/src/addon.c @@ -0,0 +1,22 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/secdf.h" +#include "stdlib/math/base/napi/unary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_F_F( stdlib_base_secdf ) diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/src/main.c b/lib/node_modules/@stdlib/math/base/special/secdf/src/main.c new file mode 100644 index 000000000000..e60e1ae589f6 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/src/main.c @@ -0,0 +1,34 @@ +/** +* @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/secdf.h" +#include "stdlib/math/base/special/cosdf.h" + +/** +* Computes the secant of a single-precision floating-point number (in degrees). +* +* @param x input value (in degrees) +* @return secant +* +* @example +* float y = stdlib_base_secdf( 30.0f ); +* // returns ~1.15f +*/ +float stdlib_base_secdf( const float x ) { + return 1.0f / stdlib_base_cosdf( x ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..308c3be89c85 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/REQUIRE @@ -0,0 +1,2 @@ +julia 1.5 +JSON 0.21 diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/negative.json b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/negative.json new file mode 100644 index 000000000000..a5bd3e1a79fa --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/negative.json @@ -0,0 +1 @@ +{"expected":[1.0000015,1.0000323,1.0001026,1.0002124,1.000362,1.0005511,1.00078,1.0010484,1.0013567,1.0017048,1.0020928,1.0025208,1.0029888,1.003497,1.0040455,1.0046343,1.0052634,1.0059334,1.006644,1.0073955,1.008188,1.0090218,1.0098969,1.0108135,1.0117719,1.0127722,1.0138146,1.0148993,1.0160266,1.0171967,1.0184097,1.0196662,1.020966,1.0223098,1.0236977,1.0251299,1.0266068,1.0281286,1.029696,1.0313088,1.0329674,1.0346727,1.0364246,1.0382235,1.0400699,1.0419643,1.0439068,1.0458981,1.0479386,1.0500286,1.0521686,1.0543593,1.0566009,1.058894,1.0612391,1.0636371,1.066088,1.0685925,1.0711516,1.0737653,1.0764344,1.0791596,1.0819418,1.0847813,1.0876787,1.0906352,1.0936509,1.0967269,1.0998638,1.1030629,1.1063241,1.1096486,1.1130377,1.1164917,1.1200114,1.1235981,1.1272529,1.1309761,1.134769,1.1386329,1.1425683,1.1465765,1.1506585,1.1548159,1.1590493,1.1633599,1.1677494,1.1722182,1.1767682,1.1814005,1.186117,1.1909183,1.1958059,1.2007821,1.2058473,1.2110034,1.2162522,1.2215958,1.2270346,1.2325711,1.2382076,1.2439448,1.249785,1.2557302,1.2617829,1.2679441,1.2742165,1.2806027,1.2871039,1.2937227,1.3004624,1.307324,1.3143107,1.321425,1.3286701,1.3360476,1.3435612,1.3512139,1.3590078,1.3669467,1.3750333,1.383272,1.3916647,1.4002156,1.4089292,1.4178075,1.4268551,1.436076,1.4454755,1.4550558,1.4648223,1.4747804,1.484933,1.4952861,1.5058444,1.5166142,1.5275992,1.5388057,1.5502406,1.5619081,1.5738152,1.5859684,1.5983757,1.6110417,1.6239747,1.6371837,1.6506739,1.6644543,1.6785342,1.6929228,1.7076273,1.722658,1.7380264,1.7537403,1.7698114,1.7862512,1.8030727,1.8202851,1.8379028,1.8559405,1.8744092,1.8933247,1.912704,1.9325595,1.9529098,1.9737723,1.9951665,2.0171087,2.0396204,2.0627248,2.08644,2.1107914,2.1358035,2.1615038,2.1879158,2.21507,2.2429988,2.2717297,2.3012981,2.33174,2.3630953,2.3953989,2.428695,2.4630318,2.4984505,2.5350044,2.5727472,2.611739,2.6520338,2.6937,2.73681,2.7814302,2.8276432,2.8755333,2.9251957,2.976719,3.0302117,3.0857913,3.1435697,3.2036822,3.2662702,3.3314924,3.399504,3.4704902,3.544654,3.6221962,3.703357,3.788391,3.877587,3.9712372,4.069688,4.1733217,4.2825365,4.3977995,4.5196223,4.648587,4.785311,4.930522,5.0850425,5.249762,5.4257317,5.614154,5.8163543,6.0339117,6.2686343,6.522648,6.798374,7.098732,7.427194,7.787818,8.185589,8.62654,9.118129,9.669485,10.292247,11.001277,11.815652,12.760781,13.870852,15.193239,16.794922,18.774933,21.285395,24.571651,29.059265,35.554047,45.79108,64.30826,107.97648,336.52463,-301.40817,-104.09142,-62.90994,-45.076633,-35.12255,-28.770437,-24.364557,-21.129858,-18.65404,-16.69815,-15.113913,-13.804833,-12.704911,-11.767688,-10.959707,-10.255932,-9.637445,-9.089608,-8.601065,-8.162665,-7.76705,-7.408318,-7.0815287,-6.7825837,-6.508126,-6.255254,-6.0215263,-5.8048396,-5.603437,-5.4157486,-5.240412,-5.0762806,-4.9223075,-4.777583,-4.6412926,-4.5127473,-4.3912992,-4.2763715,-4.167476,-4.0641456,-3.965964,-3.8725681,-3.7836123,-3.6987946,-3.6178393,-3.5404856,-3.4665082,-3.395687,-3.3278341,-3.2627635,-3.2003129,-3.1403322,-3.082676,-3.0272186,-2.9738348,-2.9224167,-2.8728561,-2.8250582,-2.7789352,-2.7343984,-2.6913733,-2.6497824,-2.609561,-2.570641,-2.5329633,-2.496473,-2.461114,-2.4268384,-2.3935964,-2.361345,-2.3300433,-2.2996492,-2.2701278,-2.241441,-2.2135577,-2.186444,-2.160071,-2.134411,-2.109435,-2.0851192,-2.0614374,-2.038368,-2.0158873,-1.9939748,-1.9726119,-1.9517773,-1.9314547,-1.911625,-1.8922732,-1.873382,-1.8549367,-1.8369237,-1.819328,-1.8021374,-1.7853378,-1.768918,-1.7528666,-1.7371716,-1.7218232,-1.7068101,-1.6921233,-1.6777523,-1.6636887,-1.6499242,-1.6364492,-1.6232568,-1.6103381,-1.5976866,-1.585294,-1.5731539,-1.5612602,-1.5496054,-1.538184,-1.5269893,-1.5160164,-1.5052587,-1.4947114,-1.4843694,-1.4742272,-1.4642806,-1.454524,-1.4449534,-1.4355648,-1.426353,-1.4173146,-1.4084454,-1.3997416,-1.3911991,-1.3828146,-1.374585,-1.3665061,-1.3585755,-1.3507892,-1.3431447,-1.3356384,-1.3282678,-1.3210305,-1.3139231,-1.3069433,-1.3000882,-1.293356,-1.2867432,-1.2802482,-1.2738689,-1.2676024,-1.2614472,-1.2554007,-1.2494609,-1.2436265,-1.2378948,-1.2322643,-1.2267329,-1.2212993,-1.2159613,-1.2107174,-1.2055663,-1.2005059,-1.1955351,-1.190652,-1.1858554,-1.1811438,-1.1765158,-1.1719704,-1.1675056,-1.1631209,-1.1588144,-1.1545854,-1.1504322,-1.1463541,-1.14235,-1.1384183,-1.1345587,-1.1307695,-1.1270502,-1.1233993,-1.1198161,-1.1163,-1.1128495,-1.1094643,-1.106143,-1.1028851,-1.0996898,-1.0965561,-1.0934834,-1.0904709,-1.0875179,-1.0846236,-1.0817872,-1.0790083,-1.0762861,-1.0736201,-1.0710093,-1.0684534,-1.0659518,-1.0635037,-1.061109,-1.0587666,-1.0564764,-1.0542375,-1.0520496,-1.0499123,-1.047825,-1.0457873,-1.0437987,-1.0418589,-1.0399672,-1.0381234,-1.036327,-1.0345777,-1.0328752,-1.0312189,-1.0296086,-1.0280437,-1.0265244,-1.02505,-1.0236202,-1.0222348,-1.0208935,-1.019596,-1.0183419,-1.0171312,-1.0159634,-1.0148386,-1.0137562,-1.012716,-1.0117182,-1.010762,-1.0098476,-1.0089749,-1.0081434,-1.0073531,-1.0066038,-1.0058955,-1.0052278,-1.0046008,-1.0040143,-1.003468,-1.002962,-1.0024962,-1.0020704,-1.0016847,-1.0013387,-1.0010326,-1.0007663,-1.0005397,-1.0003527,-1.0002054,-1.0000978,-1.0000296,-1.000001,-1.000012,-1.0000625,-1.0001526,-1.0002823,-1.0004516,-1.0006605,-1.0009092,-1.0011976,-1.0015258,-1.0018939,-1.0023018,-1.0027498,-1.0032378,-1.0037662,-1.0043348,-1.0049438,-1.0055933,-1.0062836,-1.0070146,-1.0077866,-1.0085998,-1.0094541,-1.01035,-1.0112875,-1.0122668,-1.013288,-1.0143516,-1.0154575,-1.0166063,-1.0177978,-1.0190325,-1.0203108,-1.0216324,-1.0229982,-1.0244082,-1.0258628,-1.0273621,-1.0289066,-1.0304966,-1.0321323,-1.0338143,-1.0355428,-1.0373182,-1.0391408,-1.0410111,-1.0429295,-1.0448964,-1.0469121,-1.0489774,-1.0510923,-1.0532576,-1.0554737,-1.057741,-1.0600601,-1.0624316,-1.0648559,-1.0673335,-1.0698652,-1.0724514,-1.0750928,-1.07779,-1.0805436,-1.0833544,-1.0862226,-1.0891496,-1.0921354,-1.0951813,-1.0982878,-1.1014555,-1.1046855,-1.1079783,-1.1113352,-1.1147563,-1.1182432,-1.1217965,-1.125417,-1.1291058,-1.1328638,-1.136692,-1.1405914,-1.1445632,-1.1486083,-1.1527277,-1.1569229,-1.1611948,-1.1655446,-1.1699736,-1.174483,-1.1790743,-1.1837482,-1.188507,-1.1933511,-1.198283,-1.2033033,-1.2084138,-1.2136164,-1.218912,-1.224303,-1.2297906,-1.2353768,-1.2410634,-1.2468519,-1.2527446,-1.258743,-1.2648498,-1.2710663,-1.2773954,-1.2838387,-1.2903985,-1.2970774,-1.3038774,-1.3108015,-1.3178517,-1.325031,-1.3323421,-1.3397874,-1.34737,-1.3550928,-1.362959,-1.3709717,-1.3791337,-1.3874489,-1.3959202,-1.404552,-1.413347,-1.4223099,-1.431444,-1.4407533,-1.4502426,-1.4599155,-1.4697772,-1.4798316,-1.4900843,-1.5005397,-1.5112027,-1.5220793,-1.5331744,-1.5444944,-1.5560443,-1.5678314,-1.5798612,-1.5921401,-1.6046758,-1.6174744,-1.6305444,-1.6438926,-1.6575273,-1.6714567,-1.6856896,-1.7002348,-1.7151016,-1.7302995,-1.745839,-1.7617304,-1.7779849,-1.794614,-1.811629,-1.8290429,-1.8468685,-1.8651195,-1.88381,-1.9029552,-1.9225706,-1.9426718,-1.9632764,-1.984402,-2.0060673,-2.0282922,-2.0510974,-2.074504,-2.0985346,-2.1232138,-2.1485662,-2.1746185,-2.2013984,-2.228936,-2.257261,-2.286407,-2.3164082,-2.3473012,-2.3791249,-2.4119198,-2.4457307,-2.4806015,-2.5165823,-2.5537243,-2.5920837,-2.6317184,-2.6726923,-2.7150705,-2.758925,-2.8043325,-2.8513741,-2.9001377,-2.9507167,-3.0032134,-3.057734,-3.114396,-3.1733258,-3.2346587,-3.2985427,-3.3651378,-3.434615,-3.5071628,-3.582986,-3.6623087,-3.745375,-3.832451,-3.923834,-4.0198417,-4.120833,-4.2272005,-4.339381,-4.4578595,-4.5831776,-4.715935,-4.8568106,-5.0065656,-5.1660604,-5.336271,-5.518304,-5.7134333,-5.9231067,-6.1490083,-6.3930874,-6.657619,-6.945273,-7.2592134,-7.6031876,-7.9817114,-8.4002495,-8.865481,-9.385659,-9.971103,-10.634905,-11.393858,-12.269982,-13.292639,-14.501891,-15.953869,-17.729773,-19.951403,-22.81059,-26.627575,-31.980213,-40.028214,-53.491856,-80.60864,-163.4937,5781.272,154.74171,78.42193,52.5205,39.481663,31.630447,26.3847,22.632168,19.814814,17.621862,15.866507,14.429672,13.231966,12.218293,11.349296,10.596094,9.937012,9.355455,8.838547,8.376082,7.9599066,7.5834146,7.2412024,6.928805,6.6424937,6.3791533,6.13613,5.9111686,5.702337,5.5079675,5.326612,5.1570187,4.998084,4.8488383,4.7084284,4.5760975,4.451173,4.3330517,4.2212033,4.115142,4.014435,3.9186902,3.8275545,3.740706,3.657851,3.5787268,3.503089,3.430715,3.3614016,3.2949612,3.2312205,3.1700232,3.1112216,3.0546806,3.0002744,2.947887,2.8974102,2.8487427,2.801793,2.7564733,2.7127018,2.6704028,2.629505,2.589941,2.5516503,2.5145733,2.478655,2.4438438,2.410091,2.37735,2.3455782,2.3147352,2.284782,2.255682,2.227401,2.1999063,2.173167,2.147154,2.121839,2.0971963,2.0732005,2.0498273,2.027055,2.0048614,1.9832261,1.9621295,1.9415532,1.9214791,1.9018902,1.8827705,1.8641045,1.8458772,1.8280745,1.8106829,1.7936891,1.7770813,1.7608471,1.7449752,1.7294548,1.7142752,1.6994265,1.6848987,1.6706828,1.6567699,1.643151,1.6298183,1.6167636,1.6039793,1.5914582,1.5791929,1.5671767,1.5554032,1.5438658,1.5325586,1.5214753,1.5106107,1.4999592,1.4895151,1.4792737,1.4692298,1.4593787,1.449716,1.4402368,1.430937,1.4218124,1.4128591,1.404073,1.3954502,1.3869874,1.3786808,1.3705269,1.3625226,1.3546643,1.3469492,1.3393743,1.3319365,1.3246329,1.3174607,1.3104174,1.3035003,1.2967068,1.2900347,1.2834812,1.2770443,1.2707217,1.264511,1.2584103,1.2524176,1.2465308,1.2407479,1.2350669,1.2294863,1.224004,1.2186184,1.2133276,1.2081305,1.2030249,1.1980094,1.1930826,1.1882429,1.183489,1.1788195,1.1742328,1.1697279,1.1653033,1.1609579,1.1566902,1.1524993,1.1483839,1.1443428,1.1403751,1.1364796,1.1326553,1.1289011,1.1252161,1.1215993,1.1180497,1.1145666,1.1111488,1.1077956,1.1045061,1.1012797,1.0981153,1.0950123,1.0919697,1.088987,1.0860634,1.0831982,1.0803907,1.0776402,1.0749462,1.0723078,1.0697246,1.0671958,1.0647211,1.0622997,1.0599313,1.0576149,1.0553504,1.0531372,1.0509747,1.0488625,1.0468,1.0447869,1.0428227,1.040907,1.0390393,1.0372193,1.0354465,1.0337206,1.0320412,1.0304079,1.0288205,1.0272784,1.0257816,1.0243295,1.0229219,1.0215586,1.0202392,1.0189636,1.0177312,1.016542,1.0153956,1.014292,1.0132308,1.0122118,1.0112349,1.0102997,1.0094061,1.008554,1.0077431,1.0069734,1.0062445,1.0055566,1.0049093,1.0043025,1.0037361,1.00321,1.0027242,1.0022783,1.0018725,1.0015067,1.0011808,1.0008945,1.000648,1.0004413,1.0002742,1.0001466,1.0000588,1.0000104,1.0000015],"x":[-359.9,-359.53964,-359.1793,-358.8189,-358.45856,-358.0982,-357.73782,-357.37747,-357.01712,-356.65677,-356.2964,-355.93604,-355.57568,-355.2153,-354.85495,-354.4946,-354.13425,-353.77386,-353.4135,-353.05316,-352.69278,-352.33243,-351.97208,-351.61172,-351.25134,-350.891,-350.53064,-350.17026,-349.8099,-349.44955,-349.0892,-348.72882,-348.36847,-348.00812,-347.64774,-347.28738,-346.92703,-346.56668,-346.2063,-345.84595,-345.4856,-345.1252,-344.76486,-344.4045,-344.04416,-343.68378,-343.32343,-342.96307,-342.6027,-342.24234,-341.882,-341.5216,-341.16125,-340.8009,-340.44055,-340.08017,-339.71982,-339.35947,-338.99908,-338.63873,-338.27838,-337.91803,-337.55765,-337.1973,-336.83694,-336.47656,-336.1162,-335.75586,-335.3955,-335.03513,-334.67477,-334.31442,-333.95404,-333.5937,-333.23334,-332.873,-332.5126,-332.15225,-331.7919,-331.43152,-331.07117,-330.71082,-330.35046,-329.99008,-329.62973,-329.26938,-328.909,-328.54865,-328.1883,-327.82794,-327.46756,-327.1072,-326.74686,-326.38647,-326.02612,-325.66577,-325.30542,-324.94504,-324.5847,-324.22433,-323.86395,-323.5036,-323.14325,-322.7829,-322.42252,-322.06216,-321.7018,-321.34143,-320.98108,-320.62073,-320.26035,-319.9,-319.53964,-319.1793,-318.8189,-318.45856,-318.0982,-317.73782,-317.37747,-317.01712,-316.65677,-316.2964,-315.93604,-315.57568,-315.2153,-314.85495,-314.4946,-314.13425,-313.77386,-313.4135,-313.05316,-312.69278,-312.33243,-311.97208,-311.61172,-311.25134,-310.891,-310.53064,-310.17026,-309.8099,-309.44955,-309.0892,-308.72882,-308.36847,-308.00812,-307.64774,-307.28738,-306.92703,-306.56668,-306.2063,-305.84595,-305.4856,-305.1252,-304.76486,-304.4045,-304.04416,-303.68378,-303.32343,-302.96307,-302.6027,-302.24234,-301.882,-301.5216,-301.16125,-300.8009,-300.44055,-300.08017,-299.71982,-299.35947,-298.99908,-298.63873,-298.27838,-297.91803,-297.55765,-297.1973,-296.83694,-296.47656,-296.1162,-295.75586,-295.3955,-295.03513,-294.67477,-294.31442,-293.95404,-293.5937,-293.23334,-292.873,-292.5126,-292.15225,-291.7919,-291.43152,-291.07117,-290.71082,-290.35046,-289.99008,-289.62973,-289.26938,-288.909,-288.54865,-288.1883,-287.82794,-287.46756,-287.1072,-286.74686,-286.38647,-286.02612,-285.66577,-285.30542,-284.94504,-284.5847,-284.22433,-283.86395,-283.5036,-283.14325,-282.7829,-282.42252,-282.06216,-281.7018,-281.34143,-280.98108,-280.62073,-280.26035,-279.9,-279.53964,-279.1793,-278.8189,-278.45856,-278.0982,-277.73782,-277.37747,-277.01712,-276.65677,-276.2964,-275.93604,-275.57568,-275.2153,-274.85495,-274.4946,-274.13425,-273.77386,-273.4135,-273.05316,-272.69278,-272.33243,-271.97208,-271.61172,-271.25134,-270.891,-270.53064,-270.17026,-269.8099,-269.44955,-269.0892,-268.72882,-268.36847,-268.00812,-267.64774,-267.28738,-266.92703,-266.56668,-266.2063,-265.84595,-265.4856,-265.1252,-264.76486,-264.4045,-264.04416,-263.68378,-263.32343,-262.96307,-262.6027,-262.24234,-261.882,-261.5216,-261.16125,-260.8009,-260.44055,-260.08017,-259.71982,-259.35947,-258.99908,-258.63873,-258.27838,-257.91803,-257.55765,-257.1973,-256.83694,-256.47656,-256.1162,-255.75586,-255.3955,-255.03514,-254.67477,-254.3144,-253.95406,-253.59369,-253.23334,-252.87297,-252.51262,-252.15225,-251.79189,-251.43153,-251.07117,-250.71082,-250.35045,-249.9901,-249.62973,-249.26936,-248.90901,-248.54865,-248.1883,-247.82793,-247.46758,-247.10721,-246.74684,-246.38649,-246.02612,-245.66577,-245.3054,-244.94504,-244.58469,-244.22432,-243.86397,-243.5036,-243.14325,-242.78288,-242.42252,-242.06216,-241.7018,-241.34145,-240.98108,-240.62073,-240.26036,-239.9,-239.53964,-239.17928,-238.81892,-238.45856,-238.0982,-237.73784,-237.37747,-237.01712,-236.65675,-236.2964,-235.93604,-235.57567,-235.21532,-234.85495,-234.4946,-234.13423,-233.77388,-233.41351,-233.05315,-232.6928,-232.33243,-231.97208,-231.61171,-231.25136,-230.89099,-230.53062,-230.17027,-229.8099,-229.44955,-229.08919,-228.72884,-228.36847,-228.0081,-227.64775,-227.28738,-226.92703,-226.56667,-226.2063,-225.84595,-225.48558,-225.12523,-224.76486,-224.40451,-224.04414,-223.68378,-223.32343,-222.96306,-222.6027,-222.24234,-221.88199,-221.52162,-221.16125,-220.8009,-220.44054,-220.08018,-219.71982,-219.35947,-218.9991,-218.63873,-218.27838,-217.91801,-217.55766,-217.1973,-216.83693,-216.47658,-216.11621,-215.75586,-215.3955,-215.03514,-214.67477,-214.3144,-213.95406,-213.59369,-213.23334,-212.87297,-212.51262,-212.15225,-211.79189,-211.43153,-211.07117,-210.71082,-210.35045,-209.9901,-209.62973,-209.26936,-208.90901,-208.54865,-208.1883,-207.82793,-207.46758,-207.10721,-206.74684,-206.38649,-206.02612,-205.66577,-205.3054,-204.94504,-204.58469,-204.22432,-203.86397,-203.5036,-203.14325,-202.78288,-202.42252,-202.06216,-201.7018,-201.34145,-200.98108,-200.62073,-200.26036,-199.9,-199.53964,-199.17928,-198.81892,-198.45856,-198.0982,-197.73784,-197.37747,-197.01712,-196.65675,-196.2964,-195.93604,-195.57567,-195.21532,-194.85495,-194.4946,-194.13423,-193.77388,-193.41351,-193.05315,-192.6928,-192.33243,-191.97208,-191.61171,-191.25136,-190.89099,-190.53062,-190.17027,-189.8099,-189.44955,-189.08919,-188.72884,-188.36847,-188.0081,-187.64775,-187.28738,-186.92703,-186.56667,-186.2063,-185.84595,-185.48558,-185.12523,-184.76486,-184.40451,-184.04414,-183.68378,-183.32343,-182.96306,-182.6027,-182.24234,-181.88199,-181.52162,-181.16125,-180.8009,-180.44054,-180.08018,-179.71982,-179.35947,-178.9991,-178.63873,-178.27838,-177.91801,-177.55766,-177.1973,-176.83693,-176.47658,-176.11621,-175.75586,-175.3955,-175.03514,-174.67477,-174.3144,-173.95406,-173.59369,-173.23334,-172.87297,-172.51262,-172.15225,-171.79189,-171.43153,-171.07117,-170.71082,-170.35045,-169.9901,-169.62973,-169.26936,-168.90901,-168.54865,-168.1883,-167.82793,-167.46758,-167.10721,-166.74684,-166.38649,-166.02612,-165.66577,-165.3054,-164.94504,-164.58469,-164.22432,-163.86397,-163.5036,-163.14325,-162.78288,-162.42252,-162.06216,-161.7018,-161.34145,-160.98108,-160.62073,-160.26036,-159.9,-159.53964,-159.17928,-158.81892,-158.45856,-158.0982,-157.73784,-157.37747,-157.01712,-156.65675,-156.2964,-155.93604,-155.57567,-155.21532,-154.85495,-154.4946,-154.13423,-153.77388,-153.41351,-153.05315,-152.6928,-152.33243,-151.97208,-151.61171,-151.25136,-150.89099,-150.53062,-150.17027,-149.8099,-149.44955,-149.08919,-148.72884,-148.36847,-148.0081,-147.64775,-147.28738,-146.92703,-146.56667,-146.2063,-145.84595,-145.48558,-145.12523,-144.76486,-144.40451,-144.04414,-143.68378,-143.32343,-142.96306,-142.6027,-142.24234,-141.88199,-141.52162,-141.16125,-140.8009,-140.44054,-140.08018,-139.71982,-139.35947,-138.9991,-138.63873,-138.27838,-137.91801,-137.55766,-137.1973,-136.83693,-136.47658,-136.11621,-135.75586,-135.3955,-135.03514,-134.67477,-134.3144,-133.95406,-133.59369,-133.23334,-132.87297,-132.51262,-132.15225,-131.79189,-131.43153,-131.07117,-130.71082,-130.35045,-129.9901,-129.62973,-129.26936,-128.90901,-128.54865,-128.1883,-127.82793,-127.46757,-127.10721,-126.74685,-126.38649,-126.02612,-125.665764,-125.305405,-124.945045,-124.58469,-124.22433,-123.86396,-123.5036,-123.14324,-122.78288,-122.42252,-122.062164,-121.701805,-121.34144,-120.98108,-120.62072,-120.26036,-119.9,-119.53964,-119.179276,-118.81892,-118.45856,-118.0982,-117.73784,-117.37748,-117.01712,-116.65675,-116.296394,-115.936035,-115.575676,-115.21532,-114.85496,-114.4946,-114.13423,-113.77387,-113.41351,-113.053154,-112.692795,-112.332436,-111.97207,-111.61171,-111.25135,-110.89099,-110.53063,-110.17027,-109.80991,-109.44955,-109.08919,-108.72883,-108.36847,-108.00811,-107.64775,-107.287384,-106.927025,-106.566666,-106.20631,-105.84595,-105.48559,-105.12523,-104.76486,-104.4045,-104.04414,-103.683784,-103.323425,-102.963066,-102.6027,-102.24234,-101.88198,-101.52162,-101.16126,-100.8009,-100.440544,-100.08018,-99.71982,-99.35946,-98.9991,-98.63874,-98.27838,-97.918015,-97.557655,-97.197296,-96.83694,-96.47658,-96.11622,-95.75586,-95.39549,-95.03513,-94.674774,-94.314415,-93.954056,-93.5937,-93.23333,-92.87297,-92.51261,-92.15225,-91.79189,-91.43153,-91.071175,-90.71081,-90.35045,-89.99009,-89.62973,-89.26937,-88.90901,-88.548645,-88.188286,-87.82793,-87.46757,-87.10721,-86.74685,-86.38649,-86.02612,-85.665764,-85.305405,-84.945045,-84.58469,-84.22433,-83.86396,-83.5036,-83.14324,-82.78288,-82.42252,-82.062164,-81.701805,-81.34144,-80.98108,-80.62072,-80.26036,-79.9,-79.53964,-79.179276,-78.81892,-78.45856,-78.0982,-77.73784,-77.37748,-77.01712,-76.65675,-76.296394,-75.936035,-75.575676,-75.21532,-74.85496,-74.4946,-74.13423,-73.77387,-73.41351,-73.053154,-72.692795,-72.332436,-71.97207,-71.61171,-71.25135,-70.89099,-70.53063,-70.17027,-69.80991,-69.44955,-69.08919,-68.72883,-68.36847,-68.00811,-67.64775,-67.287384,-66.927025,-66.566666,-66.20631,-65.84595,-65.48559,-65.12523,-64.76486,-64.4045,-64.04414,-63.683784,-63.323425,-62.963062,-62.602703,-62.242344,-61.88198,-61.52162,-61.161263,-60.8009,-60.44054,-60.08018,-59.71982,-59.35946,-58.9991,-58.63874,-58.278378,-57.91802,-57.55766,-57.197296,-56.836937,-56.476578,-56.116215,-55.755856,-55.395496,-55.035133,-54.674774,-54.314415,-53.954056,-53.593693,-53.233334,-52.872974,-52.51261,-52.152252,-51.791893,-51.43153,-51.07117,-50.71081,-50.35045,-49.99009,-49.62973,-49.26937,-48.909008,-48.54865,-48.18829,-47.827927,-47.467567,-47.10721,-46.746845,-46.386486,-46.026127,-45.665768,-45.305405,-44.945045,-44.584686,-44.224323,-43.863964,-43.503605,-43.14324,-42.782883,-42.422523,-42.06216,-41.7018,-41.341442,-40.981083,-40.62072,-40.26036,-39.9,-39.53964,-39.17928,-38.81892,-38.458557,-38.098198,-37.73784,-37.377476,-37.017117,-36.656757,-36.2964,-35.936035,-35.575676,-35.215317,-34.854954,-34.494595,-34.134235,-33.773872,-33.413513,-33.053154,-32.69279,-32.33243,-31.972073,-31.611712,-31.25135,-30.890991,-30.53063,-30.17027,-29.80991,-29.449549,-29.08919,-28.728828,-28.36847,-28.008108,-27.647747,-27.287388,-26.927027,-26.566668,-26.206306,-25.845945,-25.485586,-25.125225,-24.764864,-24.404505,-24.044144,-23.683784,-23.323423,-22.963062,-22.602703,-22.242342,-21.881983,-21.521622,-21.16126,-20.800901,-20.44054,-20.080181,-19.71982,-19.359459,-18.9991,-18.638739,-18.278378,-17.918018,-17.557657,-17.197298,-16.836937,-16.476576,-16.116217,-15.755856,-15.395495,-15.035135,-14.674775,-14.314414,-13.954054,-13.593694,-13.233334,-12.872973,-12.512612,-12.152252,-11.791892,-11.431532,-11.071171,-10.710811,-10.3504505,-9.99009,-9.629729,-9.269369,-8.909009,-8.548649,-8.188289,-7.827928,-7.4675674,-7.1072073,-6.7468467,-6.3864865,-6.026126,-5.665766,-5.3054056,-4.945045,-4.584685,-4.224324,-3.863964,-3.5036037,-3.1432433,-2.782883,-2.4225225,-2.0621622,-1.7018018,-1.3414414,-0.98108107,-0.62072074,-0.26036036,0.1]} diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/positive.json b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/positive.json new file mode 100644 index 000000000000..77208a37525b --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/positive.json @@ -0,0 +1 @@ +{"expected":[1.0000015,1.0000323,1.0001025,1.0002123,1.0003617,1.0005506,1.0007792,1.0010474,1.0013553,1.001703,1.0020906,1.002518,1.0029856,1.0034932,1.004041,1.0046291,1.0052577,1.0059268,1.0066367,1.0073874,1.0081791,1.0090119,1.0098859,1.0108016,1.0117588,1.012758,1.0137992,1.0148827,1.0160087,1.0171775,1.0183892,1.0196441,1.0209426,1.0222849,1.023671,1.0251017,1.0265769,1.0280969,1.0296624,1.0312732,1.0329303,1.0346334,1.0363832,1.03818,1.0400243,1.0419164,1.0438566,1.0458455,1.0478835,1.049971,1.0521085,1.0542965,1.0565354,1.0588257,1.0611682,1.063563,1.066011,1.0685124,1.0710682,1.0736787,1.0763445,1.0790664,1.0818449,1.0846809,1.0875747,1.0905273,1.0935392,1.0966114,1.0997443,1.102939,1.106196,1.1095164,1.1129009,1.1163503,1.1198654,1.1234474,1.1270971,1.1308154,1.1346033,1.1384617,1.1423918,1.1463946,1.1504711,1.1546226,1.15885,1.1631546,1.1675377,1.1720003,1.176544,1.1811697,1.1858791,1.1906735,1.1955541,1.2005227,1.2055805,1.2107291,1.2159702,1.2213053,1.2267361,1.2322643,1.2378917,1.24362,1.2494513,1.2553873,1.2614301,1.2675817,1.2738442,1.2802198,1.2867105,1.2933186,1.3000467,1.3068972,1.3138722,1.3209748,1.3282073,1.3355722,1.3430729,1.3507121,1.3584925,1.3664173,1.3744898,1.3827132,1.391091,1.3996265,1.4083234,1.4171854,1.4262162,1.4354202,1.4448009,1.4543631,1.4641109,1.4740487,1.4841816,1.4945142,1.5050515,1.5157989,1.5267617,1.5379452,1.5493555,1.5609986,1.5728805,1.585008,1.5973874,1.6100256,1.6229303,1.6361088,1.6495688,1.663318,1.6773657,1.6917195,1.7063894,1.7213846,1.7367151,1.7523907,1.7684224,1.7848213,1.8015991,1.818768,1.8363403,1.8543296,1.8727493,1.8916144,1.9109398,1.9307412,1.9510349,1.9718387,1.9931703,2.0150492,2.0374951,2.060529,2.084173,2.10845,2.1333847,2.1590028,2.1853306,2.2123973,2.2402322,2.2688673,2.2983363,2.3286736,2.3599167,2.3921058,2.4252825,2.4594908,2.494778,2.5311937,2.5687916,2.6076276,2.6477625,2.68926,2.7321885,2.7766204,2.8226354,2.870317,2.9197543,2.9710438,3.0242894,3.079602,3.137102,3.1969185,3.2591918,3.3240736,3.3917274,3.4623308,3.5360804,3.613186,3.6938782,3.7784092,3.8670568,3.960124,4.0579457,4.1608906,4.269368,4.383831,4.504781,4.6327853,4.7684703,4.912544,5.0658007,5.2291403,5.403586,5.5903,5.790617,6.006069,6.2384295,6.4897594,6.762462,7.059387,7.3838887,7.739981,8.132497,8.567307,9.051617,9.594365,10.206782,10.903172,11.702044,12.627753,13.713119,15.003252,16.562069,18.483177,20.909374,24.069859,28.357218,34.504585,44.05719,60.92735,98.74045,260.29013,-409.14627,-114.54758,-66.59769,-46.947296,-36.25213,-29.526745,-24.90705,-21.538094,-18.97259,-16.95381,-15.32391,-13.98039,-12.853933,-11.895902,-11.07118,-10.353781,-9.724058,-9.166883,-8.670425,-8.225286,-7.823915,-7.4601817,-7.129029,-6.826284,-6.548453,-6.2925916,-6.0562024,-5.837154,-5.633612,-5.443995,-5.266928,-5.1012115,-4.945795,-4.799755,-4.6622686,-4.5326133,-4.410144,-4.2942834,-4.184516,-4.0803776,-3.98145,-3.887356,-3.797753,-3.7123315,-3.63081,-3.5529273,-3.4784505,-3.4071639,-3.33887,-3.2733867,-3.2105467,-3.1501963,-3.0921931,-3.0364048,-2.9827094,-2.9309943,-2.8811548,-2.833091,-2.7867124,-2.741935,-2.6986785,-2.656869,-2.616437,-2.5773172,-2.5394492,-2.5027752,-2.4672415,-2.4327981,-2.3993962,-2.366991,-2.3355408,-2.305005,-2.2753463,-2.2465289,-2.2185185,-2.1912837,-2.1647942,-2.1390207,-2.1139362,-2.0895157,-2.065733,-2.042565,-2.0199902,-1.9979872,-1.9765354,-1.9556158,-1.93521,-1.9153006,-1.8958709,-1.876905,-1.8583876,-1.8403038,-1.8226398,-1.8053824,-1.7885187,-1.7720364,-1.7559241,-1.7401702,-1.724764,-1.7096951,-1.6949537,-1.6805304,-1.6664157,-1.6526005,-1.6390771,-1.6258367,-1.6128718,-1.600175,-1.5877383,-1.5755558,-1.5636195,-1.551924,-1.5404623,-1.529229,-1.5182173,-1.5074229,-1.496839,-1.4864616,-1.4762846,-1.466304,-1.4565144,-1.4469112,-1.4374905,-1.4282475,-1.4191786,-1.4102792,-1.4015461,-1.3929749,-1.3845626,-1.3763049,-1.3681993,-1.360242,-1.3524295,-1.3447596,-1.3372282,-1.3298334,-1.3225714,-1.3154404,-1.3084371,-1.3015592,-1.294804,-1.2881695,-1.281653,-1.2752519,-1.2689646,-1.2627884,-1.2567217,-1.250762,-1.2449076,-1.2391564,-1.2335068,-1.2279565,-1.2225044,-1.2171483,-1.2118863,-1.2067174,-1.2016394,-1.1966512,-1.1917511,-1.1869378,-1.1822096,-1.1775653,-1.1730034,-1.168523,-1.1641225,-1.1598003,-1.155556,-1.1513876,-1.1472946,-1.1432754,-1.1393293,-1.135455,-1.1316515,-1.1279179,-1.124253,-1.120656,-1.1171261,-1.1136621,-1.1102633,-1.1069288,-1.1036577,-1.1004493,-1.0973026,-1.0942171,-1.0911918,-1.0882261,-1.0853192,-1.0824705,-1.0796794,-1.0769448,-1.0742667,-1.0716438,-1.069076,-1.0665624,-1.0641028,-1.061696,-1.0593421,-1.0570402,-1.0547899,-1.0525906,-1.0504419,-1.0483434,-1.0462943,-1.0442946,-1.0423435,-1.0404408,-1.0385859,-1.0367786,-1.0350183,-1.0333048,-1.0316378,-1.0300165,-1.0284411,-1.0269109,-1.0254258,-1.0239853,-1.0225892,-1.0212373,-1.0199292,-1.0186645,-1.0174432,-1.0162649,-1.0151294,-1.0140364,-1.0129858,-1.0119773,-1.0110108,-1.0100859,-1.0092026,-1.0083606,-1.0075598,-1.0068,-1.0060811,-1.005403,-1.0047654,-1.0041683,-1.0036116,-1.0030949,-1.0026186,-1.0021821,-1.0017858,-1.0014291,-1.0011123,-1.0008353,-1.000598,-1.0004002,-1.000242,-1.0001235,-1.0000445,-1.000005,-1.000005,-1.0000445,-1.0001235,-1.000242,-1.0004002,-1.000598,-1.0008353,-1.0011123,-1.0014291,-1.0017858,-1.0021821,-1.0026186,-1.0030949,-1.0036116,-1.0041683,-1.0047654,-1.005403,-1.0060811,-1.0068,-1.0075598,-1.0083606,-1.0092026,-1.0100859,-1.0110108,-1.0119773,-1.0129858,-1.0140364,-1.0151294,-1.0162649,-1.0174432,-1.0186645,-1.0199292,-1.0212373,-1.0225892,-1.0239853,-1.0254258,-1.0269109,-1.0284411,-1.0300165,-1.0316378,-1.0333048,-1.0350183,-1.0367786,-1.0385859,-1.0404408,-1.0423435,-1.0442946,-1.0462943,-1.0483434,-1.0504419,-1.0525906,-1.0547899,-1.0570402,-1.0593421,-1.061696,-1.0641028,-1.0665624,-1.069076,-1.0716438,-1.0742667,-1.0769448,-1.0796794,-1.0824705,-1.0853192,-1.0882261,-1.0911918,-1.0942171,-1.0973026,-1.1004493,-1.1036577,-1.1069288,-1.1102633,-1.1136621,-1.1171261,-1.120656,-1.124253,-1.1279179,-1.1316515,-1.135455,-1.1393293,-1.1432754,-1.1472946,-1.1513876,-1.155556,-1.1598003,-1.1641225,-1.168523,-1.1730034,-1.1775653,-1.1822096,-1.1869378,-1.1917511,-1.1966512,-1.2016394,-1.2067174,-1.2118863,-1.2171483,-1.2225044,-1.2279565,-1.2335068,-1.2391564,-1.2449076,-1.250762,-1.2567217,-1.2627884,-1.2689646,-1.2752519,-1.281653,-1.2881695,-1.294804,-1.3015592,-1.3084371,-1.3154404,-1.3225714,-1.3298334,-1.3372282,-1.3447596,-1.3524295,-1.360242,-1.3681993,-1.3763049,-1.3845626,-1.3929749,-1.4015461,-1.4102792,-1.4191786,-1.4282475,-1.4374905,-1.4469112,-1.4565144,-1.466304,-1.4762846,-1.4864616,-1.496839,-1.5074229,-1.5182173,-1.529229,-1.5404623,-1.551924,-1.5636195,-1.5755558,-1.5877383,-1.600175,-1.6128718,-1.6258365,-1.6390771,-1.6526003,-1.6664157,-1.6805301,-1.694954,-1.7096951,-1.7247642,-1.7401702,-1.7559243,-1.7720364,-1.7885183,-1.8053824,-1.8226395,-1.8403038,-1.8583871,-1.8769052,-1.8958709,-1.9153011,-1.93521,-1.9556162,-1.9765354,-1.9979867,-2.0199902,-2.0425646,-2.065733,-2.089515,-2.113937,-2.1390207,-2.1647947,-2.1912837,-2.2185192,-2.2465289,-2.2753458,-2.305005,-2.33554,-2.366991,-2.3993955,-2.4327981,-2.4672415,-2.502776,-2.5394492,-2.5773182,-2.616437,-2.65687,-2.6986785,-2.7419338,-2.7867124,-2.8330898,-2.8811548,-2.9309943,-2.9827106,-3.0364048,-3.092194,-3.1501963,-3.210548,-3.2733867,-3.3388684,-3.4071639,-3.478449,-3.5529273,-3.630808,-3.7123332,-3.797753,-3.8873577,-3.98145,-4.08038,-4.1845117,-4.294281,-4.410144,-4.532616,-4.662263,-4.7997518,-4.945798,-5.101218,-5.2669244,-5.443995,-5.633616,-5.8371625,-6.056198,-6.2925916,-6.5484586,-6.8262715,-7.129022,-7.4601817,-7.823931,-8.225277,-8.670425,-9.166895,-9.724083,-10.353766,-11.07118,-11.895921,-12.853889,-13.980364,-15.32391,-16.953886,-18.97254,-21.538094,-24.907133,-29.526978,-36.251957,-46.947296,-66.59828,-114.54408,-409.124,260.29013,98.73785,60.92784,44.05719,34.50443,28.357004,24.069935,20.909374,18.483131,16.562143,15.003283,13.713119,12.627733,11.702063,10.903172,10.206768,9.594341,9.051628,8.567307,8.132488,7.7399964,7.3838954,7.059387,6.7624564,6.489765,6.2384295,6.0060644,5.7906084,5.5903044,5.403586,5.229137,5.065807,4.912547,4.7684703,4.6327825,4.5047865,4.383831,4.269366,4.1608863,4.0579476,3.960124,3.867055,3.778413,3.6938798,3.613186,3.5360785,3.4623337,3.3917274,3.324072,3.2591891,3.1969197,3.137102,3.0796006,3.0242915,2.971045,2.9197543,2.8703158,2.8226373,2.7766213,2.7321875,2.689258,2.6477633,2.6076276,2.568791,2.5311954,2.4947786,2.4594908,2.4252818,2.3921072,2.3599174,2.3286731,2.2983348,2.2688682,2.2402322,2.2123966,2.1853294,2.1590033,2.1333847,2.1084495,2.084174,2.0605292,2.037495,2.0150485,1.993171,1.9718387,1.9510344,1.9307402,1.9109402,1.8916144,1.872749,1.8543302,1.8363404,1.8187678,1.8015987,1.7848217,1.7684226,1.7523904,1.7367144,1.721385,1.7063894,1.6917192,1.677366,1.6633183,1.6495686,1.6361083,1.6229308,1.6100258,1.5973871,1.5850074,1.5728807,1.5609986,1.5493551,1.5379456,1.5267617,1.5157988,1.5050513,1.4945146,1.4841818,1.4740486,1.4641105,1.4543632,1.4448009,1.4354198,1.4262166,1.4171855,1.4083233,1.3996263,1.3910912,1.3827133,1.3744897,1.3664169,1.3584926,1.3507121,1.3430729,1.3355726,1.3282073,1.3209747,1.3138721,1.3068973,1.3000468,1.2933186,1.2867101,1.2802199,1.2738442,1.2675816,1.2614304,1.2553874,1.2494513,1.2436199,1.2378918,1.2322643,1.226736,1.221305,1.2159703,1.2107291,1.2055804,1.2005229,1.1955543,1.1906735,1.185879,1.18117,1.176544,1.1720003,1.1675375,1.1631547,1.15885,1.1546224,1.1504713,1.1463946,1.1423918,1.1384616,1.1346034,1.1308154,1.127097,1.1234473,1.1198655,1.1163503,1.1129007,1.1095163,1.106196,1.1029389,1.0997442,1.0966114,1.0935392,1.0905272,1.0875746,1.0846809,1.081845,1.0790664,1.0763444,1.0736787,1.0710682,1.0685123,1.066011,1.0635631,1.0611682,1.0588257,1.0565355,1.0542965,1.0521084,1.049971,1.0478835,1.0458455,1.0438565,1.0419164,1.0400243,1.03818,1.0363832,1.0346334,1.0329303,1.0312732,1.0296623,1.028097,1.0265769,1.0251017,1.0236712,1.0222849,1.0209426,1.0196441,1.0183892,1.0171775,1.0160086,1.0148827,1.0137992,1.012758,1.0117588,1.0108016,1.0098859,1.0090119,1.008179,1.0073874,1.0066367,1.0059268,1.0052577,1.0046291,1.004041,1.0034932,1.0029856,1.002518,1.0020906,1.0017029,1.0013553,1.0010474,1.0007792,1.0005505,1.0003617,1.0002123,1.0001025,1.0000323,1.0000015],"x":[0.1,0.46016017,0.8203203,1.1804805,1.5406406,1.9008008,2.260961,2.6211212,2.9812813,3.3414414,3.7016015,4.061762,4.4219217,4.782082,5.1422424,5.5024023,5.8625627,6.2227225,6.582883,6.943043,7.303203,7.6633635,8.023523,8.383684,8.743844,9.104004,9.464164,9.824325,10.1844845,10.544644,10.904805,11.264965,11.625125,11.985286,12.345446,12.7056055,13.065765,13.425926,13.786086,14.146246,14.506407,14.866567,15.226727,15.586887,15.947047,16.307207,16.667368,17.027527,17.387688,17.747849,18.108007,18.468168,18.82833,19.188488,19.548649,19.90881,20.268969,20.62913,20.98929,21.34945,21.70961,22.069769,22.42993,22.79009,23.15025,23.51041,23.870571,24.23073,24.59089,24.951052,25.31121,25.671371,26.031532,26.391691,26.751852,27.112013,27.472172,27.832333,28.192493,28.552652,28.912813,29.272972,29.633133,29.993294,30.353453,30.713614,31.073774,31.433933,31.794094,32.154255,32.514416,32.874573,33.234734,33.594894,33.955055,34.315216,34.675377,35.035534,35.395695,35.755856,36.116016,36.476177,36.836338,37.196495,37.556656,37.916817,38.276978,38.63714,38.9973,39.357456,39.717617,40.077778,40.43794,40.7981,41.158257,41.518417,41.87858,42.23874,42.5989,42.95906,43.319218,43.67938,44.03954,44.3997,44.75986,45.12002,45.48018,45.84034,46.2005,46.56066,46.920822,47.28098,47.64114,48.0013,48.36146,48.721622,49.081783,49.44194,49.8021,50.162262,50.522423,50.882584,51.242744,51.6029,51.963062,52.323223,52.683384,53.043545,53.403706,53.763863,54.124023,54.484184,54.844345,55.204506,55.564663,55.924824,56.284985,56.645145,57.005306,57.365467,57.725624,58.085785,58.445946,58.806107,59.166267,59.52643,59.886585,60.246746,60.606907,60.967068,61.32723,61.687386,62.047546,62.407707,62.767868,63.12803,63.48819,63.848347,64.20851,64.56867,64.928825,65.28899,65.64915,66.00931,66.36947,66.72963,67.08979,67.44995,67.81011,68.17027,68.53043,68.89059,69.25075,69.61091,69.97107,70.33123,70.69139,71.05155,71.41171,71.77187,72.132034,72.492195,72.852356,73.21251,73.57267,73.93283,74.29299,74.65315,75.01331,75.373474,75.733635,76.093796,76.45396,76.81412,77.17427,77.53443,77.89459,78.25475,78.614914,78.975075,79.335236,79.6954,80.05556,80.41572,80.77588,81.13604,81.49619,81.85635,82.216515,82.576675,82.93684,83.297,83.65716,84.01732,84.37748,84.73764,85.0978,85.457954,85.818115,86.178276,86.53844,86.8986,87.25876,87.61892,87.97908,88.33924,88.6994,89.05956,89.41972,89.77988,90.14004,90.5002,90.86036,91.22052,91.58068,91.94084,92.301,92.66116,93.021324,93.381485,93.74164,94.1018,94.46196,94.82212,95.18228,95.54244,95.9026,96.262764,96.622925,96.983086,97.34325,97.7034,98.06356,98.42372,98.78388,99.14404,99.5042,99.864365,100.224525,100.58469,100.94485,101.30501,101.66517,102.02532,102.38548,102.74564,103.105804,103.465965,103.826126,104.18629,104.54645,104.90661,105.26677,105.62693,105.98708,106.347244,106.707405,107.067566,107.42773,107.78789,108.14805,108.50821,108.86837,109.22853,109.58869,109.94885,110.309006,110.66917,111.02933,111.38949,111.74965,112.10981,112.46997,112.83013,113.19029,113.55045,113.910614,114.27077,114.63093,114.99109,115.35125,115.71141,116.07157,116.43173,116.79189,117.152054,117.512215,117.872375,118.23254,118.59269,118.95285,119.31301,119.67317,120.03333,120.39349,120.753654,121.113815,121.473976,121.83414,122.1943,122.55445,122.91461,123.27477,123.63493,123.995094,124.355255,124.715416,125.07558,125.43574,125.7959,126.15606,126.51621,126.87637,127.236534,127.596695,127.956856,128.31702,128.67717,129.03734,129.39749,129.75766,130.11781,130.47798,130.83813,131.1983,131.55846,131.91862,132.27878,132.63895,132.9991,133.35925,133.71942,134.07957,134.43974,134.7999,135.16006,135.52022,135.88039,136.24054,136.60071,136.96086,137.32101,137.68118,138.04134,138.4015,138.76166,139.12183,139.48198,139.84215,140.2023,140.56247,140.92262,141.28278,141.64294,142.0031,142.36327,142.72342,143.08359,143.44374,143.80391,144.16406,144.52423,144.88438,145.24454,145.6047,145.96486,146.32503,146.68518,147.04535,147.4055,147.76567,148.12582,148.486,148.84615,149.2063,149.56647,149.92662,150.28679,150.64694,151.00711,151.36726,151.72743,152.08759,152.44775,152.8079,153.16808,153.52823,153.88838,154.24855,154.6087,154.96887,155.32903,155.6892,156.04935,156.40952,156.76967,157.12984,157.48999,157.85014,158.21031,158.57047,158.93063,159.29079,159.65096,160.01111,160.37128,160.73143,161.0916,161.45175,161.8119,162.17207,162.53223,162.8924,163.25255,163.61272,163.97287,164.33304,164.69319,165.05336,165.41351,165.77367,166.13383,166.49399,166.85416,167.21431,167.57448,167.93463,168.2948,168.65495,169.01512,169.37527,169.73543,170.0956,170.45575,170.81592,171.17607,171.53624,171.8964,172.25656,172.61671,172.97688,173.33704,173.6972,174.05736,174.41751,174.77768,175.13783,175.498,175.85815,176.21832,176.57848,176.93864,177.2988,177.65897,178.01912,178.37927,178.73944,179.0996,179.45976,179.81992,180.18008,180.54024,180.9004,181.26056,181.62073,181.98088,182.34103,182.7012,183.06136,183.42152,183.78168,184.14185,184.502,184.86217,185.22232,185.58249,185.94264,186.3028,186.66296,187.02312,187.38329,187.74344,188.1036,188.46376,188.82393,189.18408,189.54425,189.9044,190.26457,190.62473,190.98488,191.34505,191.7052,192.06537,192.42552,192.78569,193.14584,193.50601,193.86617,194.22633,194.58649,194.94664,195.30681,195.66696,196.02713,196.38728,196.74745,197.1076,197.46777,197.82793,198.1881,198.54825,198.9084,199.26857,199.62872,199.98889,200.34904,200.70921,201.06937,201.42953,201.78969,202.14986,202.51001,202.87016,203.23033,203.59048,203.95065,204.3108,204.67097,205.03113,205.3913,205.75145,206.11162,206.47177,206.83192,207.1921,207.55225,207.91241,208.27257,208.63274,208.99289,209.35306,209.71321,210.07338,210.43353,210.7937,211.15385,211.514,211.87418,212.23433,212.5945,212.95465,213.31482,213.67497,214.03514,214.3953,214.75546,215.11562,215.47577,215.83594,216.19609,216.55626,216.91641,217.27658,217.63673,217.9969,218.35706,218.71722,219.07738,219.43753,219.7977,220.15785,220.51802,220.87817,221.23834,221.5985,221.95866,222.31882,222.67899,223.03914,223.39929,223.75946,224.11961,224.47978,224.83994,225.2001,225.56026,225.92043,226.28058,226.64075,227.0009,227.36105,227.72122,228.08138,228.44154,228.8017,229.16187,229.52202,229.88219,230.24234,230.60251,230.96266,231.32283,231.68298,232.04314,232.4033,232.76346,233.12363,233.48378,233.84395,234.2041,234.56427,234.92442,235.28459,235.64474,236.0049,236.36507,236.72522,237.08539,237.44554,237.80571,238.16586,238.52603,238.88618,239.24635,239.6065,239.96666,240.32683,240.68698,241.04715,241.4073,241.76747,242.12762,242.4878,242.84795,243.20811,243.56827,243.92842,244.28859,244.64874,245.00891,245.36906,245.72923,246.08939,246.44955,246.80971,247.16988,247.53003,247.8902,248.25035,248.6105,248.97067,249.33083,249.691,250.05115,250.41132,250.77147,251.13164,251.49179,251.85196,252.21211,252.57227,252.93243,253.29259,253.65276,254.01291,254.37308,254.73323,255.0934,255.45355,255.81372,256.17386,256.53403,256.8942,257.25436,257.6145,257.97467,258.33484,258.695,259.05515,259.4153,259.77548,260.13565,260.4958,260.85596,261.21613,261.57626,261.93643,262.2966,262.65677,263.0169,263.37708,263.73724,264.0974,264.45755,264.81772,265.1779,265.53802,265.8982,266.25836,266.61853,266.97867,267.33884,267.699,268.05917,268.4193,268.77948,269.13965,269.4998,269.85995,270.22012,270.5803,270.94043,271.3006,271.66077,272.02094,272.38107,272.74124,273.1014,273.46155,273.82172,274.1819,274.54205,274.9022,275.26236,275.62253,275.9827,276.34283,276.703,277.06317,277.4233,277.78348,278.14365,278.5038,278.86395,279.22412,279.5843,279.94446,280.3046,280.66476,281.02493,281.38507,281.74524,282.1054,282.46558,282.8257,283.18588,283.54605,283.90622,284.26636,284.62653,284.9867,285.34683,285.707,286.06717,286.42734,286.78748,287.14764,287.5078,287.86798,288.22812,288.5883,288.94846,289.3086,289.66876,290.02893,290.3891,290.74924,291.1094,291.46957,291.82974,292.18988,292.55005,292.91022,293.27036,293.63052,293.9907,294.35086,294.711,295.07117,295.43134,295.7915,296.15164,296.5118,296.87198,297.23215,297.5923,297.95245,298.31262,298.67276,299.03293,299.3931,299.75327,300.1134,300.47357,300.83374,301.1939,301.55405,301.9142,302.27438,302.63452,302.9947,303.35486,303.71503,304.07516,304.43533,304.7955,305.15567,305.5158,305.87598,306.23615,306.59628,306.95645,307.31662,307.6768,308.03693,308.3971,308.75726,309.11743,309.47757,309.83774,310.1979,310.55804,310.9182,311.27838,311.63855,311.9987,312.35886,312.71902,313.0792,313.43933,313.7995,314.15967,314.5198,314.87997,315.24014,315.6003,315.96045,316.32062,316.6808,317.04095,317.4011,317.76126,318.12143,318.48157,318.84174,319.2019,319.56207,319.9222,320.28238,320.64255,321.00272,321.36285,321.72302,322.0832,322.44333,322.8035,323.16367,323.52383,323.88397,324.24414,324.6043,324.96448,325.32462,325.68478,326.04495,326.4051,326.76526,327.12543,327.4856,327.84573,328.2059,328.56607,328.92624,329.28638,329.64655,330.0067,330.36685,330.72702,331.0872,331.44736,331.8075,332.16766,332.52783,332.888,333.24814,333.6083,333.96848,334.32864,334.68878,335.04895,335.40912,335.76926,336.12943,336.4896,336.84976,337.2099,337.57007,337.93024,338.2904,338.65054,339.0107,339.37088,339.73102,340.0912,340.45135,340.81152,341.17166,341.53183,341.892,342.25217,342.6123,342.97247,343.33264,343.69278,344.05295,344.41312,344.7733,345.13342,345.4936,345.85376,346.21393,346.57407,346.93423,347.2944,347.65454,348.0147,348.37488,348.73505,349.09518,349.45535,349.81552,350.1757,350.53583,350.896,351.25616,351.6163,351.97647,352.33664,352.6968,353.05695,353.4171,353.77728,354.13745,354.4976,354.85776,355.21793,355.57806,355.93823,356.2984,356.65857,357.0187,357.37888,357.73904,358.0992,358.45935,358.81952,359.1797,359.53983,359.9]} diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/runner.jl new file mode 100755 index 000000000000..9ac75bf612bf --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/test/fixtures/julia/runner.jl @@ -0,0 +1,70 @@ +#!/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( domain, name ) + +Generate fixture data and write to file. + +# Arguments + +* `domain`: domain +* `name::AbstractString`: output filename + +# Examples + +``` julia +julia> domain = range( -1000.0, 1000.0, 2001 ); +julia> gen( x, \"data.json\" ); +``` +""" +function gen( domain, name ) + x = collect( domain ); + y = secd.( x ); + + # Store data to be written to file as a collection: + data = Dict([ + ("x", x), + ("expected", y) + ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: + outfile = open( filepath, "w" ); + write( outfile, JSON.json(data) ); + write( outfile, "\n" ); + close( outfile ); +end + +# Get the filename: +file = @__FILE__; + +# Extract the directory in which this file resides: +dir = dirname( file ); + +# Generate fixture data for negative values: +x = Float32.( range( -359.9, stop = 0.1, length = 1000 ) ); +gen( x, "negative.json" ); + +# Generate fixture data for positive values: +x = Float32.( range( 0.1, stop = 359.9, length = 1000 ) ); +gen( x, "positive.json" ); diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/test/test.js b/lib/node_modules/@stdlib/math/base/special/secdf/test/test.js new file mode 100644 index 000000000000..55bc649d0146 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/test/test.js @@ -0,0 +1,109 @@ +/** +* @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 f32 = require( '@stdlib/number/float64/base/to-float32' ); +var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var secdf = require( './../lib' ); + + +// FIXTURES // + +var negative = require( './fixtures/julia/negative.json' ); +var positive = require( './fixtures/julia/positive.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof secdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function computes the secant of an angle measured in degrees (negative values)', function test( t ) { + var expected; + var x; + var y; + var i; + + x = negative.x; + expected = negative.expected; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = secdf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the secant of an angle measured in degrees (positive values)', function test( t ) { + var expected; + var x; + var y; + var i; + + x = positive.x; + expected = positive.expected; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = secdf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `NaN` if provided `NaN`', function test( t ) { + var v = secdf( NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `+Infinity` if provided an odd multiple of `90`', function test( t ) { + var v = secdf( f32( 90.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + v = secdf( f32( -90.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + v = secdf( f32( 270.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + v = secdf( f32( -270.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `1` if provided `+-0`', function test( t ) { + var v; + + v = secdf( f32( 0.0 ) ); + t.strictEqual( v, f32( 1.0 ), 'returns expected value' ); + + v = secdf( f32( -0.0 ) ); + t.strictEqual( v, f32( 1.0 ), 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/secdf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/secdf/test/test.native.js new file mode 100644 index 000000000000..12c9a41a58cc --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/secdf/test/test.native.js @@ -0,0 +1,118 @@ +/** +* @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 f32 = require( '@stdlib/number/float64/base/to-float32' ); +var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var secdf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( secdf instanceof Error ) +}; + + +// FIXTURES // + +var negative = require( './fixtures/julia/negative.json' ); +var positive = require( './fixtures/julia/positive.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof secdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function computes the secant of an angle measured in degrees (negative values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + + x = negative.x; + expected = negative.expected; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = secdf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes the secant of an angle measured in degrees (positive values)', opts, function test( t ) { + var expected; + var x; + var y; + var i; + + x = positive.x; + expected = positive.expected; + + for ( i = 0; i < x.length; i++ ) { + x[ i ] = f32( x[ i ] ); + expected[ i ] = f32( expected[ i ] ); + y = secdf( x[ i ] ); + t.strictEqual( ulpdiff( y, expected[ i ] ) <= 2, true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns `NaN` if provided `NaN`', opts, function test( t ) { + var v = secdf( NaN ); + t.strictEqual( isnanf( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `+Infinity` if provided an odd multiple of `90`', opts, function test( t ) { + var v = secdf( f32( 90.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + v = secdf( f32( -90.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + v = secdf( f32( 270.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + v = secdf( f32( -270.0 ) ); + t.strictEqual( v, PINF, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `1` if provided `+-0`', opts, function test( t ) { + var v; + + v = secdf( f32( 0.0 ) ); + t.strictEqual( v, f32( 1.0 ), 'returns expected value' ); + + v = secdf( f32( -0.0 ) ); + t.strictEqual( v, f32( 1.0 ), 'returns expected value' ); + + t.end(); +});