Skip to content

Commit 65de5b3

Browse files
authored
refactor: rename variables and reorder conditionals
Signed-off-by: Athan <[email protected]>
1 parent 9797449 commit 65de5b3

File tree

1 file changed

+8
-8
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/skew-normal/pdf/lib

1 file changed

+8
-8
lines changed

lib/node_modules/@stdlib/stats/base/dists/skew-normal/pdf/lib/main.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
// MODULES //
2222

23-
var normalPdf = require( '@stdlib/stats/base/dists/normal/pdf' );
24-
var normalCdf = require( '@stdlib/stats/base/dists/normal/cdf' );
23+
var normalPDF = require( '@stdlib/stats/base/dists/normal/pdf' );
24+
var normalCDF = require( '@stdlib/stats/base/dists/normal/cdf' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626

2727

@@ -77,15 +77,15 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
7777
function pdf( x, mu, sigma, alpha ) {
7878
var pdf;
7979
var cdf;
80-
pdf = normalPdf( x, mu, sigma );
80+
if ( isnan( alpha ) ) {
81+
return NaN;
82+
}
83+
pdf = normalPDF( x, mu, sigma );
8184
if ( alpha === 0.0 ) {
8285
return pdf;
8386
}
84-
if ( isnan(alpha) ) {
85-
return NaN;
86-
}
87-
cdf = normalCdf( alpha * x, alpha * mu, sigma );
88-
return 2 * pdf * cdf;
87+
cdf = normalCDF( alpha*x, alpha*mu, sigma );
88+
return 2.0 * pdf * cdf;
8989
}
9090

9191

0 commit comments

Comments
 (0)