diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/README.md b/lib/node_modules/@stdlib/math/base/special/ccis/README.md index 311b125624e..7cbdf5c23d6 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/README.md +++ b/lib/node_modules/@stdlib/math/base/special/ccis/README.md @@ -91,24 +91,17 @@ im = imag( v ); ```javascript var Complex128 = require( '@stdlib/complex/float64' ); -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); +var uniform = require( '@stdlib/random/base/uniform' ); var ccis = require( '@stdlib/math/base/special/ccis' ); -var re; -var im; var z1; var z2; var i; for ( i = 0; i < 100; i++ ) { - re = round( randu()*100.0 ) - 50.0; - im = round( randu()*100.0 ) - 50.0; - z1 = new Complex128( re, im ); - + z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); z2 = ccis( z1 ); - - console.log( 'cis(%s) = %s', z1.toString(), z2.toString() ); + console.log( 'ccis(%s) = %s', z1.toString(), z2.toString() ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/index.d.ts b/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/index.d.ts index 29bff0234b2..23fe5383025 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/index.d.ts @@ -23,8 +23,7 @@ import { Complex128 } from '@stdlib/types/object'; /** -* Evaluates the cis function for a double-precision complex floating-point -* number. +* Evaluates the cis function for a double-precision complex floating-point number. * * @param z - complex number * @returns result diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/test.ts b/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/test.ts index 1eee3607fd5..aa009fca62f 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/test.ts +++ b/lib/node_modules/@stdlib/math/base/special/ccis/docs/types/test.ts @@ -22,7 +22,7 @@ import ccis = require( './index' ); // TESTS // -// The function returns an array of numbers... +// The function returns a double-precision complex floating-point number. { const z = new Complex128( 1.0, 1.0 ); diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/examples/index.js b/lib/node_modules/@stdlib/math/base/special/ccis/examples/index.js index d26258120f0..c9814c62a46 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/examples/index.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/examples/index.js @@ -19,22 +19,15 @@ 'use strict'; var Complex128 = require( '@stdlib/complex/float64' ); -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var cis = require( './../lib' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var ccis = require( './../lib' ); -var re; -var im; var z1; var z2; var i; for ( i = 0; i < 100; i++ ) { - re = round( randu()*100.0 ) - 50.0; - im = round( randu()*100.0 ) - 50.0; - z1 = new Complex128( re, im ); - - z2 = cis( z1 ); - - console.log( 'cis(%s) = %s', z1.toString(), z2.toString() ); + z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) ); + z2 = ccis( z1 ); + console.log( 'ccis(%s) = %s', z1.toString(), z2.toString() ); } diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/include/stdlib/math/base/special/ccis.h b/lib/node_modules/@stdlib/math/base/special/ccis/include/stdlib/math/base/special/ccis.h index 5eb7d5dd3d5..b61a50cc7b5 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/include/stdlib/math/base/special/ccis.h +++ b/lib/node_modules/@stdlib/math/base/special/ccis/include/stdlib/math/base/special/ccis.h @@ -29,8 +29,7 @@ extern "C" { #endif /** -* Evaluates the cis function for a double-precision complex floating-point -* number. +* Evaluates the cis function for a double-precision complex floating-point number. */ stdlib_complex128_t stdlib_base_ccis( const stdlib_complex128_t z ); diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/lib/index.js b/lib/node_modules/@stdlib/math/base/special/ccis/lib/index.js index 3640bf5f2b8..88eb1524a31 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/lib/index.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/lib/index.js @@ -19,8 +19,7 @@ 'use strict'; /** -* Evaluate the cis function for a double-precision complex floating-point. -* number. +* Evaluate the cis function for a double-precision complex floating-point number. * * @module @stdlib/math/base/special/ccis * diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/lib/main.js b/lib/node_modules/@stdlib/math/base/special/ccis/lib/main.js index bbfedbf988e..011fff3aaaa 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/lib/main.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/lib/main.js @@ -30,8 +30,7 @@ var imag = require( '@stdlib/complex/imag' ); // MAIN // /** -* Evaluates the cis function for a double-precision complex floating-point. -* number. +* Evaluates the cis function for a double-precision complex floating-point number. * * @param {Complex128} z - complex number * @returns {Complex128} result diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/lib/native.js b/lib/node_modules/@stdlib/math/base/special/ccis/lib/native.js index 95f955cf326..5481d09c8ea 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/lib/native.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/lib/native.js @@ -27,8 +27,7 @@ var addon = require( './../src/addon.node' ); // MAIN // /** -* Evaluates the cis function for a double-precision complex floating-point. -* number. +* Evaluates the cis function for a double-precision complex floating-point number. * * @private * @param {Complex128} z - complex number diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/manifest.json b/lib/node_modules/@stdlib/math/base/special/ccis/manifest.json index 18b909a00f2..51828ebe4dd 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/manifest.json +++ b/lib/node_modules/@stdlib/math/base/special/ccis/manifest.json @@ -1,75 +1,78 @@ { - "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/float64", - "@stdlib/complex/reim" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64", - "@stdlib/complex/reim" - ] - }, - { - "task": "examples", - "src": [ - "./src/main.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/complex/float64", - "@stdlib/complex/reim" - ] - } - ] - } + "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/float64", + "@stdlib/complex/reim", + "@stdlib/math/base/special/exp" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/complex/float64", + "@stdlib/complex/reim", + "@stdlib/math/base/special/exp" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/complex/float64", + "@stdlib/complex/reim", + "@stdlib/math/base/special/exp" + ] + } + ] + } diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/package.json b/lib/node_modules/@stdlib/math/base/special/ccis/package.json index c0ba5632c8a..08a64c21fcd 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/package.json +++ b/lib/node_modules/@stdlib/math/base/special/ccis/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/math/base/special/ccis", "version": "0.0.0", - "description": "Compute the cis function of a double-precision complex floating-point number.", + "description": "Compute the ccis function of a double-precision complex floating-point number.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/src/main.c b/lib/node_modules/@stdlib/math/base/special/ccis/src/main.c index adacbf5fd95..82dc1324682 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/ccis/src/main.c @@ -19,12 +19,12 @@ #include "stdlib/math/base/special/ccis.h" #include "stdlib/complex/float64.h" #include "stdlib/complex/reim.h" +#include "stdlib/math/base/special/exp.h" #include /** -* Evaluates the cis function for a double-precision complex floating-point -* number. +* Evaluates the cis function for a double-precision complex floating-point number. * * @param z input value * @return result @@ -69,11 +69,11 @@ stdlib_complex128_t stdlib_base_ccis( const stdlib_complex128_t z ) { stdlib_reim( z, &re, &im ); - y = sin( re ); - x = cos( re ); + y = sin( re ); //TODO: use stdlib function once available + x = cos( re ); //TODO: use stdlib function once available tmp = y; if( im != 0.0 ){ - e = exp( -im ); + e = stdlib_base_exp( -im ); tmp *= e; x *= e; } diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js index 924a32f454d..3977ead19af 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.js @@ -29,7 +29,7 @@ var abs = require( '@stdlib/math/base/special/abs' ); var EPS = require( '@stdlib/constants/float64/eps' ); var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); -var cis = require( './../lib' ); +var ccis = require( './../lib' ); // FIXTURES // @@ -42,7 +42,7 @@ var generalComplex = require( './fixtures/julia/general_complex.json' ); tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof cis, 'function', 'main export is a function' ); + t.strictEqual( typeof ccis, 'function', 'main export is a function' ); t.end(); }); @@ -51,7 +51,7 @@ tape( 'the function works without output array specified', function test( t ) { var z; z = new Complex128( 0.0, 0.0 ); - v = cis( z ); + v = ccis( z ); t.strictEqual( real( v ), 1.0, 'returns expected value' ); t.strictEqual( imag( v ), 0.0, 'returns expected value' ); @@ -59,7 +59,7 @@ tape( 'the function works without output array specified', function test( t ) { t.end(); }); -tape( 'the function computes cis(z) for pure real z', function test( t ) { +tape( 'the function computes ccis(z) for pure real z', function test( t ) { var delta; var cisre; var cisim; @@ -77,7 +77,7 @@ tape( 'the function computes cis(z) for pure real z', function test( t ) { for ( i = 0; i < re.length; i++ ) { z = new Complex128( re[ i ], im[ i ] ); - q = cis( z ); + q = ccis( z ); if ( real( q ) === cisre[ i ] ) { t.strictEqual( real( q ), cisre[ i ], 'returns expected real component' ); @@ -97,7 +97,7 @@ tape( 'the function computes cis(z) for pure real z', function test( t ) { t.end(); }); -tape( 'the function computes cis(z) for complex z', function test( t ) { +tape( 'the function computes ccis(z) for complex z', function test( t ) { var delta; var cisre; var cisim; @@ -115,7 +115,7 @@ tape( 'the function computes cis(z) for complex z', function test( t ) { for ( i = 0; i < re.length; i++ ) { z = new Complex128( re[ i ], im[ i ] ); - q = cis( z ); + q = ccis( z ); if ( real( q ) === cisre[ i ] ) { t.strictEqual( real( q ), cisre[ i ], 'returns expected real component' ); @@ -138,7 +138,7 @@ tape( 'the function computes cis(z) for complex z', function test( t ) { tape( 'if real component is `+Infinity`, the function returns `[NaN, NaN]`', function test( t ) { var v; - v = cis( new Complex128( PINF, 0.0 ) ); + v = ccis( new Complex128( PINF, 0.0 ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); t.end(); @@ -147,7 +147,7 @@ tape( 'if real component is `+Infinity`, the function returns `[NaN, NaN]`', fun tape( 'if real component is `-Infinity`, the function returns `[NaN, NaN]`', function test( t ) { var v; - v = cis( new Complex128( NINF, 0.0 ) ); + v = ccis( new Complex128( NINF, 0.0 ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); t.end(); @@ -156,7 +156,7 @@ tape( 'if real component is `-Infinity`, the function returns `[NaN, NaN]`', fun tape( 'if imaginary component is `+Infinity`, the function returns `[0.0, 0.0]`', function test( t ) { var v; - v = cis( new Complex128( 1.0, PINF ) ); + v = ccis( new Complex128( 1.0, PINF ) ); t.strictEqual( real( v ), 0.0, 'returns 0.0' ); t.strictEqual( imag( v ), 0.0, 'returns 0.0' ); t.end(); @@ -165,7 +165,7 @@ tape( 'if imaginary component is `+Infinity`, the function returns `[0.0, 0.0]`' tape( 'if imaginary component is `-Infinity`, the function computes the correct result according to IEEE 754 rules', function test( t ) { var v; - v = cis( new Complex128( 0.0, NINF ) ); + v = ccis( new Complex128( 0.0, NINF ) ); // The real component is computed as Infinity * 1.0 = Infinity: t.strictEqual( real( v ), PINF, 'returns +Infinity' ); @@ -178,15 +178,15 @@ tape( 'if imaginary component is `-Infinity`, the function computes the correct tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', function test( t ) { var v; - v = cis( new Complex128( NaN, 3.0 ) ); + v = ccis( new Complex128( NaN, 3.0 ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); - v = cis( new Complex128( 5.0, NaN ) ); + v = ccis( new Complex128( 5.0, NaN ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); - v = cis( new Complex128( NaN, NaN ) ); + v = ccis( new Complex128( NaN, NaN ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); diff --git a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js index 2a71c4d441d..45ecad35292 100644 --- a/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/ccis/test/test.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* Copyright (c) 2023 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. @@ -35,9 +35,9 @@ var tryRequire = require( '@stdlib/utils/try-require' ); // VARIABLES // -var cis = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var ccis = tryRequire( resolve( __dirname, './../lib/native.js' ) ); var opts = { - 'skip': ( cis instanceof Error ) + 'skip': ( ccis instanceof Error ) }; @@ -51,7 +51,7 @@ var generalComplex = require( './fixtures/julia/general_complex.json' ); tape( 'main export is a function', opts, function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof cis, 'function', 'main export is a function' ); + t.strictEqual( typeof ccis, 'function', 'main export is a function' ); t.end(); }); @@ -60,7 +60,7 @@ tape( 'the function works without output array specified', opts, function test( var z; z = new Complex128( 0.0, 0.0 ); - v = cis( z ); + v = ccis( z ); t.strictEqual( real( v ), 1.0, 'returns expected value' ); t.strictEqual( imag( v ), 0.0, 'returns expected value' ); @@ -68,7 +68,7 @@ tape( 'the function works without output array specified', opts, function test( t.end(); }); -tape( 'the function computes cis(z) for pure real z', opts, function test( t ) { +tape( 'the function computes ccis(z) for pure real z', opts, function test( t ) { var delta; var cisre; var cisim; @@ -86,7 +86,7 @@ tape( 'the function computes cis(z) for pure real z', opts, function test( t ) { for ( i = 0; i < re.length; i++ ) { z = new Complex128( re[ i ], im[ i ] ); - q = cis( z ); + q = ccis( z ); if ( real( q ) === cisre[ i ] ) { t.strictEqual( real( q ), cisre[ i ], 'returns expected real component' ); @@ -106,7 +106,7 @@ tape( 'the function computes cis(z) for pure real z', opts, function test( t ) { t.end(); }); -tape( 'the function computes cis(z) for complex z', opts, function test( t ) { +tape( 'the function computes ccis(z) for complex z', opts, function test( t ) { var delta; var cisre; var cisim; @@ -124,7 +124,7 @@ tape( 'the function computes cis(z) for complex z', opts, function test( t ) { for ( i = 0; i < re.length; i++ ) { z = new Complex128( re[ i ], im[ i ] ); - q = cis( z ); + q = ccis( z ); if ( real( q ) === cisre[ i ] ) { t.strictEqual( real( q ), cisre[ i ], 'returns expected real component' ); @@ -147,7 +147,7 @@ tape( 'the function computes cis(z) for complex z', opts, function test( t ) { tape( 'if real component is `+Infinity`, the function returns `[NaN, NaN]`', opts, function test( t ) { var v; - v = cis( new Complex128( PINF, 0.0 ) ); + v = ccis( new Complex128( PINF, 0.0 ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); t.end(); @@ -156,7 +156,7 @@ tape( 'if real component is `+Infinity`, the function returns `[NaN, NaN]`', opt tape( 'if real component is `-Infinity`, the function returns `[NaN, NaN]`', opts, function test( t ) { var v; - v = cis( new Complex128( NINF, 0.0 ) ); + v = ccis( new Complex128( NINF, 0.0 ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); t.end(); @@ -165,7 +165,7 @@ tape( 'if real component is `-Infinity`, the function returns `[NaN, NaN]`', opt tape( 'if imaginary component is `+Infinity`, the function returns `[0.0, 0.0]`', opts, function test( t ) { var v; - v = cis( new Complex128( 1.0, PINF ) ); + v = ccis( new Complex128( 1.0, PINF ) ); t.strictEqual( real( v ), 0.0, 'returns 0.0' ); t.strictEqual( imag( v ), 0.0, 'returns 0.0' ); t.end(); @@ -174,7 +174,7 @@ tape( 'if imaginary component is `+Infinity`, the function returns `[0.0, 0.0]`' tape( 'if imaginary component is `-Infinity`, the function computes the correct result according to IEEE 754 rules', opts, function test( t ) { var v; - v = cis( new Complex128( 0.0, NINF ) ); + v = ccis( new Complex128( 0.0, NINF ) ); // The real component is computed as Infinity * 1.0 = Infinity: t.strictEqual( real( v ), PINF, 'returns +Infinity' ); @@ -187,15 +187,15 @@ tape( 'if imaginary component is `-Infinity`, the function computes the correct tape( 'if a real or imaginary component is `NaN`, all components are `NaN`', opts, function test( t ) { var v; - v = cis( new Complex128( NaN, 3.0 ) ); + v = ccis( new Complex128( NaN, 3.0 ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); - v = cis( new Complex128( 5.0, NaN ) ); + v = ccis( new Complex128( 5.0, NaN ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' ); - v = cis( new Complex128( NaN, NaN ) ); + v = ccis( new Complex128( NaN, NaN ) ); t.strictEqual( isnan( real( v ) ), true, 'returns NaN' ); t.strictEqual( isnan( imag( v ) ), true, 'returns NaN' );