Skip to content

Commit 5da32d5

Browse files
committed
fix: using uniform in place of randu
--- 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: passed - 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: passed - 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 58be279 commit 5da32d5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

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

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

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
2524
var Float64Array = require( '@stdlib/array/float64' );
2625
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2726
var EPS = require( '@stdlib/constants/float64/eps' );
27+
var uniform = require( '@stdlib/random/base/uniform' );
2828
var pkg = require( './../package.json' ).name;
2929
var cdf = require( './../lib' );
3030

@@ -44,9 +44,9 @@ bench( pkg, function benchmark( b ) {
4444
x0 = new Float64Array( len );
4545
gamma = new Float64Array( len );
4646
for ( i = 0; i < len; i++ ) {
47-
x[ i ] = ( randu()*200.0 ) - 100.0;
48-
x0[ i ] = ( randu()*100.0 ) - 50.0;
49-
gamma[ i ] = ( randu()*20.0 ) + EPS;
47+
x[ i ] = uniform( -100.0, 100.0 );
48+
x0[ i ] = uniform( -50.0, 50.0 );
49+
gamma[ i ] = uniform( EPS, 20.0 );
5050
}
5151

5252
b.tic();
@@ -78,7 +78,7 @@ bench( pkg+':factory', function benchmark( b ) {
7878

7979
b.tic();
8080
for ( i = 0; i < b.iterations; i++ ) {
81-
x = ( randu()*100.0 ) + EPS;
81+
x = uniform( EPS, 100.0 );
8282
y = mycdf( x );
8383
if ( isnan( y ) ) {
8484
b.fail( 'should not return NaN' );

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
2626
var EPS = require( '@stdlib/constants/float64/eps' );
27-
var randu = require( '@stdlib/random/base/randu' );
27+
var uniform = require( '@stdlib/random/base/uniform' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2929
var tryRequire = require( '@stdlib/utils/try-require' );
3030
var pkg = require( './../package.json' ).name;
@@ -53,9 +53,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5353
x0 = new Float64Array( len );
5454
gamma = new Float64Array( len );
5555
for ( i = 0; i < len; i++ ) {
56-
x[ i ] = ( randu()*200.0 ) - 100.0;
57-
x0[ i ] = ( randu()*100.0 ) - 50.0;
58-
gamma[ i ] = ( randu()*20.0 ) + EPS;
56+
x[ i ] = uniform( -100.0, 100.0 );
57+
x0[ i ] = uniform( -50.0, 50.0 );
58+
gamma[ i ] = uniform( EPS, 20.0 );
5959
}
6060

6161
b.tic();

lib/node_modules/@stdlib/stats/base/dists/cauchy/cdf/benchmark/c/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static double benchmark( void ) {
104104
for ( i = 0; i < 100; i++ ) {
105105
x[ i ] = random_uniform( -100.0 , 100.0 );
106106
x0[ i ] = random_uniform( -50.0, 50.0 );
107-
gamma[ i ] = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
107+
gamma[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
108108
}
109109

110110
t = tic();

0 commit comments

Comments
 (0)