File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 2222
2323var bench = require ( '@stdlib/bench' ) ;
2424var randu = require ( '@stdlib/random/base/randu' ) ;
25+ var uniform = require ( '@stdlib/random/base/uniform' ) ;
2526var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
2627var pkg = require ( './../package.json' ) . name ;
2728var mgf = require ( './../lib' ) ;
@@ -37,8 +38,8 @@ bench( pkg, function benchmark( b ) {
3738
3839 b . tic ( ) ;
3940 for ( i = 0 ; i < b . iterations ; i ++ ) {
40- t = ( randu ( ) * 100.0 ) - 100 ;
41- mu = ( randu ( ) * 100.0 ) - 50.0 ;
41+ t = uniform ( - 100.0 , 0.0 ) ;
42+ mu = uniform ( - 50.0 , 50.0 ) ;
4243 y = mgf ( t , mu ) ;
4344 if ( isnan ( y ) ) {
4445 b . fail ( 'should not return NaN' ) ;
Original file line number Diff line number Diff line change 1818
1919#include "stdlib/math/base/assert/is_nan.h"
2020#include "stdlib/math/base/special/exp.h"
21+ #include "stdlib/stats/base/dists/degenerate/mgf.h"
2122
2223/**
2324* Evaluates the moment-generating function (MGF) for a degenerate distribution centered at `mu`.
You can’t perform that action at this time.
0 commit comments