# NAG Library Function Documentnag_bessel_i_nu (s18eec)

## 1  Purpose

nag_bessel_i_nu (s18eec) returns the value of the modified Bessel function ${I}_{\nu /4}\left(x\right)$ for real $x>0$.

## 2  Specification

#include <nag.h>
#include <nags.h>

double  nag_bessel_i_nu (double x, Integer nu,  NagError *fail)

## 3  Description

nag_bessel_i_nu (s18eec) evaluates an approximation to the modified Bessel function of the first kind ${I}_{\nu /4}\left(x\right)$, where the order $\nu =-3,-2,-1,1,2$ or $3$ and $x$ is real and positive. For positive orders it may also be called with $x=0$, since ${I}_{\nu /4}\left(0\right)=0$ when $\nu >0$. For negative orders the formula

$I - ν / 4 x = I ν/4 x + 2 π sin πν 4 K ν/4 x$
is used.

## 4  References

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

## 5  Arguments

1:     x – doubleInput
On entry: the argument $x$ of the function.
Constraints:
• if ${\mathbf{nu}}<0$, ${\mathbf{x}}>0.0$;
• if ${\mathbf{nu}}>0$, ${\mathbf{x}}\ge 0.0$.
2:     nu – IntegerInput
On entry: the argument $\nu $ of the function.
Constraint: $1\le \mathrm{abs}\left({\mathbf{nu}}\right)\le 3$.
3:     fail – NagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_INT
On entry, ${\mathbf{nu}}=〈\mathit{\text{value}}〉$.
Constraint: $1\le \mathrm{abs}\left({\mathbf{nu}}\right)\le 3$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_OVERFLOW_LIKELY
The evaluation has been abandoned due to the likelihood of overflow. The result is returned as zero.
NE_REAL_INT
On entry, ${\mathbf{x}}=〈\mathit{\text{value}}〉$, ${\mathbf{nu}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{x}}>0.0$ when ${\mathbf{nu}}<0$.
On entry, ${\mathbf{x}}=〈\mathit{\text{value}}〉$, ${\mathbf{nu}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{x}}\ge 0.0$ when ${\mathbf{nu}}>0$.
NE_TERMINATION_FAILURE
The evaluation has been abandoned due to failure to satisfy the termination condition. The result is returned as zero.
NE_TOTAL_PRECISION_LOSS
The evaluation has been abandoned due to total loss of precision. The result is returned as zero.
NW_SOME_PRECISION_LOSS
The evaluation has been completed but some precision has been lost.

## 7  Accuracy

All constants in the underlying functions are specified to approximately 18 digits of precision. If $t$ denotes the number of digits of precision in the floating point arithmetic being used, then clearly the maximum number of correct digits in the results obtained is limited by $p=\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(t,18\right)$. Because of errors in argument reduction when computing elementary functions inside the underlying functions, the actual number of correct digits is limited, in general, by $p-s$, where $s\approx \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,\left|{\mathrm{log}}_{10}x\right|\right)$ represents the number of digits lost due to the argument reduction. Thus the larger the value of $x$, the less the precision in the result.

None.

## 9  Example

The example program reads values of the arguments $x$ and $\nu $ from a file, evaluates the function and prints the results.

### 9.1  Program Text

Program Text (s18eece.c)

### 9.2  Program Data

Program Data (s18eece.d)

### 9.3  Program Results

Program Results (s18eece.r)
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 34, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.6587115526199341, "perplexity_flag": "middle"}