Skip to content

Commit 6dfe477

Browse files
author
Jim-215-Fisher
committed
pdf formula change to prevent overflow
1 parent 915d143 commit 6dfe477

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stdlib_stats_distribution_normal.fypp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ contains
279279

280280
if(scale == 0._${k1}$) call error_stop("Error(pdf_norm): Normal" &
281281
//"distribution scale parameter must be non-zero")
282-
res = exp(- 0.5_${k1}$ * (x - loc) * (x - loc) / (scale * scale)) / &
282+
res = exp(- 0.5_${k1}$ * ((x - loc) / scale) * (x - loc) / scale) / &
283283
(sqrt_2_Pi * scale)
284284
end function pdf_norm_${t1[0]}$${k1}$
285285

0 commit comments

Comments
 (0)