S13ADF (PDF version)
S Chapter Contents
S Chapter Introduction
NAG Library Manual

NAG Library Routine Document

S13ADF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

S13ADF returns the value of the sine integral
Six=0xsinuudu,  
via the function name.

2  Specification

FUNCTION S13ADF ( X, IFAIL)
REAL (KIND=nag_wp) S13ADF
INTEGER  IFAIL
REAL (KIND=nag_wp)  X

3  Description

S13ADF calculates an approximate value for Six.
For x16.0 it is based on the Chebyshev expansion
Six=xr=0arTrt,t=2 x16 2-1.  
For 16<x<xhi, where xhi is an implementation-dependent number,
Six=signx π2-fxcosxx-gxsinxx2  
where fx=r=0frTrt and gx=r=0grTrt, t=2 16x 2-1.
For xxhi, Six=12π signx to within machine precision.

4  References

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

5  Parameters

1:     X – REAL (KIND=nag_wp)Input
On entry: the argument x of the function.
2:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

There are no failure exits from S13ADF. The parameter IFAIL has been included for consistency with other routines in this chapter.

7  Accuracy

If δ and ε are the relative errors in the argument and result, respectively, then in principle
ε δ sinx Six .  
The equality may hold if δ is greater than the machine precision (δ due to data errors etc.) but if δ is simply due to round-off in the machine representation, then since the factor relating δ to ε is always less than one, the accuracy will be limited by machine precision.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

This example reads values of the argument x from a file, evaluates the function at each value of x and prints the results.

10.1  Program Text

Program Text (s13adfe.f90)

10.2  Program Data

Program Data (s13adfe.d)

10.3  Program Results

Program Results (s13adfe.r)

GnuplotProduced by GNUPLOT 4.6 patchlevel 3 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 −10 −5 0 5 10 Si(x) x Example Program Returned Values for the Sine Integral Si(x) gnuplot_plot_1

S13ADF (PDF version)
S Chapter Contents
S Chapter Introduction
NAG Library Manual

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