nag_exp_integral (s13aac) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_exp_integral (s13aac)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_exp_integral (s13aac) returns the value of the exponential integral E 1 x .

2  Specification

#include <nag.h>
#include <nags.h>
double  nag_exp_integral (double x, NagError *fail)

3  Description

nag_exp_integral (s13aac) evaluates
E 1 x = x e -u u du x > 0 .
The approximation is based on several Chebyshev expansions.

4  References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications

5  Arguments

1:     xdoubleInput
On entry: the argument x  of the function.
Constraint: x>0.0 .
2:     failNagError *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: x=value .
The function is not defined for this value and the result returned is zero.

7  Accuracy

If δ  and ε  are the relative errors in argument and result respectively, then in principle, ε e -x / E 1 x δ , so the relative error in the argument is amplified in the result by at least a factor e -x / E 1 x . 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 x , the amplification factor tends to zero and eventually the error in the result will be limited by machine precision.
For large x , ε x δ = Δ , the absolute error in the argument.
To guard against producing underflows, if x  is larger than a machine-dependent value x hi , the result is set directly to zero.

8  Further Comments


9  Example

The following program reads values of the argument x  from a file, evaluates the function at each value of x  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)

nag_exp_integral (s13aac) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012