File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
lib/node_modules/@stdlib/random/base/logistic/benchmark Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ bench( pkg, function benchmark( b ) {
53
53
b . end ( ) ;
54
54
} ) ;
55
55
56
- bench ( pkg + ':factory' , function benchmark ( b ) {
56
+ bench ( pkg + ':: factory' , function benchmark ( b ) {
57
57
var rand ;
58
58
var mu ;
59
59
var s ;
@@ -78,3 +78,29 @@ bench( pkg+':factory', function benchmark( b ) {
78
78
b . pass ( 'benchmark finished' ) ;
79
79
b . end ( ) ;
80
80
} ) ;
81
+
82
+ bench ( pkg + '::factory,arguments' , function benchmark ( b ) {
83
+ var rand ;
84
+ var mu ;
85
+ var s ;
86
+ var z ;
87
+ var i ;
88
+
89
+ mu = 0.0 ;
90
+ s = 1.5 ;
91
+ rand = logistic . factory ( ) ;
92
+
93
+ b . tic ( ) ;
94
+ for ( i = 0 ; i < b . iterations ; i ++ ) {
95
+ z = rand ( mu , s ) ;
96
+ if ( isnan ( z ) ) {
97
+ b . fail ( 'should not return NaN' ) ;
98
+ }
99
+ }
100
+ b . toc ( ) ;
101
+ if ( isnan ( z ) ) {
102
+ b . fail ( 'should not return NaN' ) ;
103
+ }
104
+ b . pass ( 'benchmark finished' ) ;
105
+ b . end ( ) ;
106
+ } ) ;
You can’t perform that action at this time.
0 commit comments