Skip to content

Commit 44141ab

Browse files
committed
bench: refactor random number stats/base/dists/signrank
--- 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: na - 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 84b7614 commit 44141ab

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

lib/node_modules/@stdlib/stats/base/dists/signrank/cdf/benchmark/benchmark.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
25-
var ceil = require( '@stdlib/math/base/special/ceil' );
24+
var uniform = require( '@stdlib/random/base/uniform' );
25+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var pkg = require( './../package.json' ).name;
2828
var cdf = require( './../lib' );
@@ -38,8 +38,8 @@ bench( pkg, function benchmark( b ) {
3838

3939
b.tic();
4040
for ( i = 0; i < b.iterations; i++ ) {
41-
x = randu() * 20.0;
42-
n = ceil( randu()*20.0 );
41+
x = uniform( 0.0, 20.0 );
42+
n = discreteUniform( 1, 20 );
4343
y = cdf( x, n );
4444
if ( isnan( y ) ) {
4545
b.fail( 'should not return NaN' );
@@ -65,7 +65,7 @@ bench( pkg+':factory', function benchmark( b ) {
6565

6666
b.tic();
6767
for ( i = 0; i < b.iterations; i++ ) {
68-
x = randu() * 20.0;
68+
x = uniform( 0.0, 20.0 );
6969
y = mycdf( x );
7070
if ( isnan( y ) ) {
7171
b.fail( 'should not return NaN' );

lib/node_modules/@stdlib/stats/base/dists/signrank/pdf/benchmark/benchmark.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
25-
var ceil = require( '@stdlib/math/base/special/ceil' );
24+
var uniform = require( '@stdlib/random/base/uniform' );
25+
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var pkg = require( './../package.json' ).name;
2828
var pdf = require( './../lib' );
@@ -38,8 +38,8 @@ bench( pkg, function benchmark( b ) {
3838

3939
b.tic();
4040
for ( i = 0; i < b.iterations; i++ ) {
41-
x = randu() * 20.0;
42-
n = ceil( randu()*20.0 );
41+
x = uniform(0.0, 10.0);
42+
n = discreteUniform( 1, 20 );
4343
y = pdf( x, n );
4444
if ( isnan( y ) ) {
4545
b.fail( 'should not return NaN' );
@@ -65,7 +65,7 @@ bench( pkg+':factory', function benchmark( b ) {
6565

6666
b.tic();
6767
for ( i = 0; i < b.iterations; i++ ) {
68-
x = randu() * 20.0;
68+
x = uniform(0.0, 20.0);
6969
y = mypdf( x );
7070
if ( isnan( y ) ) {
7171
b.fail( 'should not return NaN' );

lib/node_modules/@stdlib/stats/base/dists/signrank/quantile/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var uniform = require( '@stdlib/random/base/uniform' );
2525
var randint = require( '@stdlib/random/base/discrete-uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var pkg = require( './../package.json' ).name;
@@ -38,7 +38,7 @@ bench( pkg, function benchmark( b ) {
3838

3939
b.tic();
4040
for ( i = 0; i < b.iterations; i++ ) {
41-
p = randu();
41+
p = uniform( 0.0, 1.0 );
4242
n = randint( 1, 200 );
4343
y = quantile( p, n );
4444
if ( isnan( y ) ) {
@@ -65,7 +65,7 @@ bench( pkg+':factory', function benchmark( b ) {
6565

6666
b.tic();
6767
for ( i = 0; i < b.iterations; i++ ) {
68-
p = randu();
68+
p = uniform( 0.0, 1.0 );
6969
y = myquantile( p );
7070
if ( isnan( y ) ) {
7171
b.fail( 'should not return NaN' );

0 commit comments

Comments
 (0)