nag_specfun_dawson (s15af) evaluates an approximation for Dawson's Integral
The function is based on two Chebyshev expansions:
For
,
For
,
For
near zero,
, and for
large,
. These approximations are used for those values of
for which the result is correct to
machine precision.
None.
If
is considerably greater than the
machine precision (i.e., if
is due to data errors etc.), then
and
are approximately related by:
The following graph shows the behaviour of the error amplification factor
:
Figure 1
However if
is of the same order as
machine precision, then rounding errors could make
somewhat larger than the above relation indicates. In fact
will be largely independent of
or
, but will be of the order of a few times the
machine precision.
None.
function s15af_example
fprintf('s15af example results\n\n');
x = [-2 -0.5 1 1.5 2 5 10];
n = size(x,2);
result = x;
for j=1:n
[result(j), ifail] = s15af(x(j));
end
disp(' x F(x)');
fprintf('%12.3e%12.3e\n',[x; result]);