Skip to content

Commit 4fdd022

Browse files
fix: bench errors
1 parent aa4664e commit 4fdd022

File tree

1 file changed

+6
-5
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/benchmark/c

1 file changed

+6
-5
lines changed

lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/benchmark/c/benchmark.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,21 @@ static double benchmark( void ) {
9393
double elapsed;
9494
double p;
9595
double y;
96-
double x;
96+
double t;
97+
double x;
9798
int i;
9899

99-
t = tic();
100+
x = tic();
100101
for ( i = 0; i < ITERATIONS; i++ ) {
101-
x = ( (double)rand() / (double)RAND_MAX ) ;
102+
p = ( (double)rand() / (double)RAND_MAX );
102103
t = ( (double)rand() / (double)RAND_MAX )*3.0;
103-
y = stdlib_base_dists_bernoulli_mgf( x, p );
104+
y = stdlib_base_dists_bernoulli_mgf( t, p );
104105
if ( y != y ) {
105106
printf( "should not return NaN\n" );
106107
break;
107108
}
108109
}
109-
elapsed = tic() - t;
110+
elapsed = tic() - x;
110111
if ( y != y ) {
111112
printf( "should not return NaN\n" );
112113
}

0 commit comments

Comments
 (0)