nag_erfcx (s15agc) calculates an approximate value for the scaled complementary error function
Let
be the root of the equation
(then
). For
the value of
is based on the following rational Chebyshev expansion for
:
where
denotes a rational function of degree
in the numerator and
in the denominator.
For
the value of
is based on a rational Chebyshev expansion for
: for
the value is based on the expansion
and for
it is based on the expansion
For each expansion, the specific values of
and
are selected to be minimal such that the maximum relative error in the expansion is of the order
, where
is the maximum number of decimal digits that can be accurately represented for the particular implementation (see
nag_decimal_digits (X02BEC)).
Asymptotically,
. There is a danger of setting underflow in
whenever
, where
is the largest positive model number (see
nag_real_largest_number (X02ALC)) and
is the smallest positive model number (see
nag_real_smallest_number (X02AKC)). In this case nag_erfcx (s15agc) exits with
NW_HI and returns
. For
in the range
, where
is the
machine precision, the asymptotic value
is returned for
and nag_erfcx (s15agc) exits with
NW_REAL.
There is a danger of setting overflow in
whenever
. In this case nag_erfcx (s15agc) exits with
NW_NEG and returns
.
The relative error in computing
may be estimated by evaluating
where
denotes repeated integration. Empirical results suggest that on the interval
the loss in base
significant digits for maximum relative error is around
, while for root-mean-square relative error on that interval it is
(see
nag_real_base (X02BHC) for the definition of the model parameter
). On the interval
the values are around
for maximum and
for root-mean-square relative errors; note that on these two intervals
is the primary computation. See also
Section 7 in nag_erfc (s15adc).
nag_erfcx (s15agc) is not threaded in any implementation.
None.