Skip to content

Commit bbe3a0a

Browse files
committed
docs: add comment explaining tolerance for chi logpdf tests
Explains why 40.0 EPS tolerance is needed due to accumulated floating-point precision differences in complex calculations involving ln and gammaln functions.
1 parent 4c7f3a8 commit bbe3a0a

File tree

1 file changed

+1
-1
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/test

1 file changed

+1
-1
lines changed

lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/test/test.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ tape( 'the function evaluates the logpdf for given `x` and `k`', opts, function
113113
t.equal( y, expected[ i ], 'x: ' + x[ i ] + ', k: ' + k[ i ] + ', y: ' + y + ', expected: ' + expected[ i ] );
114114
} else {
115115
delta = abs( y - expected[ i ] );
116-
tol = 40.0 * EPS * abs( expected[ i ] );
116+
tol = 40.0 * EPS * abs( expected[ i ] ); // Higher tolerance needed due to accumulated floating-point precision differences between JS and C implementations
117117
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. k: ' + k[ i ] + '. y: ' + y + '. E: ' + expected[ i ] + '. Δ: ' + delta + '. tol: ' + tol + '.' );
118118
}
119119
}

0 commit comments

Comments
 (0)