File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
lib/node_modules/@stdlib/stats/base/dists/bernoulli/mgf/benchmark/c Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments