Skip to content

Commit

Permalink
bench: replace usage of LEN
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter authored Mar 2, 2025
1 parent cbc8409 commit e75dd4d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ static double benchmark( void ) {

double x[ 100 ];

for ( i = 0; i < LEN; i++ ) {
for ( i = 0; i < 100; i++ ) {
x[ i ] = random_uniform( -100.0, 100.0 );
mu[ i ] = random_uniform( -50.0, 50.0 );
sigma[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
}

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
y = stdlib_base_dists_normal_pdf( x[ i%LEN ], mu[ i%LEN ], sigma[ i%LEN ] );
y = stdlib_base_dists_normal_pdf( x[ i%100 ], mu[ i%100 ], sigma[ i%100 ] );
if ( y != y ) {
printf( "should not return NaN\n" );
break;
Expand Down

0 comments on commit e75dd4d

Please sign in to comment.