Skip to content

Commit 078ba22

Browse files
committed
test: adjust tolerance levels in test.native.js for triangular MGF consistency
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent f4234cc commit 078ba22

File tree

1 file changed

+3
-9
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/test

1 file changed

+3
-9
lines changed

lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/test/test.native.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ tape( 'the function evaluates the MGF for `x` given a small range `b - a`', opts
103103
t.equal( y, expected[i], 'x: '+x[i]+', a: '+a[i]+', b: '+b[i]+', c: '+c[i]+', y: '+y+', expected: '+expected[i] );
104104
} else {
105105
delta = abs( y - expected[ i ] );
106-
107-
// FIXME: the tolerance for the C implementation is widely different from the JavaScript implementation, and it is not clear why.
108-
tol = 1.0e7 * EPS * abs( expected[ i ] );
106+
tol = 4.0 * EPS * abs( expected[ i ] );
109107
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. a: '+a[i]+'. b: '+b[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
110108
}
111109
}
@@ -134,9 +132,7 @@ tape( 'the function evaluates the MGF for `x` given a medium range `b - a`', opt
134132
t.equal( y, expected[i], 'x: '+x[i]+', a: '+a[i]+', b: '+b[i]+', c: '+c[i]+', y: '+y+', expected: '+expected[i] );
135133
} else {
136134
delta = abs( y - expected[ i ] );
137-
138-
// FIXME: the tolerance for the C implementation is widely different from the JavaScript implementation, and it is not clear why.
139-
tol = 1.0e7 * EPS * abs( expected[ i ] );
135+
tol = 4.0 * EPS * abs( expected[ i ] );
140136
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. a: '+a[i]+'. b: '+b[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
141137
}
142138
}
@@ -165,9 +161,7 @@ tape( 'the function evaluates the MGF for `x` given a large range `b - a`', opts
165161
t.equal( y, expected[i], 'x: '+x[i]+', a: '+a[i]+', b: '+b[i]+', c: '+c[i]+', y: '+y+', expected: '+expected[i] );
166162
} else {
167163
delta = abs( y - expected[ i ] );
168-
169-
// FIXME: the tolerance for the C implementation is widely different from the JavaScript implementation, and it is not clear why.
170-
tol = 1.0e7 * EPS * abs( expected[ i ] );
164+
tol = 4.0 * EPS * abs( expected[ i ] );
171165
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. a: '+a[i]+'. b: '+b[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
172166
}
173167
}

0 commit comments

Comments
 (0)