changeset 12626:f08be388fde8 octave-forge

bug #38170 fixed (inaccurate normcdf)
author schloegl
date Mon, 01 Jun 2015 06:10:55 +0000
parents 01272b2792d1
children a5790043b6a9
files extra/NaN/inst/normcdf.m
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/extra/NaN/inst/normcdf.m	Sat May 30 23:56:46 2015 +0000
+++ b/extra/NaN/inst/normcdf.m	Mon Jun 01 06:10:55 2015 +0000
@@ -40,7 +40,7 @@
 % allocate output memory and check size of arguments
 z = (x-m)./s;	  % if this line causes an error, input arguments do not fit. 
 
-p = (1 + erf(z/sqrt(2)))/2;
+p = erfc(z/-sqrt(2))/2;
 
 z = (s==0);
 p((x<m) & z) = 0;