function y = erfcx(x)
%ERFCX  Scaled complementary error function.
%   Y = ERFCX(X) is the scaled complementary error function for each
%   element of X.  X must be real.  The scaled complementary error
%   function is defined as: 
%
%     erfcx(x) = exp(x^2) * erfc(x)
%
%   which is approximately (1/sqrt(pi)) * 1/x for large x.
%
%   See also ERF, ERFC, ERFINV.

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.6 $  $Date: 1997/11/21 23:45:29 $

% Derived from a FORTRAN program by W. J. Cody.

if ~isreal(x), error('X must be real.'); end
siz = size(x);
x = x(:);
y = reshape(erfcore(x,2),siz);

