Skip to content

Commit f58b282

Browse files
committed
feat:C implementation of stats/base/dists/weibull/skewness
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent b69ece4 commit f58b282

File tree

1 file changed

+3
-7
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/weibull/skewness/benchmark/c

1 file changed

+3
-7
lines changed

lib/node_modules/@stdlib/stats/base/dists/weibull/skewness/benchmark/c/benchmark.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,21 @@ static double benchmark( void ) {
9999
double t;
100100
int i;
101101

102-
// Generate random values for k (shape) and lambda (scale)
103102
for ( i = 0; i < 100; i++ ) {
104-
k[ i ] = random_uniform( 0.1, 10.0 ); // k > 0 to avoid NaN result
105-
lambda[ i ] = random_uniform( 0.1, 10.0 ); // lambda > 0 to avoid NaN result
103+
k[ i ] = random_uniform( 0.1, 10.0 );
104+
lambda[ i ] = random_uniform( 0.1, 10.0 );
106105
}
107106

108107
t = tic();
109-
// Benchmark loop
110108
for ( i = 0; i < ITERATIONS; i++ ) {
111-
// Calculate skewness for the Weibull distribution
112109
y = stdlib_base_dists_weibull_skewness( k[ i % 100 ], lambda[ i % 100 ] );
113-
if ( y != y ) { // Check for NaN
110+
if ( y != y ) {
114111
printf( "should not return NaN\n" );
115112
break;
116113
}
117114
}
118115
elapsed = tic() - t;
119116

120-
// Final NaN check
121117
if ( y != y ) {
122118
printf( "should not return NaN\n" );
123119
}

0 commit comments

Comments
 (0)