NAG Library Routine Document

s13adf (integral_sin)

1
Purpose

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

2
Specification

Fortran Interface
Function s13adf ( x, ifail)
Real (Kind=nag_wp):: s13adf
Integer, Intent (Inout):: ifail
Real (Kind=nag_wp), Intent (In):: x
C Header Interface
#include <nagmk26.h>
double  s13adf_ (const double *x, Integer *ifail)

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

NIST Digital Library of Mathematical Functions

5
Arguments

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 argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation 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 argument, 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 argument 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 1, the accuracy will be limited by machine precision.

8
Parallelism and Performance

s13adf is not threaded in any implementation.

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