Skip to content

Commit 9ec5f1f

Browse files
committed
Cache value
1 parent ccd2d9f commit 9ec5f1f

File tree

1 file changed

+6
-2
lines changed
  • lib/node_modules/@stdlib/random/base/box-muller/lib

1 file changed

+6
-2
lines changed

lib/node_modules/@stdlib/random/base/box-muller/lib/min.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ var cos = require( '@stdlib/math/base/special/cos' );
2626
var PI = require( '@stdlib/constants/math/float64-pi' );
2727

2828

29+
// VARIABLES //
30+
31+
var COS_PI = cos( PI );
32+
33+
2934
// MAIN //
3035

3136
/**
@@ -37,8 +42,7 @@ var PI = require( '@stdlib/constants/math/float64-pi' );
3742
*/
3843
function getMin( min ) {
3944
var a = sqrt( -2.0 * ln( min ) );
40-
var b = PI;
41-
return a * cos( b );
45+
return a * COS_PI;
4246
}
4347

4448

0 commit comments

Comments
 (0)