NAG Library Function Document
nag_exp_integral (s13aac) returns the value of the exponential integral .
||nag_exp_integral (double x,
nag_exp_integral (s13aac) evaluates
The approximation is based on several Chebyshev expansions.
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
x – doubleInput
On entry: the argument of the function.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, x
must not be less than or equal to 0.0:
The function is not defined for this value and the result returned is zero.
If and are the relative errors in argument and result respectively, then in principle, , so the relative error in the argument is amplified in the result by at least a factor . The equality should hold if is greater than the machine precision ( due to data errors etc.), but if is simply a result of round-off in the machine representation, it is possible that an extra figure may be lost in internal calculation and round-off.
It should be noted that, for small , the amplification factor tends to zero and eventually the error in the result will be limited by machine precision.
For large , , the absolute error in the argument.
To guard against producing underflows, if is larger than a machine-dependent value , the result is set directly to zero.
The following program reads values of the argument from a file, evaluates the function at each value of and prints the results.
9.1 Program Text
Program Text (s13aace.c)
9.2 Program Data
Program Data (s13aace.d)
9.3 Program Results
Program Results (s13aace.r)