nag_specfun_compcdf_normal (s15ac) evaluates an approximate value for the complement of the cumulative Normal distribution function
The function is based on the fact that
and it calls
nag_specfun_erfc_real (s15ad) to obtain the necessary value of
, the complementary error function.
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, then in principle they are related by
For
negative or small positive this factor is always less than one and accuracy is mainly limited by
machine precision. For large positive
we find
and hence to a certain extent relative accuracy is unavoidably lost. However the absolute error in the result,
, is given by
and since this factor is always less than one absolute accuracy can be guaranteed for all
.
None.
function s15ac_example
fprintf('s15ac example results\n\n');
x = [-20 -1 0 1 2 20];
n = size(x,2);
result = x;
for j=1:n
[result(j), ifail] = s15ac(x(j));
end
disp(' x Q(x)');
fprintf('%12.3e%12.3e\n',[x; result]);