File tree 3 files changed +7
-15
lines changed
lib/node_modules/@stdlib/stats/base/dists/rayleigh/median
3 files changed +7
-15
lines changed Original file line number Diff line number Diff line change 21
21
// MODULES //
22
22
23
23
var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
24
- var sqrt = require ( '@stdlib/math/base/special/sqrt' ) ;
25
- var LN2 = require ( '@stdlib/constants/float64/ln-two' ) ;
26
24
27
25
28
26
// VARIABLES //
29
27
30
- var SQRT2LN2 = sqrt ( 2.0 * LN2 ) ;
28
+ var SQRT2LN2 = 1.1774100225154747 ; // sqrt(2*ln(2))
31
29
32
30
33
31
// MAIN //
Original file line number Diff line number Diff line change 39
39
"libpath" : [],
40
40
"dependencies" : [
41
41
" @stdlib/math/base/napi/unary" ,
42
- " @stdlib/math/base/assert/is-nan" ,
43
- " @stdlib/constants/float64/ln-two" ,
44
- " @stdlib/math/base/special/sqrt"
42
+ " @stdlib/math/base/assert/is-nan"
45
43
]
46
44
},
47
45
{
57
55
"libpath" : [],
58
56
"dependencies" : [
59
57
" @stdlib/math/base/assert/is-nan" ,
60
- " @stdlib/constants/float64/ln-two" ,
61
- " @stdlib/constants/float64/eps" ,
62
- " @stdlib/math/base/special/sqrt"
58
+ " @stdlib/constants/float64/eps"
63
59
]
64
60
},
65
61
{
74
70
"libraries" : [],
75
71
"libpath" : [],
76
72
"dependencies" : [
77
- " @stdlib/math/base/assert/is-nan" ,
78
- " @stdlib/constants/float64/ln-two" ,
79
- " @stdlib/math/base/special/sqrt"
73
+ " @stdlib/math/base/assert/is-nan"
80
74
]
81
75
}
82
76
]
Original file line number Diff line number Diff line change 18
18
19
19
#include "stdlib/stats/base/dists/rayleigh/median.h"
20
20
#include "stdlib/math/base/assert/is_nan.h"
21
- #include "stdlib/math/base/special/sqrt.h"
22
- #include "stdlib/constants/float64/ln_two.h"
21
+
22
+ static const double SQRT2LN2 = 1.1774100225154747 ; // sqrt(2*ln(2))
23
23
24
24
/**
25
25
* Returns the median of a Rayleigh distribution.
@@ -35,5 +35,5 @@ double stdlib_base_dists_rayleigh_median( const double sigma ) {
35
35
if ( stdlib_base_is_nan ( sigma ) || sigma < 0 ) {
36
36
return 0.0 / 0.0 ; // NaN
37
37
}
38
- return sigma * stdlib_base_sqrt ( 2.0 * STDLIB_CONSTANT_FLOAT64_LN2 ) ;
38
+ return sigma * SQRT2LN2 ;
39
39
}
You can’t perform that action at this time.
0 commit comments