NAG CL Interface
s13adc (integral_​sin)

1 Purpose

s13adc returns the value of the sine integral
Six=0xsinuudu,  
.

2 Specification

#include <nag.h>
double  s13adc (double x)
The function may be called by the names: s13adc, nag_specfun_integral_sin or nag_sin_integral.

3 Description

s13adc 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 double Input
On entry: the argument x of the function.

6 Error Indicators and Warnings

None.

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

s13adc 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 (s13adce.c)

10.2 Program Data

Program Data (s13adce.d)

10.3 Program Results

Program Results (s13adce.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