Skip to content

Commit d5140fd

Browse files
fix: refactor random function
--- 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: passed - 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: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - 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 8bd6695 commit d5140fd

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ int main( void ) {
224224
225225
for ( i = 0; i < 25; i++ ) {
226226
x = random_uniform( 0.0, 10.0 );
227-
mu = random_uniform( 0.0, 10.0 ) - 5.0;
227+
mu = random_uniform( -5.0, 5.0 );
228228
sigma = random_uniform( 0.0, 20.0 );
229229
y = stdlib_base_dists_lognormal_pdf( x, mu, sigma );
230230
printf( "x: %lf, mu: %lf, sigma: %lf, f(x;mu,sigma): %lf\n", x, mu, sigma, y );

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
2626
var tryRequire = require( '@stdlib/utils/try-require' );
27-
var randu = require( '@stdlib/random/base/randu' );
2827
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2928
var EPS = require( '@stdlib/constants/float64/eps' );
29+
var uniform = require( '@stdlib/random/base/uniform' );
3030
var pkg = require( './../package.json' ).name;
3131

3232

@@ -53,9 +53,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5353
mu = new Float64Array( len );
5454
sigma = new Float64Array( len );
5555
for ( i = 0; i < len; i++ ) {
56-
x[ i ] = ( randu() * 100.0 ) - 100.0;
57-
mu[ i ] = ( randu() * 100.0 ) - 50.0;
58-
sigma[ i ] = ( randu() * 20.0 ) + EPS;
56+
x[ i ] = uniform( -100.0, 100.0 );
57+
mu[ i ] = uniform( -50.0, 50.0 );
58+
sigma[ i ] = uniform( EPS, 20.0 );
5959
}
6060

6161
b.tic();

lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/benchmark/c/benchmark.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ static double benchmark( void ) {
102102
int i;
103103

104104
for ( i = 0; i < 100; i++ ) {
105-
x[ i ] = random_uniform( 0.0, 100.0 ) - 100.0;
106-
mu[ i ] = random_uniform( 0.0, 100.0 ) - 50.0;
107-
sigma[ i ] = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
105+
x[ i ] = random_uniform( -100.0, 0.0 );
106+
mu[ i ] = random_uniform( -50.0, 50.0 );
107+
sigma[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
108108
}
109109

110110
t = tic();

lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main( void ) {
3434

3535
for ( i = 0; i < 25; i++ ) {
3636
x = random_uniform( 0.0, 10.0 );
37-
mu = random_uniform( 0.0, 10.0 ) - 5.0;
37+
mu = random_uniform( 5.0, -5.0 );
3838
sigma = random_uniform( 0.0, 20.0 );
3939
y = stdlib_base_dists_lognormal_pdf( x, mu, sigma );
4040
printf( "x: %lf, mu: %lf, sigma: %lf, f(x;mu,sigma): %lf\n", x, mu, sigma, y );

0 commit comments

Comments
 (0)