Let
and
be the relative errors in the argument and result respectively.
If
is somewhat larger than the machine precision (i.e., if
is due to data errors etc. ), then
and
are approximately related by
.
However, if
is of the same order as the machine precision, then rounding errors could make
slightly larger than the above relation predicts.
For small
,
and there is no amplification of errors.
For large
,
and we have strong amplification of the relative error. Eventually
, which is asymptotically given by
, becomes so small that it cannot be calculated without underflow and hence the function will return zero. Note that for large
the errors will be dominated by those of the math library function exp.