Skip to content

Commit 25a369b

Browse files
hrshyaPlaneshifter
andauthored
bench: refactor number generation
PR-URL: #5212 Closes: #5145 Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com> Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent ba1dd19 commit 25a369b

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

lib/node_modules/@stdlib/stats/base/dists/exponential/cdf/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ for ( i = 0; i < 10; i++ ) {
130130

131131
<!-- /.examples -->
132132

133-
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
134-
135-
<section class="references">
136-
137133
<!-- C interface documentation. -->
138134

139135
* * *
@@ -162,7 +158,7 @@ for ( i = 0; i < 10; i++ ) {
162158

163159
#### stdlib_base_dists_exponential_cdf( x, lambda )
164160

165-
Evaluates the [probability density function][cdf] (cdf) for an [exponential][exponential-distribution] distribution with rate parameter `lambda`.
161+
Evaluates the [cumulative distribution function][cdf] (cdf) for an [exponential][exponential-distribution] distribution with rate parameter `lambda`.
166162

167163
```c
168164
double out = stdlib_base_dists_exponential_cdf( 2.0, 0.7 );
@@ -226,6 +222,12 @@ int main( void ) {
226222

227223
<!-- /.references -->
228224

225+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
226+
227+
<section class="references">
228+
229+
</section>
230+
229231
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
230232

231233
<section class="related">

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26-
var randu = require( '@stdlib/random/base/randu' );
26+
var uniform = require( '@stdlib/random/base/uniform' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var EPS = require( '@stdlib/constants/float64/eps' );
2929
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -51,8 +51,8 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5151
x = new Float64Array( len );
5252
lambda = new Float64Array( len );
5353
for ( i = 0; i < len; i++ ) {
54-
x[ i ] = ( randu()*100.0 );
55-
lambda[ i ] = ( randu()*100.0 ) + EPS;
54+
x[ i ] = uniform( 0.0, 100.0 );
55+
lambda[ i ] = uniform( EPS, 100.0 );
5656
}
5757

5858
b.tic();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static double benchmark( void ) {
107107

108108
t = tic();
109109
for ( i = 0; i < ITERATIONS; i++ ) {
110-
y = stdlib_base_dists_exponential_cdf( x[ i % 100 ], lambda[ i % 100 ]);
110+
y = stdlib_base_dists_exponential_cdf( x[ i % 100 ], lambda[ i % 100 ] );
111111
if ( y != y ) {
112112
printf( "should not return NaN\n" );
113113
break;

0 commit comments

Comments
 (0)