From 15e7849ae9e2abd232a0cb1d1a4769b1dc01b397 Mon Sep 17 00:00:00 2001 From: Masrul Date: Mon, 30 Nov 2026 13:00:04 +0000 Subject: [PATCH] feat: add `math/base/special/ccisf` Ref: #649 --- .../@stdlib/math/base/special/ccisf/README.md | 275 ++++++++++++++++++ .../ccisf/benchmark/benchmark.assign.js | 69 +++++ .../base/special/ccisf/benchmark/benchmark.js | 64 ++++ .../ccisf/benchmark/benchmark.native.js | 70 +++++ .../ccisf/benchmark/benchmark.strided.js | 67 +++++ .../base/special/ccisf/benchmark/c/Makefile | 127 ++++++++ .../special/ccisf/benchmark/c/benchmark.c | 142 +++++++++ .../special/ccisf/benchmark/c/native/Makefile | 146 ++++++++++ .../ccisf/benchmark/c/native/benchmark.c | 145 +++++++++ .../special/ccisf/benchmark/julia/REQUIRE | 2 + .../ccisf/benchmark/julia/benchmark.jl | 144 +++++++++ .../ccisf/benchmark/python/benchmark.py | 97 ++++++ .../math/base/special/ccisf/binding.gyp | 170 +++++++++++ .../ccisf/docs/img/equation_cis_function.svg | 52 ++++ .../math/base/special/ccisf/docs/repl.txt | 96 ++++++ .../base/special/ccisf/docs/types/index.d.ts | 129 ++++++++ .../base/special/ccisf/docs/types/test.ts | 246 ++++++++++++++++ .../base/special/ccisf/examples/c/Makefile | 146 ++++++++++ .../base/special/ccisf/examples/c/example.c | 46 +++ .../math/base/special/ccisf/examples/index.js | 30 ++ .../math/base/special/ccisf/include.gypi | 53 ++++ .../include/stdlib/math/base/special/ccisf.h | 40 +++ .../math/base/special/ccisf/lib/assign.js | 70 +++++ .../math/base/special/ccisf/lib/index.js | 65 +++++ .../math/base/special/ccisf/lib/main.js | 69 +++++ .../math/base/special/ccisf/lib/native.js | 62 ++++ .../math/base/special/ccisf/lib/strided.js | 54 ++++ .../math/base/special/ccisf/manifest.json | 81 ++++++ .../math/base/special/ccisf/package.json | 206 +++++++++++++ .../math/base/special/ccisf/src/Makefile | 70 +++++ .../math/base/special/ccisf/src/addon.c | 22 ++ .../math/base/special/ccisf/src/main.c | 77 +++++ .../special/ccisf/test/fixtures/julia/REQUIRE | 2 + .../test/fixtures/julia/general_complex.json | 1 + .../ccisf/test/fixtures/julia/pure_real.json | 1 + .../ccisf/test/fixtures/julia/runner.jl | 81 ++++++ .../base/special/ccisf/test/test.assign.js | 193 ++++++++++++ .../math/base/special/ccisf/test/test.js | 44 +++ .../math/base/special/ccisf/test/test.main.js | 166 +++++++++++ .../base/special/ccisf/test/test.native.js | 175 +++++++++++ .../base/special/ccisf/test/test.strided.js | 214 ++++++++++++++ 41 files changed, 4009 insertions(+) create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/README.md create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.assign.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.native.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.strided.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/Makefile create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/benchmark.c create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/native/Makefile create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/native/benchmark.c create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/julia/REQUIRE create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/julia/benchmark.jl create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/python/benchmark.py create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/binding.gyp create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/docs/img/equation_cis_function.svg create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/examples/index.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/include.gypi create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/include/stdlib/math/base/special/ccisf.h create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/lib/assign.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/lib/index.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/lib/main.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/lib/native.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/lib/strided.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/manifest.json create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/package.json create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/src/Makefile create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/src/addon.c create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/src/main.c create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/REQUIRE create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/general_complex.json create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/pure_real.json create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/runner.jl create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/test.assign.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/test.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/test.main.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/test.native.js create mode 100644 lib/node_modules/@stdlib/math/base/special/ccisf/test/test.strided.js diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/README.md b/lib/node_modules/@stdlib/math/base/special/ccisf/README.md new file mode 100644 index 000000000000..365cdb49a949 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/README.md @@ -0,0 +1,275 @@ + + +# ccisf + +> Evaluate the [cis][cis] function for a single-precision complex floating-point number. + +
+ +The [cis][cis] function is defined as + + + +```math +\mathop{\mathrm{cis}}(z) = e^{iz} = \cos(z) + i \sin(z) +``` + + + + + +
+ + + +
+ +## Usage + +```javascript +var ccisf = require( '@stdlib/math/base/special/ccisf' ); +``` + +#### ccisf( z ) + +Evaluates the [cis][cis] function for a single-precision complex floating-point number. + +```javascript +var Complex64 = require( '@stdlib/complex/float32/ctor' ); + +var z = new Complex64( 0.0, 0.0 ); + +var v = ccisf( z ); +// returns [ 1.0, 0.0 ] + +z = new Complex64( 1.0, 0.0 ); + +v = ccisf( z ); +// returns [ ~0.540, ~0.841 ] +``` + +#### ccisf.assign( re, im, out, strideOut, offsetOut ) + +Evaluates the [cis][cis] function for a single-precision complex floating-point number and assigns results to a provided output array. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var out = new Float32Array( 2 ); +var v = ccisf.assign( 0.0, 0.0, out, 1, 0 ); +// returns [ 1.0, 0.0 ] + +var bool = ( out === v ); +// returns true +``` + +The function supports the following parameters: + +- **re**: real component. +- **im**: imaginary component. +- **out**: output array. +- **strideOut**: stride length for `out`. +- **offsetOut**: starting index for `out`. + +#### ccisf.strided( z, sz, oz, out, so, oo ) + +Evaluates the [cis][cis] function for a single-precision complex floating-point number stored in a real-valued strided array view and assigns results to a provided strided output array. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var z = new Float32Array( [ 0.0, 0.0 ] ); +var out = new Float32Array( 2 ); + +var v = ccisf.strided( z, 1, 0, out, 1, 0 ); +// returns [ 1.0, 0.0 ] + +var bool = ( out === v ); +// returns true +``` + +The function supports the following parameters: + +- **z**: complex number strided array view. +- **sz**: stride length for `z`. +- **oz**: starting index for `z`. +- **out**: output array. +- **so**: stride length for `out`. +- **oo**: starting index for `out`. + +
+ + + +
+ +## Examples + + + +```javascript +var Complex64Array = require( '@stdlib/array/complex64' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var ccisf = require( '@stdlib/math/base/special/ccisf' ); + +// Create an array of random numbers: +var arr = new Complex64Array( uniform( 200, -50.0, 50.0 ) ); + +// Compute the cis function of each number in the array: +logEachMap( 'ccisf(%s) = %s', arr, ccisf ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/ccisf.h" +``` + +#### stdlib_base_ccisf( z ) + +Evaluates the [cis][cis] function for a single-precision complex floating-point number. + +```c +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/real.h" +#include "stdlib/complex/float32/imag.h" + +stdlib_complex64_t z = stdlib_complex64( 0.0f, 0.0f ); + +stdlib_complex64_t out = stdlib_base_ccisf( z ); + +float re = stdlib_complex64_real( out ); +// returns 1.0f + +float im = stdlib_complex64_imag( out ); +// returns 0.0f +``` + +The function accepts the following arguments: + +- **z**: `[in] stdlib_complex64_t` input value. + +```c +stdlib_complex64_t stdlib_base_ccisf( const stdlib_complex64_t z ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/ccisf.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" +#include + +int main( void ) { + const stdlib_complex64_t x[] = { + stdlib_complex64( 3.14f, 1.5f ), + stdlib_complex64( -3.14f, -1.5f ), + stdlib_complex64( 0.0f, 0.0f ), + stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) + }; + + stdlib_complex64_t v; + stdlib_complex64_t y; + float re1; + float im1; + float re2; + float im2; + int i; + for ( i = 0; i < 4; i++ ) { + v = x[ i ]; + y = stdlib_base_ccisf( v ); + stdlib_complex64_reim( v, &re1, &im1 ); + stdlib_complex64_reim( y, &re2, &im2 ); + printf( "ccisf(%f + %fi) = %f + %fi\n", re1, im1, re2, im2 ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.assign.js b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.assign.js new file mode 100644 index 000000000000..65711468e289 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.assign.js @@ -0,0 +1,69 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Float32Array = require( '@stdlib/array/float32' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var assign = require( './../lib' ).assign; + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// MAIN // + +bench( format( '%s:assign', pkg ), function benchmark( b ) { + var out; + var re; + var im; + var N; + var i; + var j; + + N = 100; + re = uniform( N, -50.0, 50.0, options ); + im = uniform( N, -50.0, 50.0, options ); + + out = new Float32Array( 2 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + j = i % N; + out = assign( re[ j ], im[ j ], out, 1, 0 ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.js new file mode 100644 index 000000000000..4c35ba0637ea --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.js @@ -0,0 +1,64 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Complex64Array = require( '@stdlib/array/complex64' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var pkg = require( './../package.json' ).name; +var ccisf = require( './../lib' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var zbuf; + var z; + var y; + var i; + + zbuf = uniform( 200, -50.0, 50.0, options ); + z = new Complex64Array( zbuf.buffer ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = ccisf( z.get( i%100 ) ); + if ( isnanf( realf( y ) ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( imagf( y ) ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.native.js new file mode 100644 index 000000000000..83a740e7f607 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.native.js @@ -0,0 +1,70 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'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 Complex64Array = require( '@stdlib/array/complex64' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var ccisf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( ccisf instanceof Error ) +}; +var options = { + 'dtype': 'float32' +}; + + +// MAIN // + +bench( format( '%s::native', pkg ), opts, function benchmark( b ) { + var zbuf; + var z; + var y; + var i; + + zbuf = uniform( 200, -50.0, 50.0, options ); + z = new Complex64Array( zbuf.buffer ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = ccisf( z.get( i%100 ) ); + if ( isnanf( realf( y ) ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( imagf( y ) ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.strided.js b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.strided.js new file mode 100644 index 000000000000..8d9708629992 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/benchmark.strided.js @@ -0,0 +1,67 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var Float32Array = require( '@stdlib/array/float32' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var strided = require( './../lib' ).strided; + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// MAIN // + +bench( format( '%s:strided', pkg ), function benchmark( b ) { + var out; + var z; + var N; + var i; + var j; + + N = 50; + z = uniform( N*2, -50.0, 50.0, options ); + + out = new Float32Array( 2 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + j = ( i % N ) * 2; + out = strided( z, 1, j, out, 1, 0 ); + if ( typeof out !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( isnanf( out[ 0 ] ) || isnanf( out[ 1 ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/Makefile b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/Makefile new file mode 100644 index 000000000000..928de45a1a06 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/Makefile @@ -0,0 +1,127 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of 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/ccisf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/benchmark.c new file mode 100644 index 000000000000..49ab4e08c9a7 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/benchmark.c @@ -0,0 +1,142 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include +#include +#include +#include +#include +#include + +#define NAME "ccisf" +#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 complex z[ 100 ]; + float complex w; + double elapsed; + double t; + float re; + float im; + int i; + + for ( i = 0; i < 100; i++ ) { + re = random_uniform( -50.0f, 50.0f ); + im = random_uniform( -50.0f, 50.0f ); + z[ i ] = re + im*I; + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + w = ( cosf( crealf( z[ i%100 ] ) ) + I*sinf( crealf( z[ i%100 ] ) ) ) / expf( cimagf( z[ i%100 ] ) ); + if ( w != w ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( w != w ) { + 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/ccisf/benchmark/c/native/Makefile b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/native/Makefile new file mode 100644 index 000000000000..979768abbcec --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/native/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/native/benchmark.c new file mode 100644 index 000000000000..1bb5cfc96d35 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/c/native/benchmark.c @@ -0,0 +1,145 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/ccisf.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" +#include +#include +#include +#include +#include + +#define NAME "ccisf" +#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 ) { + stdlib_complex64_t z[ 100 ]; + stdlib_complex64_t w; + double elapsed; + double t; + float re; + float im; + int i; + + for ( i = 0; i < 100; i++ ) { + re = random_uniform( -50.0f, 50.0f ); + im = random_uniform( -50.0f, 50.0f ); + z[ i ] = stdlib_complex64( re, im ); + } + + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + w = stdlib_base_ccisf( z[ i%100 ] ); + stdlib_complex64_reim( w, &re, &im ); + if ( re != re ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( im != im ) { + 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/ccisf/benchmark/julia/REQUIRE b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/julia/REQUIRE new file mode 100644 index 000000000000..98645e192e41 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/julia/REQUIRE @@ -0,0 +1,2 @@ +julia 1.5 +BenchmarkTools 0.5.0 diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/julia/benchmark.jl b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/julia/benchmark.jl new file mode 100644 index 000000000000..549072db6521 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/julia/benchmark.jl @@ -0,0 +1,144 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import BenchmarkTools +using Printf + +# Benchmark variables: +name = "ccisf"; +repeats = 3; + +""" + print_version() + +Prints the TAP version. + +# Examples + +``` julia +julia> print_version() +``` +""" +function print_version() + @printf( "TAP version 13\n" ); +end + +""" + print_summary( total, passing ) + +Print the benchmark summary. + +# Arguments + +* `total`: total number of tests +* `passing`: number of passing tests + +# Examples + +``` julia +julia> print_summary( 3, 3 ) +``` +""" +function print_summary( total, 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" ); +end + +""" + print_results( iterations, elapsed ) + +Print benchmark results. + +# Arguments + +* `iterations`: number of iterations +* `elapsed`: elapsed time (in seconds) + +# Examples + +``` julia +julia> print_results( 1000000, 0.131009101868 ) +``` +""" +function print_results( iterations, elapsed ) + rate = iterations / elapsed + + @printf( " ---\n" ); + @printf( " iterations: %d\n", iterations ); + @printf( " elapsed: %0.9f\n", elapsed ); + @printf( " rate: %0.9f\n", rate ); + @printf( " ...\n" ); +end + +""" + benchmark() + +Run a benchmark. + +# Notes + +* Benchmark results are returned as a two-element array: [ iterations, elapsed ]. +* The number of iterations is not the true number of iterations. Instead, an 'iteration' is defined as a 'sample', which is a computed estimate for a single evaluation. +* The elapsed time is in seconds. + +# Examples + +``` julia +julia> out = benchmark(); +``` +""" +function benchmark() + t = BenchmarkTools.@benchmark cis(ComplexF32( (rand()*100.0)-50.0, (rand()*100.0)-50.0 )) samples=1e6 + + # Compute the total "elapsed" time and convert from nanoseconds to seconds: + s = sum( t.times ) / 1.0e9; + + # Determine the number of "iterations": + iter = length( t.times ); + + # Return the results: + [ iter, s ]; +end + +""" + main() + +Run benchmarks. + +# Examples + +``` julia +julia> main(); +``` +""" +function main() + print_version(); + for i in 1:repeats + @printf( "# julia::%s\n", name ); + results = benchmark(); + print_results( results[ 1 ], results[ 2 ] ); + @printf( "ok %d benchmark finished\n", i ); + end + print_summary( repeats, repeats ); +end + +main(); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/python/benchmark.py b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/python/benchmark.py new file mode 100644 index 000000000000..83e5e865ce2e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/benchmark/python/benchmark.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Benchmark ccisf.""" + +from __future__ import print_function +import timeit + +NAME = "ccisf" +REPEATS = 3 +ITERATIONS = 1000000 + + +def print_version(): + """Print the TAP version.""" + print("TAP version 13") + + +def print_summary(total, passing): + """Print the benchmark summary. + + # Arguments + + * `total`: total number of tests + * `passing`: number of passing tests + + """ + print("#") + print("1.." + str(total)) # TAP plan + print("# total " + str(total)) + print("# pass " + str(passing)) + print("#") + print("# ok") + + +def print_results(elapsed): + """Print benchmark results. + + # Arguments + + * `elapsed`: elapsed time (in seconds) + + # Examples + + ``` python + python> print_results(0.131009101868) + ``` + """ + rate = ITERATIONS / elapsed + + print(" ---") + print(" iterations: " + str(ITERATIONS)) + print(" elapsed: " + str(elapsed)) + print(" rate: " + str(rate)) + print(" ...") + + +def benchmark(): + """Run the benchmark and print benchmark results.""" + setup = "from random import random; from math import sin, cos, exp;" + stmt = "re = (random()*100.0) - 50.0; im = (random()*100.0) - 50.0; y = (cos(re) + 1.0j * sin(re)) / exp(im);" + + t = timeit.Timer(stmt, setup=setup) + + print_version() + + for i in range(REPEATS): + print("# python::" + NAME) + elapsed = t.timeit(number=ITERATIONS) + print_results(elapsed) + print("ok " + str(i+1) + " benchmark finished") + + print_summary(REPEATS, REPEATS) + + +def main(): + """Run the benchmark.""" + benchmark() + + +if __name__ == "__main__": + main() diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/binding.gyp b/lib/node_modules/@stdlib/math/base/special/ccisf/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/docs/img/equation_cis_function.svg b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/img/equation_cis_function.svg new file mode 100644 index 000000000000..a6239c7e1932 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/img/equation_cis_function.svg @@ -0,0 +1,52 @@ + +c i s left-parenthesis z right-parenthesis equals e Superscript i z Baseline equals cosine left-parenthesis z right-parenthesis plus i sine left-parenthesis z right-parenthesis + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/docs/repl.txt b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/repl.txt new file mode 100644 index 000000000000..f0fc6ee72c7e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/repl.txt @@ -0,0 +1,96 @@ + +{{alias}}( z ) + Evaluates the cis function for a single-precision complex floating-point + number. + + Parameters + ---------- + z: Complex64 + Complex number. + + Returns + ------- + out: Complex64 + Complex number. + + Examples + -------- + > var y = {{alias}}( new {{alias:@stdlib/complex/float32/ctor}}( 0.0, 0.0 ) ) + [ 1.0, 0.0 ] + > y = {{alias}}( new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 0.0 ) ) + [ ~0.540, ~0.841 ] + + +{{alias}}.assign( re, im, out, strideOut, offsetOut ) + Evaluates the cis function for a single-precision complex floating-point + number and assigns results to a provided output array. + + Parameters + ---------- + re: number + Real component. + + im: number + Imaginary component. + + out: ArrayLikeObject + Output array. + + strideOut: integer + Stride length. + + offsetOut: integer + Starting index. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var out = new {{alias:@stdlib/array/float32}}( 2 ); + > {{alias}}.assign( 0.0, 0.0, out, 1, 0 ) + [ 1.0, 0.0 ] + + +{{alias}}.strided( z, sz, oz, out, so, oo ) + Evaluates the cis function for a single-precision complex floating-point + number stored in a real-valued strided array view and assigns results to a + provided strided output array. + + Parameters + ---------- + z: ArrayLikeObject + Complex number view. + + sz: integer + Stride length for `z`. + + oz: integer + Starting index for `z`. + + out: ArrayLikeObject + Output array. + + so: integer + Stride length for `out`. + + oo: integer + Starting index for `out`. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var z = new {{alias:@stdlib/array/float32}}( [ 0.0, 0.0 ] ); + > var out = new {{alias:@stdlib/array/float32}}( 2 ); + > {{alias}}.strided( z, 1, 0, out, 1, 0 ) + [ 1.0, 0.0 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/index.d.ts new file mode 100644 index 000000000000..351f085a887d --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/index.d.ts @@ -0,0 +1,129 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Complex64 } from '@stdlib/types/complex'; +import { Collection, NumericArray } from '@stdlib/types/array'; + +/** +* Interface for evaluating the cis function for a single-precision complex floating-point number. +*/ +interface Ccisf { + /** + * Evaluates the cis function for a single-precision complex floating-point number. + * + * @param z - complex number + * @returns result + * + * @example + * var Complex64 = require( '@stdlib/complex/float32/ctor' ); + * + * var z = new Complex64( 0.0, 0.0 ); + * // returns + * + * var out = ccisf( z ); + * // returns [ 1.0, 0.0 ] + */ + ( z: Complex64 ): Complex64; + + /** + * Evaluates the cis function for a single-precision complex floating-point number and assigns results to a provided output array. + * + * @param re - real component + * @param im - imaginary component + * @param out - output array + * @param strideOut - stride length + * @param offsetOut - starting index + * @returns output array + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var out = new Float32Array( 2 ); + * var v = ccisf.assign( 0.0, 0.0, out, 1, 0 ); + * // returns [ 1.0, 0.0 ] + * + * var bool = ( out === v ); + * // returns true + */ + assign>( re: number, im: number, out: T, strideOut: number, offsetOut: number ): T; + + /** + * Evaluates the cis function for a single-precision complex floating-point number stored in a real-valued strided array view and assigns results to a provided strided output array. + * + * @param z - complex number view + * @param strideZ - stride length for `z` + * @param offsetZ - starting index for `z` + * @param out - output array + * @param strideOut - stride length for `out` + * @param offsetOut - starting index for `out` + * @returns output array + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var z = new Float32Array( [ 0.0, 0.0 ] ); + * + * var out = ccisf.strided( z, 1, 0, new Float32Array( 2 ), 1, 0 ); + * // returns [ 1.0, 0.0 ] + */ + strided, U extends NumericArray | Collection>( z: T, strideZ: number, offsetZ: number, out: U, strideOut: number, offsetOut: number ): U; +} + +/** +* Evaluates the cis function for a single-precision complex floating-point number. +* +* @param z - complex number +* @returns result +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var z = new Complex64( 0.0, 0.0 ); +* // returns +* +* var out = ccisf( z ); +* // returns [ 1.0, 0.0 ] +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var out = new Float32Array( 2 ); +* var v = ccisf.assign( 0.0, 0.0, out, 1, 0 ); +* // returns [ 1.0, 0.0 ] +* +* var bool = ( out === v ); +* // returns true +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var z = new Float32Array( [ 0.0, 0.0 ] ); +* +* var out = ccisf.strided( z, 1, 0, new Float32Array( 2 ), 1, 0 ); +* // returns [ 1.0, 0.0 ] +*/ +declare var ccisf: Ccisf; + + +// EXPORTS // + +export = ccisf; diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/test.ts new file mode 100644 index 000000000000..92764e26a964 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/docs/types/test.ts @@ -0,0 +1,246 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import Complex64 = require( '@stdlib/complex/float32/ctor' ); +import ccisf = require( './index' ); + + +// TESTS // + +// The function returns a complex number... +{ + ccisf( new Complex64( 1.0, 2.0 ) ); // $ExpectType Complex64 +} + +// The compiler throws an error if the function is provided a value other than a complex number... +{ + ccisf( 2 ); // $ExpectError + ccisf( true ); // $ExpectError + ccisf( false ); // $ExpectError + ccisf( null ); // $ExpectError + ccisf( undefined ); // $ExpectError + ccisf( '5' ); // $ExpectError + ccisf( [] ); // $ExpectError + ccisf( {} ); // $ExpectError + ccisf( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + ccisf(); // $ExpectError +} + +// Attached to the main export is an `assign` method which returns a collection... +{ + ccisf.assign( 1.0, 1.0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array + ccisf.assign( 1.0, 1.0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array + ccisf.assign( 1.0, 1.0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] +} + +// The compiler throws an error if the `assign` method is provided a first argument which is not a number... +{ + const out = new Float32Array( 2 ); + + ccisf.assign( true, 2.0, out, 1, 0 ); // $ExpectError + ccisf.assign( false, 2.0, out, 1, 0 ); // $ExpectError + ccisf.assign( null, 2.0, out, 1, 0 ); // $ExpectError + ccisf.assign( undefined, 2.0, out, 1, 0 ); // $ExpectError + ccisf.assign( '5', 2.0, out, 1, 0 ); // $ExpectError + ccisf.assign( [], 2.0, out, 1, 0 ); // $ExpectError + ccisf.assign( {}, 2.0, out, 1, 0 ); // $ExpectError + ccisf.assign( ( x: number ): number => x, 2.0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a second argument which is not a number... +{ + const out = new Float32Array( 2 ); + + ccisf.assign( 1.0, true, out, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, false, out, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, null, out, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, undefined, out, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, '5', out, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, [], out, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, {}, out, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a third argument which is not a collection... +{ + ccisf.assign( 1.0, 2.0, 1, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, true, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, false, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, null, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, undefined, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, '5', 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, [ '5' ], 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, {}, 1, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a fourth argument which is not a number... +{ + const out = new Float32Array( 2 ); + + ccisf.assign( 1.0, 2.0, out, true, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, false, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, null, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, undefined, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, '5', 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, [], 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, {}, 0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided a fifth argument which is not a number... +{ + const out = new Float32Array( 2 ); + + ccisf.assign( 1.0, 2.0, out, 1, true ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, false ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, null ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, undefined ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, '5' ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, [] ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, {} ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `assign` method is provided an unsupported number of arguments... +{ + const out = new Float32Array( 2 ); + + ccisf.assign(); // $ExpectError + ccisf.assign( 1.0 ); // $ExpectError + ccisf.assign( 1.0, 2.0 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1 ); // $ExpectError + ccisf.assign( 1.0, 2.0, out, 1, 0, {} ); // $ExpectError +} + +// Attached to the main export is a `strided` method which returns a collection... +{ + const z = new Float32Array( 2 ); + + ccisf.strided( z, 1, 0, new Float32Array( 2 ), 1, 0 ); // $ExpectType Float32Array + ccisf.strided( z, 1, 0, new Float64Array( 2 ), 1, 0 ); // $ExpectType Float64Array + ccisf.strided( z, 1, 0, [ 0.0, 0.0 ], 1, 0 ); // $ExpectType number[] +} + +// The compiler throws an error if the `strided` method is provided a first argument which is not a collection... +{ + const out = new Float32Array( 2 ); + + ccisf.strided( true, 1, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( false, 1, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( null, 1, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( undefined, 1, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( '5', 1, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( [ '5' ], 1, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( {}, 1, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( ( x: number ): number => x, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a second argument which is not a number... +{ + const z = new Float32Array( 2 ); + const out = new Float32Array( 2 ); + + ccisf.strided( z, true, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( z, false, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( z, null, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( z, undefined, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( z, '5', 0, out, 1, 0 ); // $ExpectError + ccisf.strided( z, [], 0, out, 1, 0 ); // $ExpectError + ccisf.strided( z, {}, 0, out, 1, 0 ); // $ExpectError + ccisf.strided( z, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a third argument which is not a number... +{ + const z = new Float32Array( 2 ); + const out = new Float32Array( 2 ); + + ccisf.strided( z, 1, true, out, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, false, out, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, null, out, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, undefined, out, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, '5', out, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, [], out, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, {}, out, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a fourth argument which is not a collection... +{ + const z = new Float32Array( 2 ); + + ccisf.strided( z, 1, 0, 1, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, true, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, false, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, null, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, undefined, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, '5', 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, [ '5' ], 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, {}, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a fifth argument which is not a number... +{ + const z = new Float32Array( 2 ); + const out = new Float32Array( 2 ); + + ccisf.strided( z, 1, 0, out, true, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out, false, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out, null, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out, undefined, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out, '5', 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out, [], 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out, {}, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided a sixth argument which is not a number... +{ + const z = new Float32Array( 2 ); + const out = new Float32Array( 2 ); + + ccisf.strided( z, 1, 0, out, 1, true ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, false ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, null ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, undefined ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, '5' ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, [] ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, {} ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `strided` method is provided an unsupported number of arguments... +{ + const z = new Float32Array( 2 ); + const out = new Float32Array( 2 ); + + ccisf.strided(); // $ExpectError + ccisf.strided( z ); // $ExpectError + ccisf.strided( z, 1 ); // $ExpectError + ccisf.strided( z, 1, 0 ); // $ExpectError + ccisf.strided( z, 1, 0, out ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1 ); // $ExpectError + ccisf.strided( z, 1, 0, out, 1, 0, {} ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/Makefile b/lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/example.c b/lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/example.c new file mode 100644 index 000000000000..ab6c0b321d2d --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/examples/c/example.c @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/ccisf.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" +#include + +int main( void ) { + const stdlib_complex64_t x[] = { + stdlib_complex64( 3.14f, 1.5f ), + stdlib_complex64( -3.14f, -1.5f ), + stdlib_complex64( 0.0f, 0.0f ), + stdlib_complex64( 0.0f/0.0f, 0.0f/0.0f ) + }; + + stdlib_complex64_t v; + stdlib_complex64_t y; + float re1; + float im1; + float re2; + float im2; + int i; + for ( i = 0; i < 4; i++ ) { + v = x[ i ]; + y = stdlib_base_ccisf( v ); + stdlib_complex64_reim( v, &re1, &im1 ); + stdlib_complex64_reim( y, &re2, &im2 ); + printf( "ccisf(%f + %fi) = %f + %fi\n", re1, im1, re2, im2 ); + } +} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/examples/index.js b/lib/node_modules/@stdlib/math/base/special/ccisf/examples/index.js new file mode 100644 index 000000000000..63a9f546fb44 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var Complex64Array = require( '@stdlib/array/complex64' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var ccisf = require( './../lib' ); + +// Create an array of random numbers: +var arr = new Complex64Array( uniform( 200, -50.0, 50.0 ) ); + +// Compute the cis function of each number in the array: +logEachMap( 'ccisf(%s) = %s', arr, ccisf ); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/include.gypi b/lib/node_modules/@stdlib/math/base/special/ccisf/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '[ 1.0, 0.0 ] +*/ +function assign( re, im, out, strideOut, offsetOut ) { + var e; + + sincosf( re, WORKSPACE, 1, 0 ); + if ( im === 0.0 ) { + out[ offsetOut ] = WORKSPACE[ 1 ]; + out[ offsetOut+strideOut ] = WORKSPACE[ 0 ]; + return out; + } + e = expf( -im ); + out[ offsetOut ] = f32( WORKSPACE[ 1 ] * e ); + out[ offsetOut+strideOut ] = f32( WORKSPACE[ 0 ] * e ); + return out; +} + + +// EXPORTS // + +module.exports = assign; diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/lib/index.js b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/index.js new file mode 100644 index 000000000000..b6e96d9623d8 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/index.js @@ -0,0 +1,65 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Evaluate the cis function for a single-precision complex floating-point number. +* +* @module @stdlib/math/base/special/ccisf +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var ccisf = require( '@stdlib/math/base/special/ccisf' ); +* +* var z = new Complex64( 0.0, 0.0 ); +* // returns +* +* var out = ccisf( z ); +* // returns [ 1.0, 0.0 ] +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* var ccisf = require( '@stdlib/math/base/special/ccisf' ); +* +* var z = new Complex64( 1.0, 0.0 ); +* // returns +* +* var out = ccisf( z ); +* // returns [ ~0.540, ~0.841 ] +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var assign = require( './assign.js' ); +var strided = require( './strided.js' ); + + +// MAIN // + +setReadOnly( main, 'assign', assign ); +setReadOnly( main, 'strided', strided ); + + +// EXPORTS // + +module.exports = main; + +// exports: { "assign": "main.assign", "strided": "main.strided" } diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/lib/main.js b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/main.js new file mode 100644 index 000000000000..842a2405c116 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/main.js @@ -0,0 +1,69 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var Float32Array = require( '@stdlib/array/float32' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var assign = require( './assign.js' ); + + +// VARIABLES // + +var out = new Float32Array( 2 ); + + +// MAIN // + +/** +* Evaluates the cis function for a single-precision complex floating-point number. +* +* @param {Complex64} z - complex number +* @returns {Complex64} result +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var z = new Complex64( 0.0, 0.0 ); +* // returns +* +* var out = ccisf( z ); +* // returns [ 1.0, 0.0 ] +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var z = new Complex64( 1.0, 0.0 ); +* // returns +* +* var out = ccisf( z ); +* // returns [ ~0.540, ~0.841 ] +*/ +function ccisf( z ) { + assign( realf( z ), imagf( z ), out, 1, 0 ); + return new Complex64( out[ 0 ], out[ 1 ] ); +} + + +// EXPORTS // + +module.exports = ccisf; diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/lib/native.js b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/native.js new file mode 100644 index 000000000000..c8f1741ed172 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/native.js @@ -0,0 +1,62 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Evaluates the cis function for a single-precision complex floating-point number. +* +* @private +* @param {Complex64} z - complex number +* @returns {Complex64} result +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var z = new Complex64( 0.0, 0.0 ); +* // returns +* +* var out = ccisf( z ); +* // returns [ 1.0, 0.0 ] +* +* @example +* var Complex64 = require( '@stdlib/complex/float32/ctor' ); +* +* var z = new Complex64( 1.0, 0.0 ); +* // returns +* +* var out = ccisf( z ); +* // returns [ ~0.540, ~0.841 ] +*/ +function ccisf( z ) { + var v = addon( z ); + return new Complex64( v.re, v.im ); +} + + +// EXPORTS // + +module.exports = ccisf; diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/lib/strided.js b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/strided.js new file mode 100644 index 000000000000..25fd096f2fd8 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/lib/strided.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var assign = require( './assign.js' ); + + +// MAIN // + +/** +* Evaluates the cis function for a single-precision complex floating-point number stored in a real-valued strided array view and assigns results to a provided strided output array. +* +* @param {Float32Array} z - complex number view +* @param {integer} strideZ - stride length for `z` +* @param {NonNegativeInteger} offsetZ - starting index for `z` +* @param {Collection} out - output array +* @param {integer} strideOut - stride length for `out` +* @param {NonNegativeInteger} offsetOut - starting index for `out` +* @returns {Collection} output array +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var z = new Float32Array( [ 0.0, 0.0 ] ); +* +* var out = strided( z, 1, 0, new Float32Array( 2 ), 1, 0 ); +* // returns [ 1.0, 0.0 ] +*/ +function strided( z, strideZ, offsetZ, out, strideOut, offsetOut ) { + return assign( z[ offsetZ ], z[ offsetZ+strideZ ], out, strideOut, offsetOut ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = strided; diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/manifest.json b/lib/node_modules/@stdlib/math/base/special/ccisf/manifest.json new file mode 100644 index 000000000000..f7149879c8f5 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/manifest.json @@ -0,0 +1,81 @@ +{ + "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/complex/float32/ctor", + "@stdlib/complex/float32/reim", + "@stdlib/math/base/special/expf", + "@stdlib/math/base/special/sincosf" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/reim", + "@stdlib/math/base/special/expf", + "@stdlib/math/base/special/sincosf" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/complex/float32/ctor", + "@stdlib/complex/float32/reim", + "@stdlib/math/base/special/expf", + "@stdlib/math/base/special/sincosf" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/package.json b/lib/node_modules/@stdlib/math/base/special/ccisf/package.json new file mode 100644 index 000000000000..68072f0f08c4 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/package.json @@ -0,0 +1,206 @@ +{ + "name": "@stdlib/math/base/special/ccisf", + "version": "0.0.0", + "description": "Evaluate the cis function for a single-precision complex floating-point number.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "cis", + "arithmetic", + "complex", + "cmplx", + "number", + "exponential", + "euler", + "exp", + "ccisf" + ], + "__stdlib__": { + "scaffold": { + "$schema": "math/base@v1.0", + "base_alias": "ccis", + "alias": "ccisf", + "pkg_desc": "compute the cis function for a single-precision complex floating-point number", + "desc": "computes the cis function for a single-precision complex floating-point number", + "short_desc": "cis function", + "parameters": [ + { + "name": "z", + "desc": "input value", + "type": { + "javascript": "Complex64", + "jsdoc": "Complex64", + "c": "stdlib_complex64_t", + "dtype": "complex64" + }, + "domain": null, + "rand": { + "prng": "random/base/uniform", + "parameters": [ + [ + -50, + 50 + ], + [ + -50, + 50 + ] + ] + }, + "example_values": [ + { + "re": 0, + "im": 0 + }, + { + "re": 1, + "im": 0 + }, + { + "re": -3.14, + "im": -1.5 + }, + { + "re": -1.5, + "im": 2.5 + }, + { + "re": 2.5, + "im": -1.5 + }, + { + "re": 0, + "im": -3.7 + }, + { + "re": 4.2, + "im": 0 + }, + { + "re": 21.2, + "im": 3 + }, + { + "re": 11, + "im": -5 + }, + { + "re": 33, + "im": -14.67 + }, + { + "re": -42, + "im": 9.3 + }, + { + "re": -3, + "im": 3 + }, + { + "re": 73, + "im": 31 + }, + { + "re": -2.45, + "im": 1.23 + }, + { + "re": 2.45, + "im": -1.23 + }, + { + "re": 1.77, + "im": -3.14 + }, + { + "re": -7.5, + "im": 8.2 + }, + { + "re": 5.5, + "im": -12.3 + }, + { + "re": -15.8, + "im": 0.4 + }, + { + "re": 0.99, + "im": -0.99 + } + ] + } + ], + "returns": { + "desc": "result", + "type": { + "javascript": "Complex64", + "jsdoc": "Complex64", + "c": "stdlib_complex64_t", + "dtype": "complex64" + } + }, + "keywords": [ + "cis", + "arithmetic", + "complex", + "exponential", + "euler" + ], + "extra_keywords": [ + "exp" + ] + } + } +} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/src/Makefile b/lib/node_modules/@stdlib/math/base/special/ccisf/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/src/addon.c b/lib/node_modules/@stdlib/math/base/special/ccisf/src/addon.c new file mode 100644 index 000000000000..31fb0ee835fa --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/src/addon.c @@ -0,0 +1,22 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/ccisf.h" +#include "stdlib/math/base/napi/unary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_C_C( stdlib_base_ccisf ) diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/src/main.c b/lib/node_modules/@stdlib/math/base/special/ccisf/src/main.c new file mode 100644 index 000000000000..174eaa49a6eb --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/src/main.c @@ -0,0 +1,77 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/math/base/special/ccisf.h" +#include "stdlib/complex/float32/ctor.h" +#include "stdlib/complex/float32/reim.h" +#include "stdlib/math/base/special/expf.h" +#include "stdlib/math/base/special/sincosf.h" + +/** +* Evaluates the cis function for a single-precision complex floating-point number. +* +* @param z input value +* @return result +* +* @example +* #include "stdlib/complex/float32/ctor.h" +* #include "stdlib/complex/float32/real.h" +* #include "stdlib/complex/float32/imag.h" +* +* stdlib_complex64_t z = stdlib_complex64( 0.0f, 0.0f ); +* +* stdlib_complex64_t out = stdlib_base_ccisf( z ); +* +* float re = stdlib_complex64_real( out ); +* // returns 1.0f +* +* float im = stdlib_complex64_imag( out ); +* // returns 0.0f +* +* @example +* #include "stdlib/complex/float32/ctor.h" +* #include "stdlib/complex/float32/real.h" +* #include "stdlib/complex/float32/imag.h" +* +* stdlib_complex64_t z = stdlib_complex64( 1.0f, 0.0f ); +* +* stdlib_complex64_t out = stdlib_base_ccisf( z ); +* +* float re = stdlib_complex64_real( out ); +* // returns ~0.540f +* +* float im = stdlib_complex64_imag( out ); +* // returns ~0.841f +*/ +stdlib_complex64_t stdlib_base_ccisf( const stdlib_complex64_t z ) { + float re; + float im; + float y; + float x; + float e; + + stdlib_complex64_reim( z, &re, &im ); + + stdlib_base_sincosf( re, &y, &x ); + if ( im != 0.0f ) { + e = stdlib_base_expf( -im ); + y *= e; + x *= e; + } + return stdlib_complex64( x, y ); +} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..308c3be89c85 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/REQUIRE @@ -0,0 +1,2 @@ +julia 1.5 +JSON 0.21 diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/general_complex.json b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/general_complex.json new file mode 100644 index 000000000000..3cf615f69947 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/general_complex.json @@ -0,0 +1 @@ +{"cisim":[-8.558895e-15,1.8999778e-33,0.007944733,6.606692e-32,-0.05762854,1.1828116e-16,-1.0628895e-16,8.159815e-27,4.0158134e-14,-1.04656706e-22,2.8512162e-25,4.726948e-6,-1.4360361e-36,5.561682e-13,1.2308303e-14,5.8112734e-16,-0.75613713,0.06447532,117.611145,-1.0779634e-36,-4.140446e-39,-7.216032e-18,-1.1860961e-34,8.221501e-9,-7.097211e-39,-1.3003568e-26,-0.012635721,4.6030792e-36,-4.414146e-6,2.0497562e-28,-1.4832914e-38,-3.1353636e-24,-1.13503394e-10,-7.846695e-7,-2.5904992e-5,4.9248268e-9,-3.7663e-41,0.0005274183,2.9036948e-29,-8.0776226e-23,-3.8029185e-32,9.722658e-10,-9.006431e-37,-1.000341e-37,-2.0319352e-16,-1.10989995e-5,-1.3085322e-28,1.0342224e-10,-7.899007e-14,4.7187443,4.4579085e-23,-5.81e-42,4.7055973e-6,-6.1579e-41,-1.864464e-39,-8.054755e-30,1.978993e-28,-4.287854e-30,-1.4817858e-16,6.846922e-39,-6.789973e-18,8.672647e-35,-4.465899e-35,4.0131066e-8,-0.009130686,-9.484834e-39,1.1597447e-36,2.9674932e-6,-7.1235825e-20,-0.022254102,7.1265794e-29,4.2034696e-8,3.3940622e-21,1.2890482e-14,2.2539805e-37,-8.838577e-21,-6.469994e-14,-8.903898e-23,1.0717776e-26,-2.8158706e-6,-1.3294521e-25,-1.485122e-22,-2.454575e-35,1.4264783e-27,6.437191e-21,0.014175243,2.3447e-41,1.7452866e-12,-2.3736474e-37,4.715052e-34,-4.8554057e-27,-5.4041744e-33,-1.6279824e-6,3.4075848e-10,5.27557e-40,5.1893094e-33,1.82028e-39,-1.7656222e-23,-1.2545804e-23,-8.428638e-15,-2.5797064e-34,7.945554e-9,3.408838e-9,-8.970068e-38,-0.0100435,-3.7468763e-7,-0.050001964,-7.859147e-25,-1.4923244e-26,-1.455664e-26,-6.9598376e-9,4.9107563e-25,5.58761e-40,-8.5876e-41,-1.2885986e-12,38.924297,-7.8306e-41,8.892658e-38,-0.00016653731,5.9565184e-27,-2.5176e-41,-1.9268e-41,1.5620673e-29,-2.4364562e-36,1.1555736e-30,1.4742e-41,-9.218792e-35,-3.0145115e-26,-1.6245006e-34,-13.314524,-7.363814e-31,-1.8909183e-24,-3.9121449e-13,-0.38947493,37.17367,5.674288e-24,8.728498e-29,-1.6445952e-16,-4.5683874e-9,3.01694e-40,-3.6673148e-10,3.5838716e-6,7.6086365e-34,5.4415125e-11,-0.0055584614,3.324065e-20,-1.760056e-8,4.8230927e-6,-9.262118e-34,-0.8682551,2.5392455e-10,-1.9990779e-14,1.8605354e-29,-1.7121701e-24,-4.3271595e-30,0.06265504,-5.5201325e-26,9.528248e-5,-0.037252977,-8.2399246e-17,2.7396067e-34,3.757694e-20,-1.5619903e-22,1.1236092,6.577093e-8,2.2756547e-7,-0.008618203,-7.312135e-5,-4.9059854e-28,8.735499e-33,-5.839123e-34,-0.00019416535,6.3328564e-26,9.231729e-39,1.55153e-40,-3.845835e-21,8.280024e-32,-3.3579928e-21,-1.0126906e-32,1.733987e-5,1.9830768e-18,6.2901208e-12,66.92415,6.7892e-41,-1.7176937e-29,-1.3879099e-30,3.7236326,-2.995729e-18,-1.0532218e-30,-1.7976322e-27,-0.0006709319,-4.7153184e-11,-28.061882,3.5087328e-23,2.4734438e-25,-2.7155207e-32,4.2935488e-38,-4.1286484e-33,-2.3755035e-6,1.2395713e-25,3.741642e-9,1.0345503e-18,-1.4850262e-37,9.513894e-24,-9.541317e-18,-4.714293e-26,2.5764678e-16,-0.39554825,-9.629597e-8,4.712406e-7,-0.019544238,-6.502898e-22,-0.19164078,-1.5329134e-22,2.51028e-33,6.903111e-23,2.6618312e-27,-0.00036623055,-3.7852386e-22,-2.953463e-38,0.011404653,-6.0370755e-35,-2.1334545e-11,-4.0031928e-10,1.925749e-37,-3.870455e-28,5.6578213e-21,9.958921e-26,7.8715697e-26,-0.0012020406,2.9679643e-32,-7.6694165e-32,-3.610562e-25,-4.3965898e-9,7.855e-41,-2.6477404e-27,-4.749535,1.8043267e-23,-1.7205e-41,1.305844e-30,7.418e-42,-3.011695e-11,1.51702e-40,-0.096408956,5.2811e-41,-3.1686895e-6,4.1828012e-36,3.183526e-39,2.0162479e-5,-8.957333,-71.07921,2.4352731e-29,5.399874e-25,1.4989308e-20,-1.366208e-28,-6.975735e-23,5.2618966e-34,-2.8814879e-5,2.8160727,-4.1458426e-30,-0.0015509003,-8.269105,2.5301732e-35,-4.5667614e-33,-4.2824535e-22,6.3028e-41,2.9158277e-12,1.2496513e-37,-1.00913726e-29,-7.5972435e-35,5.7789693e-21,-1.7135195e-6,0.009669765,3.7252837e-13,-0.00053160725,-1.3368544e-19,-3.2211444e-27,4.9031413e-16,1.5550533e-25,4.2620277e-30,-1.445256e-34,-2.5874764e-34,-0.0001092744,63.48517,-2.0967147e-5,-1.2694854e-6,4.967006e-36,-4.095845e-9,1.1713409e-23,-2.2060933e-9,-9.388104e-24,-0.022222005,-2.151e-42,28.326958,2.142137e-22,1.6779934e-32,5.795688e-17,0.85133046,-6.230445e-7,9.097796e-12,-3.4483975e-25,1.501552e-11,9.187316e-29,5.0298663e-14,-0.00020452768,3.7457633e-9,1.4806474e-25,5.678718e-8,-1.0228243e-8,-5.554448e-20,1.4067806e-11,-5.64692e-40,1.1755901e-9,5.243876e-21,-1.827187e-5,-1.7578002e-5,7.180026e-9,-3.0239107e-27,-7.697341e-30,3.9893088e-25,5.43013e-40,-8.775256e-17,-5.6496e-40,-3.994253e-16,6.177683e-36,-6.8946216e-38,2.9795652e-11,2.1213493e-24,2.6803426e-22,8.020157e-16,-1.5777674e-8,2.68877e-40,-1.8244771e-5,3.8426642e-29,4.8555417,4.487592e-39,1.989427e-5,-3.0526218e-25,-6.8393106e-26,4.4584626e-22,7.4550355e-10,6.793432e-6,7.448006e-7,2.9410365e-26,-0.00084724824,3.8830326e-37,-0.0073272223,1.7777352e-10,-4.9716886e-23,4.4205126e-34,0.7768882,3.468831e-31,5.2568795e-24,1.1311004e-16,-3.5518986e-21,2.960967e-29,-4.851312e-37,-5.6076e-41,4.7158847e-30,-1.092e-41,-9.663169e-30,-4.295835e-26,4.033606e-38,3.7876797e-37,0.00012484491,-1.2761291e-28,0.013166016,-3.1239114e-30,3.245545e-23,-2.166193,-6.3629227e-6,4.3361922e-16,-0.00044299848,-0.0034611346,3.2857344e-15,-1.3267847,1.6959064e-9,-4.6494548e-5,-9.277e-42,6.3447e-31,2.7783162e-31,1.0127987e-37,-3.511542e-12,2.2694747e-16,4.3740296e-28,3.8401673e-12,-8.116826e-37,3.111414e-20,2.5764843e-25,-1.4692055e-10,-3.5927007e-28,-6.47151e-31,6.007867e-22,-2.2963422e-26,-5.870809e-20,-1.1888079e-33,-0.0013026543,-1.0517507e-38,-7.0428094e-8,-0.025952626,7.532085e-20,6.3228775e-16,-1.5142658e-27,-1.8777e-41,2.4543737e-15,-3.9262823e-35,-4.7716414e-10,-1.071801e-27,9.469425e-13,-0.0016113364,-1.6264232e-6,-2.4640088e-30,6.8572105e-24,-5.575829e-35,-4.6640957e-13,-0.00013306276,-1.9710672e-13,-3.8196561,-1.0386798e-18,1.5116681e-32,-8.1136844e-13,-2.458371e-39,5.62e-43,4.12259e-40,0.093458496,1.6214135e-19,1.6425119e-7,-3.9654738e-13,-2.7823318e-26,-1.6961e-40,9.037778e-19,3.684925e-8,-1.0038904e-27,-9.645552e-7,-1.0154068e-19,-3.5677756e-12,5.7909758e-5,-1.60868e-40,-0.0013161711,-9.024526e-19,-1.3741725e-19,-2.0971429e-19,-2.6441182e-20,3.91369e-40,-1.1575012e-11,-2.6124365e-36,-9.962797e-37,-1.3512595e-38,-1.0592287e-17,-8.523991e-27,1.0298522e-7,1.5337485e-31,4.9387986e-6,1.1054468e-28,3.9406817,-9.399933e-32,1.0831989e-20,-3.5420127e-29,6.324e-42,7.922026e-23,104.68876,1.6680492e-22,2.4572097e-23,-9.045149,3.8302083e-35,-9.8292403e-23,4.564655e-5,-2.715697e-18,2.1477929e-29,-5.12394e-22,-4.889958e-18,3.0432096e-15,1.9656e-27,6.6466513,-8.188127e-18,-5.626508e-25,-2.652235e-6,9.287453e-13,5.7177932e-37,-1.9916902e-33,-2.2286e-41,-9.356592e-11,2.7430979e-31,-1.2054543e-25,-1.38994e-39,-0.35136548,-8.2898276e-7,5.0133896e-38,-4.109614e-25,-0.00078541937,-1.313292e-18,-9.924e-42,5.6752965e-15,6.633208e-8,6.048273e-14,3.3941963e-21,-0.0015118952,2.55e-43,2.0142457,5.770997e-16],"cisre":[-7.450208e-16,-1.6235493e-33,-0.00209891,1.0632584e-31,-0.0081552705,9.515421e-17,4.756013e-17,5.511299e-27,2.3434359e-15,3.531374e-22,-9.7298295e-26,1.7086848e-5,-1.3770077e-34,1.0715878e-12,3.1205115e-15,4.189388e-16,3.361506,-0.07280964,83.17226,-1.2654532e-35,-2.57875e-39,7.8509234e-17,-3.693684e-35,-2.480436e-8,1.9899233e-38,6.0170027e-27,0.003506052,-3.5651297e-36,6.923222e-7,4.4173307e-28,-2.974334e-39,1.2239861e-23,-3.6993336e-10,5.4775677e-7,-8.4036095e-5,5.0847405e-8,8.2972e-41,-7.0740025e-5,-9.7770345e-29,-2.7997837e-22,-2.5532076e-31,5.196601e-8,-2.486739e-36,-2.095181e-37,-1.6504219e-16,-7.0480186e-5,-2.8856672e-29,-4.6414997e-11,-6.9985216e-15,-1.2724525,-8.6323055e-23,2.477e-42,-1.4122658e-5,-3.325e-42,1.62506e-39,-9.145031e-31,2.6811557e-28,2.7044537e-29,-2.6030514e-16,1.410995e-39,-8.965179e-18,7.1780167e-34,-2.928428e-35,-3.3463746e-6,-0.05968994,-1.313525e-39,-3.9846575e-35,-2.5288234e-6,2.656599e-20,0.0037183932,3.186903e-29,2.458732e-8,-8.9628444e-21,-1.8990377e-14,9.66431e-38,-7.110008e-22,7.234299e-14,2.6562556e-23,1.214809e-26,-1.4419145e-6,1.02426524e-26,-1.6852076e-23,-1.2006896e-34,7.2760993e-28,5.679383e-21,0.0018770938,9.2239e-41,-4.4774926e-12,-6.489176e-37,5.2416556e-34,3.354853e-27,-2.8290196e-33,-6.6237015e-5,-4.571412e-10,-1.1519343e-38,-7.7563386e-33,-5.90436e-40,7.0725506e-24,2.4833156e-25,9.648473e-15,-2.2484999e-35,-1.1269875e-8,-3.0601552e-9,6.2321236e-38,0.0007162394,-9.069107e-7,0.030962,7.4264194e-25,3.2056803e-25,-4.975726e-26,1.9974811e-8,7.210688e-25,3.33311e-40,2.40953e-40,-9.336294e-13,29.737139,6.4482e-41,5.721985e-37,-0.0002979095,9.6002125e-29,-9.788e-42,2.1202e-41,-3.658113e-29,3.0320381e-37,-2.1892303e-30,-8.982e-42,-7.560234e-35,-2.5632444e-26,5.934475e-35,-30.088495,2.1058114e-30,1.1473219e-25,3.9324018e-13,-0.38063306,18.975304,-8.144612e-24,-5.0271373e-29,-2.1948964e-16,1.4944531e-9,8.97174e-40,-7.518624e-11,-0.0002442443,-2.0757348e-32,4.393715e-11,0.006806348,-8.8836096e-20,4.4163155e-8,3.4810682e-6,2.4088347e-34,-2.69967,-2.7761507e-10,3.0696928e-14,-2.0127266e-27,-5.368151e-25,-6.1887453e-30,-0.1493108,-5.3818556e-26,8.352256e-5,0.09854045,-1.0092722e-16,-7.9631534e-35,1.6581377e-20,-2.1838288e-22,11.416934,1.3060117e-8,-1.03474136e-7,0.0047346842,0.00019543298,1.690316e-27,-4.4773265e-33,-3.7070908e-35,-0.00053255126,-1.2066101e-26,4.6618036e-38,1.08896e-40,-5.362224e-22,-2.1772071e-31,-4.8859834e-21,1.2490139e-32,-9.3349845e-6,1.9257065e-18,-5.4563394e-12,-69.65696,2.6004e-41,1.0785994e-30,5.0782217e-30,6.909827,1.073678e-16,-6.681585e-29,3.1787702e-28,-0.008049176,3.6175576e-11,-18.807728,-3.867843e-23,1.9646283e-25,-2.364619e-31,-4.7989854e-38,1.752413e-32,-1.5940145e-6,-1.3897842e-25,7.338455e-9,-9.937169e-18,-1.0575945e-37,4.41384e-24,-4.0188518e-19,1.3741302e-25,-1.49588e-16,1.4803602,4.72052e-8,6.903014e-7,-0.012041832,4.1172637e-22,-0.21351129,-2.4014583e-23,1.1666083e-33,-1.4716078e-22,-1.8782245e-27,0.00015867328,4.145163e-22,2.769847e-37,0.057634313,2.2408607e-36,2.2609639e-10,-1.15070765e-10,1.7418638e-35,-3.059724e-28,4.361079e-21,7.6965966e-26,-7.206308e-27,-0.00013181342,-3.061346e-32,-2.7612148e-32,-9.047104e-26,9.862366e-10,4.2202e-41,-4.556337e-28,8.007266,7.181135e-24,-1.2565e-41,-3.0703757e-31,-1.925e-42,2.7818064e-11,-1.15433e-40,-0.028480604,-8.58e-42,-7.1035676e-5,-2.8499482e-38,2.180764e-39,3.11431e-6,14.858368,-59.854504,4.4974003e-29,-1.34114e-24,4.4604406e-20,2.484671e-29,-1.0085414e-23,-1.8822036e-34,-7.2153316e-6,-2.201034,-1.0082436e-30,-0.0011737401,-10.598725,-1.7260269e-35,3.1756762e-33,1.1145743e-22,1.51087e-40,6.6919872e-12,8.387617e-37,-1.6026165e-30,1.298224e-35,-1.2923747e-21,1.1297359e-6,0.02027816,1.0512244e-13,-0.0422187,-1.9400887e-19,-4.885913e-27,-2.0190474e-16,3.375148e-26,-2.7116802e-29,-5.7615685e-34,7.650621e-35,0.00012296105,-77.26243,2.1806174e-5,-4.2405714e-5,-1.092844e-36,-2.4649807e-9,-8.350592e-24,4.9748543e-9,2.4116538e-23,0.14960994,3.32028e-40,17.97004,-2.2679597e-22,-7.797103e-33,-8.2126114e-18,-0.58495176,-3.2098254e-7,-2.8701867e-11,3.228245e-24,1.5648528e-11,1.1916742e-28,2.7316843e-14,-0.00043587104,-6.194212e-9,-9.9157505e-27,2.652068e-7,5.7163443e-9,3.3813395e-20,7.066916e-12,-2.1088e-40,-5.758071e-10,-3.825792e-21,-7.2170856e-6,-5.242854e-7,3.223029e-9,-2.1440965e-26,-5.4705844e-30,-1.0998798e-24,-1.415564e-39,-1.6974464e-16,1.117365e-39,-8.822267e-15,-1.7388493e-35,-2.1756242e-37,4.6816453e-11,-4.3134043e-24,-4.373836e-22,-1.8911052e-16,9.474013e-9,6.10324e-40,2.1947322e-5,7.1158826e-29,-29.999504,3.48646e-40,0.00019280569,5.0757327e-25,1.7573228e-25,1.4195733e-21,-1.4173842e-9,9.112747e-7,-8.1638626e-7,-1.8556013e-25,-0.0049306825,-1.1614402e-38,-0.007000597,-9.174056e-9,-4.1520074e-22,-3.3504893e-34,-0.40785804,-6.2059513e-32,-1.5377515e-23,2.8865798e-16,7.6612056e-22,-2.662851e-29,-2.6361664e-37,-1.8364e-41,-8.790575e-30,7.067e-42,1.5709728e-29,-8.954984e-27,-1.9607478e-38,-1.5831646e-37,-0.006360628,-1.8720511e-28,-0.03894934,2.730215e-29,-9.046037e-23,3.4870653,2.9576442e-5,-2.0247514e-16,0.00023018692,-0.0017394997,6.361309e-16,0.45923886,1.9034085e-10,-5.6823847e-6,3.332e-42,-2.7000436e-30,-3.1422305e-30,3.1611034e-38,-4.222789e-12,4.968738e-16,-2.0384664e-29,3.8420292e-13,-1.517889e-35,-2.5272458e-22,1.1978571e-24,-3.3390765e-13,3.4379763e-28,-1.1601948e-30,1.3675461e-21,9.9973745e-27,-7.458505e-20,-2.8435695e-34,-0.00086553296,1.7309895e-38,7.8058616e-7,-0.00056124164,2.750342e-20,4.4145716e-16,1.4792087e-28,1.83637e-40,-1.4070755e-15,1.6409705e-35,1.4759549e-8,3.0185306e-27,3.492791e-14,0.0005299378,3.2823584e-6,-5.738554e-31,6.4812615e-25,5.378109e-35,8.420833e-11,-0.00016146827,-5.917763e-13,11.607414,-1.065665e-18,2.794888e-32,-2.4935932e-12,1.748476e-39,1.1502e-41,-2.66943e-40,-0.17320886,1.4851006e-19,2.427103e-8,1.4593292e-12,-1.1203405e-25,-5.6922e-41,6.8626853e-19,1.17604976e-7,5.131364e-28,2.1965263e-6,5.5402477e-20,4.5292784e-12,5.7112662e-5,8.47198e-40,-0.4257677,1.8091908e-18,3.2705424e-19,8.703852e-20,1.4801036e-19,-1.218859e-39,-3.8852155e-12,-1.1085331e-34,6.0148066e-37,-7.483332e-38,-1.3308437e-16,-2.0621377e-27,1.6241098e-7,1.357873e-31,1.8649945e-6,-1.0009545e-28,-0.67714727,-1.7980787e-31,-1.884436e-20,2.7536348e-29,5.045e-42,-8.717343e-23,61.02826,-1.3268687e-22,-1.80579e-23,8.826516,6.5037577e-35,1.8190839e-23,-7.0268274e-5,-3.0088136e-18,-1.8081487e-28,-6.692391e-22,-4.7577827e-17,7.05258e-15,-3.932396e-25,-5.2221794,1.664316e-18,4.1075714e-25,-9.424998e-6,5.8079934e-12,-2.247175e-37,1.0901919e-31,2.6605e-41,2.0840146e-11,1.3683197e-31,7.241658e-26,3.069865e-39,0.24372418,-2.8768793e-7,-5.504365e-38,2.659831e-26,-0.0017226372,2.1353597e-18,-7.503e-42,-6.962151e-16,2.8307358e-8,1.3066033e-14,9.65116e-22,0.0033325756,4.9364e-41,1.7841946,5.922292e-17],"im":[32.38803,75.06935,4.8015122,71.155556,2.8438232,36.423935,36.689117,59.882664,30.844252,49.353092,56.461803,10.94033,77.967926,27.442617,31.997355,34.872303,-1.2370689,2.3304307,-4.970151,80.35143,88.21612,37.07911,78.070946,17.460129,86.75027,59.50757,4.334142,81.13138,12.318545,62.889343,87.08426,52.725567,21.672714,13.85952,9.338876,16.789768,92.196396,7.538602,64.45267,49.587353,70.431816,16.772501,81.92046,84.35333,35.879044,9.547931,64.17973,22.900452,30.165545,-1.5866396,50.68574,94.86564,11.115091,92.5868,88.89528,66.984886,63.268684,65.767654,35.74433,87.856224,39.026497,76.30962,78.91518,12.607561,2.8070269,87.541626,79.2076,12.454831,44.023182,3.791461,64.719986,16.837637,46.094196,31.405367,84.29857,46.171936,29.963503,50.73034,59.384773,12.663806,57.2769,50.25498,78.084526,61.698963,46.204334,4.2475667,92.152885,26.061235,83.262726,76.33482,60.394558,74.17704,9.621969,21.285086,87.35574,73.75184,89.15181,52.316547,52.73246,31.988432,77.33643,18.09938,19.201368,85.10741,4.5982933,13.834425,2.8334107,55.18389,56.39862,58.22158,17.671503,55.39854,90.230644,91.164185,27.166487,-3.8914866,92.08912,83.4394,7.982753,60.38518,93.412315,93.35344,65.39427,81.994835,68.17111,93.86004,78.11206,58.491737,77.74006,-3.4935577,68.27517,54.623142,28.220358,0.60773224,-3.7313786,52.96685,64.46514,35.832428,19.153273,89.85576,21.705805,8.317234,72.95174,23.383396,4.7344074,43.801975,16.86167,12.032436,76.029236,-1.0423442,21.700825,30.937843,61.470264,54.6774,67.05581,1.8206284,57.82476,8.97363,2.250495,36.576756,77.239525,44.638943,49.669212,-2.4399173,16.517752,15.201861,4.621997,8.474784,61.604443,73.70129,76.5213,7.475428,58.00363,85.9396,91.4639,46.99767,70.53455,46.57449,73.20775,10.835249,40.42977,25.51153,-4.570545,92.422226,66.23202,67.41657,-2.0604215,36.769882,64.87549,61.567932,4.8187237,23.546198,-3.5199177,51.306538,56.41445,70.51297,85.63581,73.09472,12.764426,56.942833,18.614595,39.14486,84.59509,52.91182,39.190014,57.19117,35.749695,-0.4267659,16.04816,13.994861,3.774171,48.616077,1.2486116,50.21758,74.96714,50.171074,60.988754,7.826232,48.931713,84.1712,2.8344326,78.79187,22.205627,21.599064,80.03546,62.876274,46.38808,57.334595,57.79978,6.717758,72.232544,71.58454,56.250317,19.21789,92.21804,61.1815,-2.2310793,52.29575,93.64964,68.7838,94.67204,23.917486,91.45826,2.2973213,92.72884,9.551334,81.46206,88.450455,10.799898,-2.8535633,-4.531779,65.14291,54.893402,44.502956,64.14407,51.006676,76.5672,10.4242115,-1.2737379,67.62672,6.242502,-2.5984497,79.47114,74.26928,49.169575,91.610504,25.643196,83.057915,66.75342,78.5483,46.57566,13.096488,3.7957652,28.580154,3.1648128,42.892117,60.402985,35.17317,57.1001,65.7652,76.50617,77.2953,8.712599,-4.6051626,10.405977,10.06778,81.26661,19.158745,52.595837,19.029108,52.008595,1.8888127,90.903336,-3.5129197,49.519142,73.067375,37.376892,-0.032393623,14.170948,24.226189,54.08443,24.55429,64.06378,30.491562,7.638663,18.743822,57.16991,15.120341,18.262205,44.17948,24.87462,90.307014,20.453978,46.48385,10.83766,10.948418,18.660177,59.094646,66.832245,55.105045,89.38465,36.19381,89.57602,32.360474,79.97782,84.37048,23.61475,53.692005,49.02181,34.73235,17.81072,90.205894,10.464189,64.68469,-3.4141107,88.29649,8.5485325,55.78579,56.930317,47.956894,20.252335,11.890637,13.715588,56.934013,5.2977285,83.838585,4.591866,18.506699,49.226162,76.57468,0.13074511,70.12057,52.473873,35.70987,47.064068,65.39313,83.48704,92.63093,66.777405,94.14307,66.16283,58.388298,85.99751,83.78339,5.0574355,63.65453,3.1913965,65.764084,50.696587,-1.4122351,10.4059105,35.275745,7.6024375,5.553553,33.330788,-0.33933598,20.18879,9.968762,94.42043,68.05741,67.92873,85.13645,25.927715,35.143456,62.995613,26.280525,80.17173,44.91659,55.058895,22.641127,62.86843,68.79352,47.953033,58.949112,43.801266,75.78454,6.460517,86.792435,14.059167,3.6512487,43.969948,34.79865,61.75012,91.49041,33.498817,79.14229,18.030853,61.005657,27.684858,6.3793397,12.51717,68.14935,53.332294,78.54319,23.197712,8.472071,28.103045,-2.503052,41.04902,72.52663,26.666979,88.69664,94.26481,90.51185,1.6254956,42.961227,15.611069,27.217424,57.42107,91.521706,41.320072,15.909109,62.049854,12.940468,43.60353,25.879093,9.416933,89.94893,0.8538566,40.742554,42.482872,42.929077,43.341297,89.55384,25.128794,78.18458,82.7414,85.46951,36.55239,59.998474,15.464155,70.66305,12.151736,64.07275,-1.3859036,70.672615,45.27533,65.2739,94.61805,50.49312,-4.797263,49.90008,51.844517,-2.5367177,78.56922,50.657257,9.387163,40.04704,63.873074,48.52523,37.57891,32.500008,56.195366,-2.1344929,39.323605,55.62354,11.53404,25.859161,83.38025,71.29362,93.16168,23.068146,70.25995,57.2237,88.585945,0.8495195,13.946208,85.490654,56.149208,6.269465,40.52749,94.18761,32.795185,16.444939,30.413612,47.093346,5.6104307,92.80937,-0.98984766,35.08328],"re":[29.758303,21.127459,89.79368,25.68872,61.120476,13.459703,42.83224,51.24224,45.494804,37.410995,-4.3835287,81.9513,72.26706,88.44334,26.45524,0.9461762,81.46015,21.266384,0.9552678,34.642498,23.004915,37.607456,29.543234,34.23746,24.790148,30.278511,61.53172,65.06165,55.133446,6.717642,86.1959,43.73153,66.27115,17.888191,53.706093,0.09655386,81.2553,-4.5790596,27.98564,41.121586,3.2894523,75.41693,9.772261,28.719778,-2.252957,40.9969,54.76082,-4.2905407,42.32313,20.683746,78.06312,42.814583,34.235893,-1.6247556,-0.8538973,10.882523,94.88363,81.52417,28.791836,83.04897,22.63935,94.36802,16.698366,-3.1535845,22.14294,-1.7084079,78.51072,52.542034,80.46757,30.010689,7.4334707,51.307014,59.328266,2.5452437,63.997593,29.76486,5.5535007,5.0023084,57.271595,-2.044051,17.355652,23.448956,22.1928,26.231863,69.9629,51.704624,6.532103,53.0354,9.775446,63.56441,43.01613,67.06198,72.281204,8.78422,21.945383,15.118319,52.149937,86.774796,48.714478,5.5651646,17.191818,33.943428,27.435087,61.868263,55.049065,28.666122,86.94823,68.30134,-0.046518918,47.4085,68.77976,32.013813,57.581608,24.790373,79.48361,7.201597,5.401269,37.85329,9.93452,26.687422,42.0407,80.94376,84.419426,80.23442,59.204586,71.233086,35.441444,47.990017,30.19538,53.823685,-0.33639872,67.60484,18.06674,85.61988,38.797935,2.53309,64.92519,60.3333,61.577213,69.43943,61.05884,9.410106,59.65362,38.590645,18.16474,46.76584,5.9039426,38.644733,48.949123,34.868687,27.533476,55.971428,21.981905,35.824493,47.734077,65.57613,16.506044,44.83337,81.31997,41.52538,33.269596,82.83664,28.895224,31.514027,70.489815,33.41348,74.329796,62.473827,43.699818,46.026726,61.197655,47.473507,39.458183,12.76187,88.923416,-1.7093326,59.326847,16.310095,81.00012,64.89651,82.48148,39.984444,65.20805,70.32004,17.34147,49.99869,44.47657,6.255291,22.00691,74.00245,78.62298,11.649988,85.80334,21.254395,38.59866,-3.0272539,33.827652,18.618177,35.537304,77.811485,44.453808,59.586525,60.64221,38.835526,73.78533,18.519064,14.663195,6.0220876,49.15047,50.864475,73.27523,36.69275,22.722618,29.689734,13.702129,15.269351,21.034836,30.253977,-0.7400439,56.44244,50.46084,4.7494903,18.755474,79.83071,94.258835,92.00804,38.613224,44.895138,39.361202,48.585464,21.221237,54.63229,73.58191,48.91535,51.343277,4.541974,18.314186,82.87343,16.647987,77.19995,58.373432,74.573166,52.486736,60.973812,70.8469,72.30121,7.860795,44.952496,70.532585,93.70527,73.12755,31.912209,27.89156,69.43923,-1.3908963,10.851991,58.462986,92.431625,21.08377,67.30568,92.02914,41.503254,39.868572,11.603199,67.79886,6.6783996,31.826841,37.84701,79.95312,73.99667,26.923552,49.277576,56.99363,76.693985,15.720554,85.42635,53.98994,20.810978,-4.926118,78.38392,15.953736,30.132618,36.97258,2.45377,74.63244,59.72019,52.05285,16.737,33.60606,37.28172,31.044695,12.418916,50.259003,82.68689,33.800644,20.855337,20.561117,27.305555,4.236668,9.117821,6.1767693,7.047943,19.506336,63.905125,60.128998,77.99593,26.770407,31.626865,24.071579,49.241524,82.78668,92.31958,39.725365,39.900208,10.6194,80.080795,26.281609,66.113556,73.20955,34.20957,46.7576,53.884205,5.815053,78.58506,65.63208,34.86441,94.81456,27.817265,27.724546,39.501472,68.08501,63.24682,24.439205,63.326996,72.09617,89.457855,6.3860044,43.440838,43.611145,0.30431512,90.62198,32.85338,40.101128,-3.2987802,66.143616,89.56529,60.49845,21.971773,22.110323,77.617584,71.16927,39.44694,34.22812,94.62124,42.62394,14.869605,85.89604,60.944584,15.215567,36.702667,24.581287,10.79006,27.156006,14.533074,40.82108,16.306284,34.23155,50.151558,71.912155,-0.55586785,50.053577,14.57402,17.757973,92.21127,-4.903627,67.877464,1.4590286,54.85626,61.605938,90.87539,72.16844,26.401003,22.684845,6.711639,7.900552,64.30293,-3.088169,76.97714,25.344604,86.391525,18.042154,47.632698,19.26349,55.388485,85.489845,35.89353,60.6746,12.020381,37.60913,36.106693,7.5038743,32.377213,23.65932,6.18129,58.640015,80.50649,75.365906,43.64111,76.93215,5.030127,56.088623,48.46587,58.025227,49.462036,94.24224,60.379513,41.162224,93.92987,-2.3690174,19.345362,78.85439,-0.9525707,44.031063,52.410904,21.496347,13.39562,64.25594,50.000156,34.80094,73.50363,57.470016,0.30364147,55.450397,24.718966,55.477345,49.598278,38.49144,24.945093,40.843796,93.78508,12.168601,49.088085,50.088703,84.51231,79.78677,53.430637,74.37058,28.452978,-3.0621693,48.457325,31.981045,38.545258,70.32477,46.288925,45.723267,60.171963,84.30131,68.20506,19.746958,2.4039555,51.30849,58.79143,-4.0786257,5.485554,57.080902,36.311314,33.981422,60.4245,34.43929,91.75962,78.642235,19.256922,34.55252,77.63497,30.045658,74.45803,3.415903,56.707233,1.9452661,69.09677,74.70092,-1.3516414,89.072685,24.10291,30.990772,5.3188396,4.378356,8.686027,92.741615,16.135746,18.298164,85.74651,70.8079,76.56567,7.641222,64.12562,93.82188,62.83702,44.828186,39.167645]} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/pure_real.json b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/pure_real.json new file mode 100644 index 000000000000..84920160720f --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/pure_real.json @@ -0,0 +1 @@ +{"cisim":[-0.76804286,-0.5455067,0.77091974,0.9995505,-0.22173488,-0.7555793,0.99999404,0.06444455,0.91867715,0.9423262,0.036830757,0.31446818,-0.4958261,-0.6163564,-0.25928703,0.99263823,-0.61379594,-0.99275196,-0.9804861,-0.51368487,-0.9991082,0.85293645,-0.9484391,-0.30371246,0.4024847,0.27493793,-0.9991245,-0.4451667,-0.16425405,0.9827003,-0.043691803,-0.8082278,-0.7818597,-0.7960615,-0.9758544,0.6448477,0.71528226,-0.99671286,0.7673961,0.6937475,-0.20517772,-0.937905,-0.2131132,0.84840286,-0.843113,0.36069047,-0.3392893,0.4193937,-0.3706098,-0.9195269,-0.70455194,0.53919137,0.51260114,-0.78017217,0.9328547,-0.8046741,0.9983312,0.8661962,-0.9887228,-0.66688836,-0.98275506,-0.46193936,0.19013098,0.6311592,0.97688866,0.79822516,0.9059068,0.93445504,0.13233048,-0.31112042,-0.9639586,0.966726,0.66946274,0.99998856,-0.87634766,-0.7454105,0.0016696325,-0.014383593,-0.9866539,0.98300314,-0.18647727,-0.7441886,-0.5700424,0.5044597,0.739203,0.97618985,0.45571736,0.8653611,-0.8760127,-0.90251935,-0.2530996,-0.13915545,-0.7182041,-0.93790084,0.99557436,0.014321621,0.20743318,0.95426464,-0.5267449,-0.99372405,0.104896694,-0.9731479,-0.62035805,0.63054067,0.19518277,0.9996083,0.4302623,0.5705258,0.94588596,0.8394843,-0.96252024,-0.922492,-0.50434315,-0.2929896,0.66032606,-0.25934267,0.98767954,0.5897077,0.6808229,0.9094655,-0.76587725,-0.9139874,-0.49929643,-0.51545334,-0.947173,-0.55061734,-0.51192635,0.9974889,-0.12980582,-0.9998899,-0.110438846,0.7060805,0.9889585,0.4219699,0.87328386,-0.98665035,-0.509478,0.3700489,0.83564174,0.8133049,-0.41103816,0.68088514,0.99456686,0.8673923,-0.9596396,-0.14274795,-0.4568061,-0.7532721,-0.7972009,-0.26584473,0.9787207,0.24995707,-0.99995345,-0.42305002,0.88267213,-0.977964,-0.56312406,-0.990597,-0.9943174,0.29961216,0.97908384,-0.8972831,0.7544937,-0.5071731,-0.09588606,-0.14350021,0.43460554,-0.077759035,0.82474744,0.2577396,-0.57406634,0.36391532,-0.8008463,0.65774715,-0.21518508,0.9050341,0.844459,-0.9995387,-0.6916198,0.86636347,-0.9981034,0.5702877,0.1166233,-0.056978546,-0.0977326,0.9918349,0.03599666,0.25065774,0.6411889,0.72239554,0.20096625,0.6916205,0.94205296,0.91657287,0.36059362,-0.63567525,0.622754,0.50284165,0.99431705,0.22932193,-0.9629204,0.5185926,0.6218219,0.9911751,-0.99479073,0.97890604,0.7732637,-0.6460107,-0.62659097,0.58519137,-0.98059297,-0.7363992,0.4882133,0.9676871,-0.39063603,-0.9999956,-0.62312716,0.6493478,-0.662521,-0.71182454,0.91920316,0.34371376,-0.1672656,0.357164,0.83566964,0.9691355,-0.99043036,-0.5277155,-0.057497483,-0.4877655,-0.6923957,0.362256,0.35785902,-0.32630214,0.96586305,-0.98611474,-0.10829061,-0.8710436,-0.9917944,-0.55370474,0.96021146,0.37383547,0.32929975,0.60722136,0.36122605,-0.29214212,-0.74585205,0.9809859,0.9151082,-0.2735947,0.91467035,0.9828284,-0.99923426,-0.8758613,-0.88205284,-0.30072355,0.15227714,0.9642799,0.49653357,-0.81708354,-0.9256016,-0.763656,-0.71130943,0.81722915,-0.046571855,0.98032045,0.06450122,-0.90377885,-0.75618476,0.2894483,0.942116,-0.68899655,0.39704642,-0.0041222596,0.18065916,-0.80154777,0.35967124,-0.96544784,0.65012735,-0.96174234,0.59993255,0.15261324,0.24074472,-0.4844956,-0.9530639,-0.8133361,-0.94765824,-0.9770227,0.4977254,0.7898992,-0.4185133,0.5745431,0.860175,-0.17394103,0.8209374,-0.30746835,-0.76824135,-0.13793343,-0.13039061,-0.9574709,0.98120475,-0.33222577,0.87050945,-0.87838477,0.9725157,-0.18525663,-0.19765858,-0.9368691,-0.4549243,-0.08307489,0.042361382,0.88188726,-0.7373959,-0.101238884,-0.5536899,-0.32330078,0.9886272,0.29096916,-0.67996764,0.7205594,-0.506682,-0.84484106,0.97136056,-0.38843104,0.046104014,0.6447025,-0.9185865,0.9063981,0.98902625,-0.2160743,0.3023926,0.36363432,0.34736872,0.8747583,-0.03601581,-0.92976934,-0.17721604,0.74390227,-0.9632821,0.88051414,0.9841728,0.011996482,0.8662815,-0.4384135,0.78529817,-0.99733806,-0.5916974,0.98385787,-0.50623935,-0.9828694,-0.5699034,0.5258567,0.9107381,-0.96713,0.6305915,-0.9092861,0.17941141,0.95230734,0.98416746,-0.42315894,0.99721885,0.41837537,-0.34927684,0.96384645,-0.42967138,-0.65518814,-0.100613244,0.8546874,0.68282235,-0.6616269,-0.8755514,0.62840706,-0.9204273,-0.9907856,-0.37384403,-0.913175,0.95462483,0.42034388,0.99004906,0.9278065,0.9770145,0.030281333,0.6740246,-0.18260802,-0.07780247,-0.44516066,-0.79367274,0.62448967,-0.31388816,0.8931935,0.6104108,0.75645244,0.99978185,-0.88772887,-0.3658438,-0.782335,-0.99949735,0.932057,-0.5503578,-0.111105554,0.29018748,0.8483424,0.9973644,-0.82741594,-0.63365847,-0.09701124,0.07128287,0.45244244,-0.6369038,-0.6526013,-0.16469567,-0.6113549,0.76609623,0.44835582,0.99905384,0.97802764,0.4328095,-0.9207362,-0.47416264,0.9302354,0.77050406,0.9207123,0.6976509,0.9141196,-0.33944228,0.79857695,-0.8251896,0.99999714,0.8302996,0.00024279667,0.38086507,0.51672107,0.7301407,0.17010106,0.0048936093,-0.33871344,-0.9443503,0.37696728,0.97727334,-0.77165294,-0.37392923,0.8986036,-0.802743,0.6267492,-0.8369055,-0.59223837,0.86762613,0.25181955,0.13816597,-0.20239,-0.9239937,-0.18999462,0.209368,0.5558321,-0.29325494,0.70568436,-0.96858937,0.7372631,0.99958014,0.32854077,0.56252366,-0.65428513,-0.9758172,0.7040149,-0.78773844,0.64681095,-0.9592471,0.4946265,0.7236789,0.6264972,0.2677795,0.6747904,-0.9868718,-0.36550152,-0.31113258,-0.88860476,-0.8852651,0.7013057,0.32720965,-0.9209597,0.7943023,0.9953507,0.4558476,0.45222363,0.9128959,0.5276494,0.3217706,0.85613817,-0.45544186,-0.6491239,-0.946586,-0.98948574,-0.9266756,-0.7635299,0.9693671,0.7721947,0.6243213,-0.9273308,0.45317966,-0.6796481],"cisre":[-0.6403985,-0.83810645,-0.63693225,-0.029978858,-0.975107,0.6550572,-0.0034513506,-0.9979213,0.3950092,0.3346959,0.9993215,0.94926804,0.86842185,-0.78746736,-0.9658003,-0.121116824,-0.7894648,-0.12018147,-0.19658859,-0.85797894,0.042223133,0.52201474,0.3169593,-0.95276374,-0.91542673,-0.96146196,-0.041834917,-0.89544773,-0.98641807,0.18520312,0.9990451,0.58887005,-0.62345445,0.60521567,-0.21842216,-0.7643111,-0.6988357,-0.08101492,-0.6411733,0.72021824,0.9787247,0.3468922,0.97702754,0.5293511,0.5377364,0.93268555,-0.94068205,0.9078045,-0.92878866,0.3930271,0.7096524,0.8421833,-0.85862684,0.6255649,-0.36025283,0.5937168,-0.05774767,-0.49970406,0.14975718,-0.74515766,0.18491194,0.8869115,0.9817587,0.7756533,0.21374883,-0.6023592,-0.4234771,-0.3560812,0.99120563,-0.9503705,0.2660522,0.25581414,0.74284565,0.0047876574,0.4816791,0.6666057,0.9999986,0.9998965,-0.16283135,0.18358864,-0.98245925,-0.6679696,0.8216153,-0.86343527,0.6734827,-0.2169178,-0.89012456,0.5011488,-0.48228803,-0.43064925,-0.96744025,0.99027056,0.69583255,0.34690347,-0.0939773,0.9998974,0.9782492,0.29896313,0.85002345,0.11185952,-0.9944831,0.2301805,-0.78431875,0.7761562,-0.9807669,0.027986836,0.9027039,-0.8212797,0.32449922,0.543384,-0.27120984,-0.3860162,-0.86350334,-0.9561156,0.750979,-0.9657854,-0.15649009,-0.8076168,0.7324481,0.41577935,0.6429868,-0.40574256,0.86643124,0.8569176,-0.32072306,-0.83475775,-0.85902935,-0.070822544,0.9915394,0.014839866,0.9938829,0.70813155,-0.148193,-0.90660983,-0.48721176,0.16285297,-0.8604837,0.92901224,0.5492749,-0.5818377,-0.9116181,0.7323902,-0.104099765,-0.49762493,-0.28123268,0.9897591,-0.8895663,0.65770894,-0.6037141,-0.96401584,0.20519675,-0.9682569,0.009648507,0.90610635,-0.46998924,-0.20877379,-0.8263723,-0.13681205,-0.106455766,0.9540611,-0.20345733,0.44145566,-0.6563073,0.8618442,0.9953923,-0.9896503,-0.90062094,-0.9969722,0.5655012,0.9662144,0.8188088,-0.931432,0.59887,-0.7532388,-0.9765733,-0.42533898,-0.5356203,-0.030369742,-0.7222617,-0.499414,0.061560098,-0.82144505,-0.9931762,0.9983754,-0.99521273,0.12752879,0.9993519,-0.96807575,-0.7673831,0.69148004,0.97959816,0.7222611,-0.33546415,-0.39986765,-0.93272305,0.77195656,0.7824177,0.8643786,-0.1064592,-0.97335064,-0.26978564,-0.8550215,-0.78315866,-0.13255915,0.1019384,-0.20431098,0.6340846,0.7633284,-0.77934825,-0.8108952,0.19605467,0.6765473,-0.87272435,0.25215408,-0.9205452,-0.0029719623,-0.7821206,-0.7604916,-0.7490433,-0.70235735,-0.39378366,0.93907446,-0.98591185,0.9340417,-0.5492324,0.24652854,-0.13801324,0.84942114,-0.9983457,-0.8729747,-0.721518,-0.93207866,-0.9337756,-0.94526553,-0.25905314,0.1660655,0.9941193,-0.49120566,-0.12784295,0.83271307,-0.2792739,-0.927495,0.94422543,0.7945327,-0.93247825,0.9563749,0.6661116,-0.19407904,0.40320837,-0.96184504,-0.40420058,-0.18452199,0.039126296,0.4825629,-0.47115052,-0.95371133,0.9883378,0.26488537,-0.86801755,0.57651925,0.37849918,0.6456233,0.702879,0.57631284,-0.99891496,0.19741267,0.99791765,0.42799976,0.6543582,0.9571937,-0.33528697,0.7247646,0.9177985,-0.9999915,-0.9835458,0.5979307,-0.9330791,0.26059633,-0.7598253,0.27395552,0.8000506,0.988286,0.97058845,0.8747937,-0.30276915,-0.5817942,0.31928647,0.21313535,0.86733466,0.6132367,0.9082107,0.8184743,-0.5099989,0.98475605,0.57101816,-0.9515583,0.64016026,-0.9904415,0.9914627,0.28852987,0.19296958,-0.9431999,-0.49215168,0.47795424,0.23283719,-0.98269016,0.9802709,-0.34968036,-0.8905301,-0.9965433,0.99910235,-0.4714603,-0.6754608,0.99486214,0.83272296,0.9462963,0.15038697,0.95673245,-0.73324215,-0.6933932,-0.862133,-0.53501743,0.23761027,0.9214778,-0.99893665,0.76443356,0.39522,0.42242453,0.14774,0.97637695,0.9531835,-0.9315418,0.93772864,0.48455954,-0.9993512,-0.3681426,0.984172,0.6682884,0.26849133,-0.4740199,-0.17721131,0.99992806,-0.4995562,-0.8987734,0.6191178,0.07291645,0.80616015,0.1789515,0.862393,0.18430348,0.8217117,0.8505732,0.41298443,-0.25428244,0.7761149,-0.41617164,-0.9837741,-0.3051404,0.17724107,0.90605545,-0.07452864,-0.90827423,-0.9370196,-0.26645827,0.90298533,0.75546575,-0.9949256,0.51914304,0.7305845,-0.7498332,0.48312494,-0.7778847,-0.3909137,0.13543965,-0.9274916,0.4075677,0.29781103,0.9073649,0.14072268,0.37306175,-0.2131729,0.9995414,-0.7387089,-0.98318577,-0.9969688,-0.8954507,-0.608345,-0.78103304,0.94945997,-0.4496726,0.792085,0.6540487,0.020885402,-0.46036664,0.9306763,-0.62285787,0.0317029,-0.36231157,0.8349289,0.9938086,0.9569698,-0.529448,-0.072555065,0.56158954,0.7736129,0.9952833,0.99745613,-0.8917936,0.7709433,0.75770146,-0.98634446,-0.79135656,-0.6427259,-0.89385515,-0.043490734,-0.20847511,-0.9014854,-0.39018562,0.88043725,-0.36696345,0.6374351,0.39024204,0.7164379,0.4054447,-0.94062686,-0.6018927,-0.5648559,0.0023905623,-0.55731726,-1.0,-0.92463064,-0.8561538,-0.6832968,-0.9854266,-0.999988,0.9408896,-0.32894152,0.92622656,-0.21198314,0.6360438,-0.9274573,0.4387614,-0.59632516,0.779221,-0.5473475,-0.8057628,-0.49721718,-0.9677742,-0.9904091,-0.979305,-0.38240764,0.9817851,0.9778369,-0.8312946,0.9560343,-0.7085263,-0.24866574,0.6756058,0.028975574,0.9444898,-0.8267812,0.75624794,-0.2185882,0.71018517,-0.61600983,0.7626504,0.28256863,-0.86910564,0.69013685,-0.77942365,-0.96348023,-0.7380094,-0.1615056,-0.93081075,-0.9503665,-0.45867372,0.4650868,-0.7128607,-0.9449518,-0.38965777,-0.6075228,-0.09631677,-0.89005786,0.8919046,-0.40819237,0.8494623,-0.94681764,0.51674694,0.8902655,0.7606827,-0.32245144,-0.14463055,0.37586203,-0.64577246,0.24561654,0.63538605,0.7811677,0.37424266,-0.89141923,0.7335383],"im":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"re":[6990.9194,613.18756,8811.287,1189.1228,4979.648,8575.691,7415.733,5324.935,7980.81,1515.4772,722.60315,6396.6025,7149.746,91.770294,7775.704,9583.55,173.44846,972.20245,193.01007,8410.583,1506.4359,6579.5166,7494.592,1762.7421,844.6742,3973.8362,8832.546,2818.47,1837.9967,4562.977,213.5846,2160.4746,3164.4814,8657.309,651.6603,3307.3962,3388.9814,4459.4097,919.6119,9670.589,1771.6516,9731.4375,4850.4043,4399.2427,6156.5186,9940.368,656.939,9010.5205,4056.1758,1073.2578,8073.1113,4354.817,6153.842,3900.9631,649.1074,8412.25,5222.9556,7340.8545,29.995453,8109.1807,4974.898,1306.4224,477.71338,3940.2402,246.39961,8082.3936,7843.4233,730.78436,8576.681,9974.873,8009.76,3306.2676,1150.5564,4682.539,6244.418,5220.486,4549.028,6980.6045,5514.9023,5486.607,3126.0723,1279.4675,3920.101,2170.3118,5976.141,5304.798,7391.6943,7050.78,1022.08514,255.59459,7756.848,6729.152,4322.0303,2417.8098,4261.6646,4706.12,4637.1997,51.532673,9958.294,6985.4434,424.00992,2354.856,2328.5894,9513.425,7693.564,5970.569,3946.2852,9050.321,5367.0806,2237.8103,1078.8624,664.05054,795.35156,5161.934,2174.7034,6418.536,5650.3115,7460.652,5806.412,9438.486,6596.472,7638.3647,2983.9902,143.97173,6601.7305,5199.919,1920.0505,4161.1104,3857.7456,3253.134,6949.0923,8872.642,9577.294,9961.555,6580.5747,1638.5042,6167.481,119.75958,9658.245,3062.103,4910.733,7213.8457,240.43613,3137.4011,3384.781,7860.1216,745.03186,6715.872,73.179276,9139.162,1377.3817,9056.959,4779.943,8852.571,1428.3431,2197.3337,2158.8723,5841.6543,1173.2782,5196.4985,5443.014,99.41739,8126.4453,6829.2905,6082.0273,2566.8252,4514.019,9541.095,7415.1284,7383.0034,1802.6627,9157.37,7576.593,5663.5737,6745.2163,8396.346,7510.5425,9090.168,3120.3652,2659.881,4503.5347,995.278,2773.9094,4002.332,1976.1597,3978.6992,8564.018,9490.498,3872.8877,735.93994,9022.856,5014.7456,6649.523,8521.981,448.87885,200.37305,5473.3267,892.7392,1195.4827,3810.5205,6809.129,524.10077,2264.4172,4525.597,4327.646,8333.28,5058.848,5094.961,4106.739,8912.073,3209.3342,7369.3486,7134.047,1283.0857,8938.232,5150.638,2542.2212,8371.638,9491.476,2963.314,6184.63,1219.2888,9673.132,2237.1792,913.2141,6516.985,7996.7856,5767.408,9955.765,9214.801,2724.5256,1391.3549,8692.421,1159.5801,5279.7085,3303.5515,3750.9531,8850.924,2919.9822,7269.0586,5279.7295,5393.7314,3311.5742,1540.033,3804.099,1865.8096,4642.432,4651.323,3708.235,7844.834,2270.2168,1434.3226,8807.494,5911.41,7104.221,1819.2876,2683.073,1930.2406,8239.878,3172.0522,99.34834,4196.299,3838.2349,2168.6555,6958.6743,6202.876,1539.445,8745.065,3944.983,2048.612,4689.169,7111.8057,6748.5493,7480.136,8259.065,577.12317,2239.5876,155.77248,6115.973,3586.4055,5806.3066,3405.6396,5843.6055,4674.184,8788.298,1003.1179,9737.691,6866.1655,9462.998,1012.5035,3298.2405,5247.072,5003.5215,9977.523,9011.051,5865.666,5641.4243,7643.6333,7954.382,5584.4736,5561.9956,8020.8247,9439.43,7846.626,7874.167,3635.009,7319.712,3252.762,386.88818,6600.5693,7194.2896,5072.5923,7958.4834,7973.2607,7275.342,8224.36,3501.154,6999.7637,5394.8623,3470.6553,4678.363,7204.678,6831.1533,6025.176,2246.1926,7559.3726,1312.0212,5480.0723,7113.9883,1715.0918,4674.997,3753.831,741.7706,176.99413,9603.885,7211.149,4844.1577,1257.476,6319.5854,5235.958,8584.58,8362.932,2201.2087,7826.161,8904.177,8172.9263,2286.4463,5599.709,7727.787,2518.1719,439.21658,1338.8722,3978.4014,3692.685,6265.018,268.17694,9050.748,5003.2964,8106.7017,6571.775,3319.1672,6537.2227,1674.8257,2131.8403,7476.5464,3071.7632,8334.746,9143.06,2551.7249,7348.908,5276.809,7812.4614,2750.0627,1977.7684,2271.7546,470.0879,9243.834,641.3187,9614.703,3105.082,4469.1304,929.9417,5889.7466,8108.6343,7662.4224,6173.691,8894.766,7001.9355,6904.9014,1711.0636,5454.4614,6013.866,5204.0273,5030.782,6188.563,3089.084,9976.159,825.0388,5585.169,131.83556,8777.904,8038.3228,1157.7495,1676.636,2412.057,7577.4243,6390.071,4727.6274,7042.7603,489.37744,876.6698,4841.852,7165.1,530.46423,7937.2773,7767.798,2289.7734,7764.0454,9342.603,3275.486,4216.897,5159.665,4355.0195,8269.825,606.6737,7359.8267,7518.802,8282.807,3388.7988,1033.5837,46.73316,1661.3595,2264.2698,8252.793,-3.1464863,2550.6277,7669.8633,6817.6426,9721.872,6338.8525,8416.71,3745.895,9039.294,8482.978,387.4075,167.13824,6329.259,3471.2053,8114.595,6091.752,1568.8331,8180.516,502.86575,2321.0476,6276.6045,4582.8003,595.0805,5134.1914,2005.8779,3286.4407,1497.9423,9863.888,4767.1465,2507.772,7198.296,9394.065,7695.6177,3590.323,7245.322,6266.8003,1517.1182,6040.542,5816.4966,3754.5774,4986.024,2517.51,8211.036,7272.01,2289.8877,9171.4795,963.5511,9395.029,7856.65,2331.531,5015.973,9701.794,3370.6013,1521.5586,4573.686,7614.514,7852.0825,1550.2308,2436.6904,2536.134,6504.4194,9802.651,9796.16,30.22871,4608.246,451.64206]} diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/runner.jl new file mode 100644 index 000000000000..2a7834005470 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/fixtures/julia/runner.jl @@ -0,0 +1,81 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import JSON + +""" + gen( re, im, name ) + +Generate fixture data and write to file. + +# Arguments + +* `re`: real components +* `im`: imaginary components +* `name::AbstractString`: output filename + +# Examples + +``` julia +julia> re = rand( Float32, 1000 ); +julia> im = rand( Float32, 1000 ); +julia> gen( re, im, \"data.json\" ); +``` +""" +function gen( re, im, name ) + cisre = Array{Float32}( undef, length(re) ); + cisim = Array{Float32}( undef, length(re) ); + for i in eachindex( re ) + z = cis( Complex{Float32}( re[i], im[i] ) ); + cisre[ i ] = real( z ); + cisim[ i ] = imag( z ); + end + + # Store data to be written to file as a collection: + data = Dict([ + ("re", re), + ("im", im), + ("cisre", cisre), + ("cisim", cisim), + ]); + + # 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 ); + +# Pure real: +re = Float32.( ( rand( 500 ) .* 10000.0 ) .- 5.0 ); +im = zeros( Float32, 500 ); +gen( re, im, "pure_real.json" ); + +# General complex: +re = Float32.( ( rand( 500 ) .* 100.0 ) .- 5.0 ); +im = Float32.( ( rand( 500 ) .* 100.0 ) .- 5.0 ); +gen( re, im, "general_complex.json" ); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.assign.js b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.assign.js new file mode 100644 index 000000000000..36c08a70d31e --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.assign.js @@ -0,0 +1,193 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var Float32Array = require( '@stdlib/array/float32' ); +var ccisf = require( './../lib/assign.js' ); + + +// FIXTURES // + +var pureReal = require( './fixtures/julia/pure_real.json' ); +var generalComplex = require( './fixtures/julia/general_complex.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ccisf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function evaluates the cis function', function test( t ) { + var expected; + var out; + var v; + + out = new Float32Array( 2 ); + v = ccisf( 0.0, 0.0, out, 1, 0 ); + + expected = new Float32Array( [ 1.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 4 ); + v = ccisf( 0.0, 0.0, out, 2, 0 ); + + expected = new Float32Array( [ 1.0, 0.0, 0.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 4 ); + v = ccisf( 0.0, 0.0, out, 2, 1 ); + + expected = new Float32Array( [ 0.0, 1.0, 0.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + out = new Float32Array( 4 ); + v = ccisf( 0.0, 0.0, out, -2, 3 ); + + expected = new Float32Array( [ 0.0, 0.0, 0.0, 1.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes cis(z) for pure real z', function test( t ) { + var cisre; + var cisim; + var out; + var re; + var im; + var i; + + re = pureReal.re; + im = pureReal.im; + cisre = pureReal.cisre; + cisim = pureReal.cisim; + + out = new Float32Array( 2 ); + + for ( i = 0; i < re.length; i++ ) { + ccisf( f32( re[ i ] ), f32( im[ i ] ), out, 1, 0 ); + t.strictEqual( isAlmostSameValuef( out[ 0 ], f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( out[ 1 ], f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes cis(z) for complex z', function test( t ) { + var cisre; + var cisim; + var out; + var re; + var im; + var i; + + re = generalComplex.re; + im = generalComplex.im; + cisre = generalComplex.cisre; + cisim = generalComplex.cisim; + + out = new Float32Array( 2 ); + + for ( i = 0; i < re.length; i++ ) { + ccisf( f32( re[ i ] ), f32( im[ i ] ), out, 1, 0 ); + t.strictEqual( isAlmostSameValuef( out[ 0 ], f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( out[ 1 ], f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'if real component is `+Infinity`, all components are `NaN`', function test( t ) { + var out = new Float32Array( 2 ); + + ccisf( PINF, 0.0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if real component is `-Infinity`, all components are `NaN`', function test( t ) { + var out = new Float32Array( 2 ); + + ccisf( NINF, 0.0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `+Infinity`, all components are zero', function test( t ) { + var out = new Float32Array( 2 ); + + ccisf( 1.0, PINF, out, 1, 0 ); + t.strictEqual( out[ 0 ], 0.0, 'returns expected value' ); + t.strictEqual( out[ 1 ], 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `-Infinity`, the function computes the correct result according to IEEE 754 rules', function test( t ) { + var out = new Float32Array( 2 ); + + ccisf( 0.0, NINF, out, 1, 0 ); + + // The real component is computed as Infinity * 1.0 = Infinity: + t.strictEqual( out[ 0 ], PINF, 'returns expected value' ); + + // The imaginary component is computed as Infinity * 0.0 = NaN: + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { + var out; + + out = new Float32Array( 2 ); + ccisf( NaN, 3.0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + ccisf( 5.0, NaN, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + + out = new Float32Array( 2 ); + ccisf( NaN, NaN, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.js b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.js new file mode 100644 index 000000000000..34834b6aec4c --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.js @@ -0,0 +1,44 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isMethod = require( '@stdlib/assert/is-method' ); +var ccisf = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ccisf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is an `assign` method', function test( t ) { + t.strictEqual( isMethod( ccisf, 'assign' ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'attached to the main export is a `strided` method', function test( t ) { + t.strictEqual( isMethod( ccisf, 'strided' ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.main.js b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.main.js new file mode 100644 index 000000000000..791693046afd --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.main.js @@ -0,0 +1,166 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var ccisf = require( './../lib' ); + + +// FIXTURES // + +var pureReal = require( './fixtures/julia/pure_real.json' ); +var generalComplex = require( './fixtures/julia/general_complex.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ccisf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function evaluates the cis function for a single-precision complex floating-point number', function test( t ) { + var v; + var z; + + z = new Complex64( 0.0, 0.0 ); + v = ccisf( z ); + + t.strictEqual( realf( v ), 1.0, 'returns expected value' ); + t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes cis(z) for pure real z', function test( t ) { + var cisre; + var cisim; + var re; + var im; + var i; + var q; + var z; + + re = pureReal.re; + im = pureReal.im; + cisre = pureReal.cisre; + cisim = pureReal.cisim; + + for ( i = 0; i < re.length; i++ ) { + z = new Complex64( re[ i ], im[ i ] ); + q = ccisf( z ); + + t.strictEqual( isAlmostSameValuef( realf( q ), f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( imagf( q ), f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes cis(z) for complex z', function test( t ) { + var cisre; + var cisim; + var re; + var im; + var i; + var q; + var z; + + re = generalComplex.re; + im = generalComplex.im; + cisre = generalComplex.cisre; + cisim = generalComplex.cisim; + + for ( i = 0; i < re.length; i++ ) { + z = new Complex64( re[ i ], im[ i ] ); + q = ccisf( z ); + + t.strictEqual( isAlmostSameValuef( realf( q ), f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( imagf( q ), f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'if real component is `+Infinity`, all components are `NaN`', function test( t ) { + var v; + + v = ccisf( new Complex64( PINF, 0.0 ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if real component is `-Infinity`, all components are `NaN`', function test( t ) { + var v; + + v = ccisf( new Complex64( NINF, 0.0 ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `+Infinity`, all components are zero', function test( t ) { + var v; + + v = ccisf( new Complex64( 1.0, PINF ) ); + t.strictEqual( realf( v ), 0.0, 'returns expected value' ); + t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `-Infinity`, the function computes the correct result according to IEEE 754 rules', function test( t ) { + var v; + + v = ccisf( new Complex64( 0.0, NINF ) ); + + // The real component is computed as Infinity * 1.0 = Infinity: + t.strictEqual( realf( v ), PINF, 'returns expected value' ); + + // The imaginary component is computed as Infinity * 0.0 = NaN: + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { + var v; + + v = ccisf( new Complex64( NaN, 3.0 ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + v = ccisf( new Complex64( 5.0, NaN ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + v = ccisf( new Complex64( NaN, NaN ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.native.js new file mode 100644 index 000000000000..5707f36edf4b --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.native.js @@ -0,0 +1,175 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var Complex64 = require( '@stdlib/complex/float32/ctor' ); +var realf = require( '@stdlib/complex/float32/real' ); +var imagf = require( '@stdlib/complex/float32/imag' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var ccisf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( ccisf instanceof Error ) +}; + + +// FIXTURES // + +var pureReal = require( './fixtures/julia/pure_real.json' ); +var generalComplex = require( './fixtures/julia/general_complex.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ccisf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function evaluates the cis function for a single-precision complex floating-point number', opts, function test( t ) { + var v; + var z; + + z = new Complex64( 0.0, 0.0 ); + v = ccisf( z ); + + t.strictEqual( realf( v ), 1.0, 'returns expected value' ); + t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes cis(z) for pure real z', opts, function test( t ) { + var cisre; + var cisim; + var re; + var im; + var i; + var q; + var z; + + re = pureReal.re; + im = pureReal.im; + cisre = pureReal.cisre; + cisim = pureReal.cisim; + + for ( i = 0; i < re.length; i++ ) { + z = new Complex64( re[ i ], im[ i ] ); + q = ccisf( z ); + + t.strictEqual( isAlmostSameValuef( realf( q ), f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( imagf( q ), f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes cis(z) for complex z', opts, function test( t ) { + var cisre; + var cisim; + var re; + var im; + var i; + var q; + var z; + + re = generalComplex.re; + im = generalComplex.im; + cisre = generalComplex.cisre; + cisim = generalComplex.cisim; + + for ( i = 0; i < re.length; i++ ) { + z = new Complex64( re[ i ], im[ i ] ); + q = ccisf( z ); + + t.strictEqual( isAlmostSameValuef( realf( q ), f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( imagf( q ), f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'if real component is `+Infinity`, all components are `NaN`', opts, function test( t ) { + var v; + + v = ccisf( new Complex64( PINF, 0.0 ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if real component is `-Infinity`, all components are `NaN`', opts, function test( t ) { + var v; + + v = ccisf( new Complex64( NINF, 0.0 ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `+Infinity`, all components are zero', opts, function test( t ) { + var v; + + v = ccisf( new Complex64( 1.0, PINF ) ); + t.strictEqual( realf( v ), 0.0, 'returns expected value' ); + t.strictEqual( imagf( v ), 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `-Infinity`, the function computes the correct result according to IEEE 754 rules', opts, function test( t ) { + var v; + + v = ccisf( new Complex64( 0.0, NINF ) ); + + // The real component is computed as Infinity * 1.0 = Infinity: + t.strictEqual( realf( v ), PINF, 'returns expected value' ); + + // The imaginary component is computed as Infinity * 0.0 = NaN: + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', opts, function test( t ) { + var v; + + v = ccisf( new Complex64( NaN, 3.0 ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + v = ccisf( new Complex64( 5.0, NaN ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + v = ccisf( new Complex64( NaN, NaN ) ); + t.strictEqual( isnanf( realf( v ) ), true, 'returns expected value' ); + t.strictEqual( isnanf( imagf( v ) ), true, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.strided.js b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.strided.js new file mode 100644 index 000000000000..31a38612f4fc --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/ccisf/test/test.strided.js @@ -0,0 +1,214 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); +var isAlmostSameValuef = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var PINF = require( '@stdlib/constants/float32/pinf' ); +var NINF = require( '@stdlib/constants/float32/ninf' ); +var Float32Array = require( '@stdlib/array/float32' ); +var ccisf = require( './../lib/strided.js' ); + + +// FIXTURES // + +var pureReal = require( './fixtures/julia/pure_real.json' ); +var generalComplex = require( './fixtures/julia/general_complex.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ccisf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function evaluates the cis function', function test( t ) { + var expected; + var out; + var z; + var v; + + z = new Float32Array( [ 0.0, 0.0 ] ); + out = new Float32Array( 2 ); + v = ccisf( z, 1, 0, out, 1, 0 ); + + expected = new Float32Array( [ 1.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + out = new Float32Array( 4 ); + v = ccisf( z, 2, 0, out, 2, 0 ); + + expected = new Float32Array( [ 1.0, 0.0, 0.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + out = new Float32Array( 4 ); + v = ccisf( z, 2, 1, out, 2, 1 ); + + expected = new Float32Array( [ 0.0, 1.0, 0.0, 0.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + z = new Float32Array( [ 0.0, 0.0 ] ); + out = new Float32Array( 4 ); + v = ccisf( z, -1, 1, out, -2, 3 ); + + expected = new Float32Array( [ 0.0, 0.0, 0.0, 1.0 ] ); + + t.strictEqual( v, out, 'returns expected value' ); + t.strictEqual( isSameFloat32Array( out, expected ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes cis(z) for pure real z', function test( t ) { + var cisre; + var cisim; + var out; + var re; + var im; + var z; + var i; + + re = pureReal.re; + im = pureReal.im; + cisre = pureReal.cisre; + cisim = pureReal.cisim; + + z = new Float32Array( 2 ); + out = new Float32Array( 2 ); + + for ( i = 0; i < re.length; i++ ) { + z[ 0 ] = re[ i ]; + z[ 1 ] = im[ i ]; + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( isAlmostSameValuef( out[ 0 ], f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( out[ 1 ], f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function computes cis(z) for complex z', function test( t ) { + var cisre; + var cisim; + var out; + var re; + var im; + var z; + var i; + + re = generalComplex.re; + im = generalComplex.im; + cisre = generalComplex.cisre; + cisim = generalComplex.cisim; + + z = new Float32Array( 2 ); + out = new Float32Array( 2 ); + + for ( i = 0; i < re.length; i++ ) { + z[ 0 ] = re[ i ]; + z[ 1 ] = im[ i ]; + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( isAlmostSameValuef( out[ 0 ], f32( cisre[ i ] ), 2 ), true, 'returns expected value' ); + t.strictEqual( isAlmostSameValuef( out[ 1 ], f32( cisim[ i ] ), 2 ), true, 'returns expected value' ); + } + t.end(); +}); + +tape( 'if real component is `+Infinity`, all components are `NaN`', function test( t ) { + var out = new Float32Array( 2 ); + var z = new Float32Array( [ PINF, 0.0 ] ); + + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if real component is `-Infinity`, all components are `NaN`', function test( t ) { + var out = new Float32Array( 2 ); + var z = new Float32Array( [ NINF, 0.0 ] ); + + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `+Infinity`, all components are zero', function test( t ) { + var out = new Float32Array( 2 ); + var z = new Float32Array( [ 1.0, PINF ] ); + + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( out[ 0 ], 0.0, 'returns expected value' ); + t.strictEqual( out[ 1 ], 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if imaginary component is `-Infinity`, the function computes the correct result according to IEEE 754 rules', function test( t ) { + var out = new Float32Array( 2 ); + var z = new Float32Array( [ 0.0, NINF ] ); + + ccisf( z, 1, 0, out, 1, 0 ); + + // The real component is computed as Infinity * 1.0 = Infinity: + t.strictEqual( out[ 0 ], PINF, 'returns expected value' ); + + // The imaginary component is computed as Infinity * 0.0 = NaN: + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { + var out; + var z; + + z = new Float32Array( [ NaN, 3.0 ] ); + out = new Float32Array( 2 ); + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + + z = new Float32Array( [ 5.0, NaN ] ); + out = new Float32Array( 2 ); + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + + z = new Float32Array( [ NaN, NaN ] ); + out = new Float32Array( 2 ); + ccisf( z, 1, 0, out, 1, 0 ); + t.strictEqual( isnanf( out[ 0 ] ), true, 'returns expected value' ); + t.strictEqual( isnanf( out[ 1 ] ), true, 'returns expected value' ); + + t.end(); +});