Skip to content

Commit b1e2421

Browse files
fixup! fixup! bench: refactor random number generation in JS benchmarks for stats/base/dists/levy
--- 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: na - task: lint_javascript_benchmarks status: passed - 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent dd8c6c9 commit b1e2421

File tree

1 file changed

+4
-4
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/levy/logcdf/benchmark

1 file changed

+4
-4
lines changed

lib/node_modules/@stdlib/stats/base/dists/levy/logcdf/benchmark/benchmark.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ bench( pkg, function benchmark( b ) {
4444
scale = new Float64Array( len );
4545
x = new Float64Array( len );
4646
for ( i = 0; i < len; i++ ) {
47-
x[ i ] = uniform( EPS, 100.0 );
4847
mu[ i ] = uniform( -50.0, 100.0 );
48+
x[ i ] = uniform( mu[i], 100.0 );
4949
scale[ i ] = uniform( EPS, 20.0 );
5050
}
5151

5252
b.tic();
5353
for ( i = 0; i < b.iterations; i++ ) {
54-
y = logcdf( x, mu, scale );
54+
y = logcdf( x[ i % len ], mu[i%len], scale[i%len] );
5555
if ( isnan( y ) ) {
5656
b.fail( 'should not return NaN' );
5757
}
@@ -74,10 +74,10 @@ bench( pkg+':factory', function benchmark( b ) {
7474
var i;
7575

7676
mu = 0.0;
77-
scale = 1.5;
7877
len = 100;
79-
x = new Float64Array( len );
78+
scale = 1.5;
8079
mylogcdf = logcdf.factory( mu, scale );
80+
x = new Float64Array( len );
8181
for ( i = 0; i < len; i++ ) {
8282
x[ i ] = uniform( 0.0, 4.0 );
8383
}

0 commit comments

Comments
 (0)