Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jun 16, 2024
1 parent 02519d6 commit 64f0781
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 67 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ This release closes the following issue:

##### Bug Fixes

- [`53cf211`](https://github.com/stdlib-js/stdlib/commit/53cf211f341dc87077710b30ac41a0938e83b773) - use correct assignment and adjust test tolerances
- [`cf3f92e`](https://github.com/stdlib-js/stdlib/commit/cf3f92eddd20ec1a4106c8a34f7d7705a9a99dbc) - update include paths

</section>
Expand Down Expand Up @@ -4598,6 +4599,7 @@ A total of 28 people contributed to this release. Thank you to the following con

<details>

- [`53cf211`](https://github.com/stdlib-js/stdlib/commit/53cf211f341dc87077710b30ac41a0938e83b773) - **fix:** use correct assignment and adjust test tolerances _(by Athan Reines)_
- [`11c882d`](https://github.com/stdlib-js/stdlib/commit/11c882dcc261abe6a898a3061b45af7f0d4a41cd) - **chore:** update package meta data [(##2379)](#2379) _(by stdlib-bot, Athan Reines)_
- [`7b85db8`](https://github.com/stdlib-js/stdlib/commit/7b85db803f6a6bce2999bfe8b2513edb08e15a67) - **feat:** add C implementation for `math/base/special/covercos` [(##2377)](#2377) _(by Gunj Joshi)_
- [`e7938d9`](https://github.com/stdlib-js/stdlib/commit/e7938d964046b7a61dbc89d23f39daebf4545a47) - **feat:** add C implementation for `math/base/special/cscd` [(##2378)](#2378) _(by Gunj Joshi)_
Expand Down Expand Up @@ -4637,6 +4639,7 @@ A total of 28 people contributed to this release. Thank you to the following con
- [`1bc3682`](https://github.com/stdlib-js/stdlib/commit/1bc36829f1d4a1508acd17f0ffcdc31167a30f20) - **feat:** add C implementation for `math/base/special/negafibonacci` _(by Gunj Joshi, Pranav Goswami, Philipp Burckhardt)_
- [`1ba660a`](https://github.com/stdlib-js/stdlib/commit/1ba660abde970312ef52b49b3bf0cf3af4200f3d) - **feat:** add C implementation for `math/base/special/fibonacci-index` _(by Gunj Joshi, Philipp Burckhardt)_
- [`3a3b1e0`](https://github.com/stdlib-js/stdlib/commit/3a3b1e08f73a54c5ee46d73045805aee0bb1196d) - **docs:** update package URLs [(##2269)](#2269) _(by stdlib-bot)_
- [`44aa02f`](https://github.com/stdlib-js/stdlib/commit/44aa02fd4339364a4717ccfac6fc7c1b1ce616bc) - **refactor:** ensure variables are static _(by Athan Reines)_
- [`8089b88`](https://github.com/stdlib-js/stdlib/commit/8089b886a4d7d89f15abb068b1021d93f9c4f64e) - **docs:** update paths _(by Athan Reines)_
- [`038b199`](https://github.com/stdlib-js/stdlib/commit/038b199c32842c02cf678e3ae8305a17aacda05e) - **docs:** update paths _(by Athan Reines)_
- [`e7ebe20`](https://github.com/stdlib-js/stdlib/commit/e7ebe201dea1be826f89b997538638b07f26a960) - **fix:** update implementation to use correct constants _(by Athan Reines)_
Expand Down
2 changes: 1 addition & 1 deletion base/ops/cdiv/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function cdiv( z1, z2 ) {
out = robustInternal( re1, im1, re2, im2 );
} else {
out = robustInternal( im1, re1, im2, re2 );
out[ 1 ] *= -1;
out[ 1 ] *= -1.0;
}
out[ 0 ] *= s;
out[ 1 ] *= s;
Expand Down
28 changes: 18 additions & 10 deletions base/ops/cdiv/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include "stdlib/constants/float64/smallest_normal.h"
#include <stdint.h>

const double LARGE_THRESHOLD = STDLIB_CONSTANT_FLOAT64_MAX * 0.5;
const double SMALL_THRESHOLD = STDLIB_CONSTANT_FLOAT64_SMALLEST_NORMAL * ( 2.0 / STDLIB_CONSTANT_FLOAT64_EPS );
const double RECIP_EPS_SQR = 2.0 / ( STDLIB_CONSTANT_FLOAT64_EPS * STDLIB_CONSTANT_FLOAT64_EPS );
static const double LARGE_THRESHOLD = STDLIB_CONSTANT_FLOAT64_MAX * 0.5;
static const double SMALL_THRESHOLD = STDLIB_CONSTANT_FLOAT64_SMALLEST_NORMAL * ( 2.0 / STDLIB_CONSTANT_FLOAT64_EPS );
static const double RECIP_EPS_SQR = 2.0 / ( STDLIB_CONSTANT_FLOAT64_EPS * STDLIB_CONSTANT_FLOAT64_EPS );

/**
* Computes the real part of the quotient.
Expand Down Expand Up @@ -113,6 +113,8 @@ stdlib_complex128_t stdlib_base_cdiv( const stdlib_complex128_t z1, const stdlib
double re2;
double im1;
double im2;
double t1;
double t2;
double ab;
double cd;
double re;
Expand All @@ -122,15 +124,19 @@ stdlib_complex128_t stdlib_base_cdiv( const stdlib_complex128_t z1, const stdlib
stdlib_reim( z1, &re1, &im1 );
stdlib_reim( z2, &re2, &im2 );

if ( stdlib_base_abs( re1 ) > stdlib_base_abs( im1 ) ){
ab = re1;
t1 = stdlib_base_abs( re1 );
t2 = stdlib_base_abs( im1 );
if ( t1 > t2 ){
ab = t1;
} else {
ab = im1;
ab = t2;
}
if ( stdlib_base_abs( re2 ) > stdlib_base_abs( im2 ) ){
cd = re2;
t1 = stdlib_base_abs( re2 );
t2 = stdlib_base_abs( im2 );
if ( t1 > t2 ){
cd = t1;
} else {
cd = im2;
cd = t2;
}

s = 1.0;
Expand All @@ -153,11 +159,13 @@ stdlib_complex128_t stdlib_base_cdiv( const stdlib_complex128_t z1, const stdlib
im2 *= RECIP_EPS_SQR;
s *= RECIP_EPS_SQR;
}
re = 0.0;
im = 0.0;
if ( stdlib_base_abs( im2 ) <= stdlib_base_abs( re2 ) ) {
robustInternal( re1, im1, re2, im2, &re, &im );
} else {
robustInternal( im1, re1, im2, re2, &re, &im );
im *= -1;
im *= -1.0;
}
re *= s;
im *= s;
Expand Down
52 changes: 26 additions & 26 deletions base/ops/cdiv/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,14 @@ tape( 'the function computes a complex quotient (tested against fixtures)', func
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -366,14 +366,14 @@ tape( 'the function computes a complex quotient (different component scales)', f
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -410,14 +410,14 @@ tape( 'the function computes a complex quotient (different component scales)', f
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -454,14 +454,14 @@ tape( 'the function computes a complex quotient (different imaginary component s
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -498,14 +498,14 @@ tape( 'the function computes a complex quotient (real imaginary component scales
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -542,14 +542,14 @@ tape( 'the function computes a complex quotient (large negative imaginary compon
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -586,14 +586,14 @@ tape( 'the function computes a complex quotient (large negative real components)
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -630,14 +630,14 @@ tape( 'the function computes a complex quotient (large positive imaginary compon
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -674,14 +674,14 @@ tape( 'the function computes a complex quotient (large positive real components)
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -718,14 +718,14 @@ tape( 'the function computes a complex quotient (tiny negative imaginary compone
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -762,14 +762,14 @@ tape( 'the function computes a complex quotient (tiny negative real components)'
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -806,14 +806,14 @@ tape( 'the function computes a complex quotient (tiny positive imaginary compone
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down Expand Up @@ -850,14 +850,14 @@ tape( 'the function computes a complex quotient (tiny positive real components)'
} else {
delta = abs( real( q ) - qre[ i ] );
tol = EPS * abs( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. real: '+q[0]+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = abs( imag( q ) - qim[ i ] );
tol = EPS * abs( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+'+ '+im1[i]+'i. y: '+re2[i]+'+ '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
t.ok( delta <= tol, 'within tolerance. x: '+re1[i]+' + '+im1[i]+'i. y: '+re2[i]+' + '+im2[i]+'i. imag: '+q[1]+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
t.end();
Expand Down
Loading

0 comments on commit 64f0781

Please sign in to comment.