Skip to content

Commit 9f9be4c

Browse files
committed
test: adjust tolerance to account for compiler optimization
--- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 75860d1 commit 9f9be4c

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

lib/node_modules/@stdlib/math/base/special/hyp2f1/test/test.native.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ tape( 'the function correctly evaluates the hypergeometric function', opts, func
167167
t.strictEqual( v, PINF, 'returns expected value' );
168168
continue;
169169
}
170-
t.strictEqual( isAlmostSameValue( v, expected[ i ], 1 ), true, 'returns expected value' );
170+
// 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/2298#discussion_r1624765205
171+
t.strictEqual( isAlmostSameValue( v, expected[ i ], 2 ), true, 'returns expected value' );
171172
}
172173
t.end();
173174
});
@@ -193,7 +194,8 @@ tape( 'the function correctly evaluates the hypergeometric function', opts, func
193194
t.strictEqual( v, PINF, 'returns expected value' );
194195
continue;
195196
}
196-
t.strictEqual( isAlmostSameValue( v, expected[ i ], 7 ), true, 'returns expected value' );
197+
// 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/2298#discussion_r1624765205
198+
t.strictEqual( isAlmostSameValue( v, expected[ i ], 27 ), true, 'returns expected value' );
197199
}
198200
t.end();
199201
});
@@ -219,7 +221,8 @@ tape( 'the function correctly evaluates the hypergeometric function', opts, func
219221
t.strictEqual( v, PINF, 'returns expected value' );
220222
continue;
221223
}
222-
t.strictEqual( isAlmostSameValue( v, expected[ i ], 18 ), true, 'returns expected value' );
224+
// 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/2298#discussion_r1624765205
225+
t.strictEqual( isAlmostSameValue( v, expected[ i ], 45 ), true, 'returns expected value' );
223226
}
224227
t.end();
225228
});
@@ -245,7 +248,8 @@ tape( 'the function correctly evaluates the hypergeometric function', opts, func
245248
t.strictEqual( v, PINF, 'returns expected value' );
246249
continue;
247250
}
248-
t.strictEqual( isAlmostSameValue( v, expected[ i ], 33 ), true, 'returns expected value' );
251+
// 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/2298#discussion_r1624765205
252+
t.strictEqual( isAlmostSameValue( v, expected[ i ], 100 ), true, 'returns expected value' );
249253
}
250254
t.end();
251255
});
@@ -267,7 +271,9 @@ tape( 'the function correctly evaluates the hypergeometric function', opts, func
267271

268272
for ( i = 0; i < x.length; i++ ) {
269273
v = hyp2f1( a[ i ], b[ i ], c[ i ], x[ i ] );
270-
t.strictEqual( isAlmostSameValue( v, expected[ i ], 294333 ), true, 'returns expected value' );
274+
275+
// 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/2298#discussion_r1624765205
276+
t.strictEqual( isAlmostSameValue( v, expected[ i ], 391554 ), true, 'returns expected value' );
271277
}
272278
t.end();
273279
});

0 commit comments

Comments
 (0)