Skip to content

Commit 131c3c7

Browse files
committed
refactor: added include in main.c and fixed the JS benchmark number generation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- 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: passed - 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 ac9b786 commit 131c3c7

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/benchmark/benchmark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var bench = require( '@stdlib/bench' );
2424
var randu = require( '@stdlib/random/base/randu' );
25+
var uniform = require( '@stdlib/random/base/uniform' );
2526
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2627
var pkg = require( './../package.json' ).name;
2728
var stdev = require( './../lib' );
@@ -38,7 +39,7 @@ bench( pkg, function benchmark( b ) {
3839
b.tic();
3940
for ( i = 0; i < b.iterations; i++ ) {
4041
min = ( randu()*10.0 );
41-
max = ( randu()*10.0 ) + min;
42+
max = uniform( min, min + 10.0 );
4243
y = stdev( min, max );
4344
if ( isnan( y ) ) {
4445
b.fail( 'should not return NaN' );

lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/benchmark/benchmark.native.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
2626
var randu = require( '@stdlib/random/base/randu' );
27+
var uniform = require( '@stdlib/random/base/uniform' );
2728
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2829
var tryRequire = require( '@stdlib/utils/try-require' );
2930
var pkg = require( './../package.json' ).name;
@@ -50,8 +51,8 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5051
min = new Float64Array( len );
5152
max = new Float64Array( len );
5253
for ( i = 0; i < len; i++ ) {
53-
min[ i ] = ( randu() * 20.0 ) - 20.0;
54-
max[ i ] = min[ i ] + ( randu() * 40.0 );
54+
min[ i ] = ( randu()*10.0 );
55+
max[ i ] = uniform( min[ i ], min[ i ] + 10.0 );
5556
}
5657

5758
b.tic();

lib/node_modules/@stdlib/stats/base/dists/arcsine/stdev/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "stdlib/math/base/assert/is_nan.h"
20+
#include "stdlib/stats/base/dists/arcsine/stdev.h"
2021

2122
// CONSTANTS
2223
#define SQRT1OVER8 0.35355339059327373 // sqrt(1.0 / 8.0)

0 commit comments

Comments
 (0)