Settings help

CL Name Style:

## 1Purpose

s13adc returns the value of the sine integral
 $Si(x)=∫0xsin⁡uudu,$
.

## 2Specification

 #include
The function may be called by the names: s13adc, nag_specfun_integral_sin or nag_sin_integral.

## 3Description

s13adc calculates an approximate value for $\mathrm{Si}\left(x\right)$.
For $|x|\le 16.0$ it is based on the Chebyshev expansion
 $Si(x)=x∑r=0′arTr(t),t=2 (x16) 2-1.$
For $16<|x|<{x}_{\mathrm{hi}}$, where ${x}_{\mathrm{hi}}$ is an implementation-dependent number,
 $Si(x)=sign(x) {π2-f(x)cos⁡xx-g(x)sin⁡xx2}$
where $f\left(x\right)=\underset{r=0}{{\sum }^{\prime }}\phantom{\rule{0.25em}{0ex}}{f}_{r}{T}_{r}\left(t\right)$ and $g\left(x\right)=\underset{r=0}{{\sum }^{\prime }}\phantom{\rule{0.25em}{0ex}}{g}_{r}{T}_{r}\left(t\right)$, $t=2{\left(\frac{16}{x}\right)}^{2}-1$.
For $|x|\ge {x}_{\mathrm{hi}}$, $\mathrm{Si}\left(x\right)=\frac{1}{2}\pi \mathrm{sign}x$ to within machine precision.

## 4References

NIST Digital Library of Mathematical Functions

## 5Arguments

1: $\mathbf{x}$double Input
On entry: the argument $x$ of the function.

None.

## 7Accuracy

If $\delta$ and $\epsilon$ are the relative errors in the argument and result, respectively, then in principle
 $|ε|≃ | δ sin⁡x Si(x) | .$
The equality may hold if $\delta$ is greater than the machine precision ($\delta$ due to data errors etc.) but if $\delta$ is simply due to round-off in the machine representation, then since the factor relating $\delta$ to $\epsilon$ is always less than $1$, the accuracy will be limited by machine precision.

None.

## 10Example

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