Skip to content

Commit 068bc90

Browse files
authored
docs: add comment, revert to previous tolerance in math/base/special/factorialln
PR-URL: #2778 Reviewed-by: Philipp Burckhardt <[email protected]>
1 parent 2939f56 commit 068bc90

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: lib/node_modules/@stdlib/math/base/special/factorialln/test/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ tape( 'the function evaluates the natural logarithm of the factorial of `x` (med
143143
t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
144144
} else {
145145
delta = abs( y - expected[i] );
146-
tol = 1.5 * EPS * abs( expected[i] );
146+
tol = EPS * abs( expected[i] );
147147
t.equal( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. Tolerance: '+tol+'.' );
148148
}
149149
}

Diff for: lib/node_modules/@stdlib/math/base/special/factorialln/test/test.native.js

+2
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ tape( 'the function evaluates the natural logarithm of the factorial of `x` (med
152152
t.equal( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
153153
} else {
154154
delta = abs( y - expected[i] );
155+
156+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2774#discussion_r1712904184
155157
tol = 1.5 * EPS * abs( expected[i] );
156158
t.equal( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. Tolerance: '+tol+'.' );
157159
}

0 commit comments

Comments
 (0)