nag_specfun_cdf_normal (s15ab) evaluates an approximate value for the cumulative Normal distribution function
The function is based on the fact that
and it calls
nag_specfun_erfc_real (s15ad) to obtain a value of
for the appropriate argument.
None.
There are no failure exits from this function. The argument
ifail is included for consistency with other functions in this chapter.
Because of its close relationship with
, the accuracy of this function is very similar to that in
nag_specfun_erfc_real (s15ad). If
and
are the relative errors in result and argument, respectively, they are in principle related by
so that the relative error in the argument,
, is amplified by a factor,
, in the result.
For
small and for
positive this factor is always less than one and accuracy is mainly limited by
machine precision.
However the absolute error in the result,
, is given by
so absolute accuracy can be guaranteed for all
.
None.
function s15ab_example
fprintf('s15ab example results\n\n');
x = [-20 -1 0 1 2 20];
n = size(x,2);
result = x;
for j=1:n
[result(j), ifail] = s15ab(x(j));
end
disp(' x P(x)');
fprintf('%12.3e%12.3e\n',[x; result]);