Skip to content

Commit

Permalink
feat: matching tolerance for js and c files
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush0325 committed Nov 14, 2024
1 parent 2a0601d commit eac619c
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 45 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions lib/node_modules/@stdlib/math/base/special/cinvf/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ tape( 'the function computes a complex inverse', function test( t ) {
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -121,14 +121,14 @@ tape( 'the function computes a complex inverse (large negative imaginary compone
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -157,14 +157,14 @@ tape( 'the function computes a complex inverse (large negative real components)'
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -193,14 +193,14 @@ tape( 'the function computes a complex inverse (large positive imaginary compone
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -229,14 +229,14 @@ tape( 'the function computes a complex inverse (large positive real components)'
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -265,14 +265,14 @@ tape( 'the function computes a complex inverse (tiny negative imaginary componen
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -301,14 +301,14 @@ tape( 'the function computes a complex inverse (tiny negative real components)',
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -337,14 +337,14 @@ tape( 'the function computes a complex inverse (tiny positive imaginary componen
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -373,14 +373,14 @@ tape( 'the function computes a complex inverse (tiny positive real components)',
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ tape( 'the function computes a complex inverse', opts, function test( t ) {
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -130,14 +130,14 @@ tape( 'the function computes a complex inverse (large negative imaginary compone
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -166,14 +166,14 @@ tape( 'the function computes a complex inverse (large negative real components)'
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -202,14 +202,14 @@ tape( 'the function computes a complex inverse (large positive imaginary compone
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -238,14 +238,14 @@ tape( 'the function computes a complex inverse (large positive real components)'
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -274,14 +274,14 @@ tape( 'the function computes a complex inverse (tiny negative imaginary componen
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -310,14 +310,14 @@ tape( 'the function computes a complex inverse (tiny negative real components)',
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -346,14 +346,14 @@ tape( 'the function computes a complex inverse (tiny positive imaginary componen
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down Expand Up @@ -382,14 +382,14 @@ tape( 'the function computes a complex inverse (tiny positive real components)',
t.strictEqual( real( q ), qre[ i ], 'returns expected real component' );
} else {
delta = absf( real( q ) - qre[ i ] );
tol = EPS * absf( qre[ i ] );
tol = 3 * EPS * absf( qre[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. real: '+real( q )+'. expected: '+qre[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
if ( imag( q ) === qim[ i ] ) {
t.strictEqual( imag( q ), qim[ i ], 'returns expected imaginary component' );
} else {
delta = absf( imag( q ) - qim[ i ] );
tol = EPS * absf( qim[ i ] );
tol = 3 * EPS * absf( qim[ i ] );
t.ok( delta <= tol, 'within tolerance. x: '+re[i]+'+ '+im[i]+'i. imag: '+imag( q )+'. expected: '+qim[i]+'. delta: '+delta+'. tol: '+tol+'.' );
}
}
Expand Down

0 comments on commit eac619c

Please sign in to comment.