NAG CL Interface
s13adc (integral_​sin)

Settings help

CL Name Style:


1 Purpose

s13adc returns the value of the sine integral
Si(x)=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 Si(x).
For |x|16.0 it is based on the Chebyshev expansion
Si(x)=xr=0arTr(t),t=2 (x16) 2-1.  
For 16<|x|<xhi, where xhi is an implementation-dependent number,
Si(x)=sign(x) {π2-f(x)cosxx-g(x)sinxx2}  
where f(x)=r=0frTr(t) and g(x)=r=0grTr(t), t=2 ( 16x) 2-1.
For |x|xhi, Si(x)=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 Si(x) | .  
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

Background information to multithreading can be found in the Multithreading documentation.
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 5.4 patchlevel 6 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 −10 −5 0 5 10 Si(x) x "s13adfe.r" Example Program Returned Values for the Sine Integral Si(x)