Skip to content

Commit

Permalink
test: update tolerance values
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjjoshi committed Aug 3, 2024
1 parent b550ea6 commit e50ac8a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static double benchmark( void ) {

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
x = ( (int32_t)floor( 127.0 * rand_double() ) + 1.0 );
x = ( floor( 127.0 * rand_double() ) + 1.0 );
y = stdlib_base_factorialln( x );
if ( y != y ) {
printf( "should return a nonnegative integer\n" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ tape( 'the function evaluates the natural logarithm of the factorial of `x` (med
t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = EPS * abs( expected[i] );
tol = 1.5 * EPS * abs( expected[i] );
t.equal( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. Tolerance: '+tol+'.' );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ tape( 'the function evaluates the natural logarithm of the factorial of `x` (med
t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[i] );
tol = EPS * abs( expected[i] );
tol = 1.5 * EPS * abs( expected[i] );
t.equal( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. Tolerance: '+tol+'.' );
}
}
Expand Down

0 comments on commit e50ac8a

Please sign in to comment.