NAG CL Interface
s19aac (kelvin_​ber)

Settings help

CL Name Style:

1 Purpose

s19aac returns a value for the Kelvin function berx.

2 Specification

#include <nag.h>
double  s19aac (double x, NagError *fail)
The function may be called by the names: s19aac, nag_specfun_kelvin_ber or nag_kelvin_ber.

3 Description

s19aac evaluates an approximation to the Kelvin function berx.
Note:  ber(-x)=berx, so the approximation need only consider x0.0.
The function is based on several Chebyshev expansions:
For 0x5,
berx=r=0arTr(t),   with ​ t=2 (x5) 4-1.  
For x>5,
berx= ex/22πx [(1+ 1xa(t))cosα+ 1xb(t)sinα] + e-x/22πx [(1+ 1xc(t))sinβ+ 1xd(t)cosβ] ,  
and a(t), b(t), c(t), and d(t) are expansions in the variable t= 10x-1.
For large x, there is a danger of the result being totally inaccurate, as the error amplification factor grows in an essentially exponential manner;, therefore, the function must fail.

4 References

NIST Digital Library of Mathematical Functions

5 Arguments

1: x double Input
On entry: the argument x of the function.
2: fail NagError * Input/Output

6 Error Indicators and Warnings

Dynamic memory allocation failed.
On entry, x=value.
Constraint: |x|value.
|x| is too large for an accurate result to be returned and the function returns zero.

7 Accuracy

E |x2(ber1x+bei1x)|δ  
(provided E is within machine bounds).
For medium and large x, the error behaviour is oscillatory and its amplitude grows like x2π ex/2. Therefore, it is not possible to calculate the function with any accuracy when xex/2> 2πδ . Note that this value of x is much smaller than the minimum value of x for which the function overflows.

8 Parallelism and Performance

s19aac is not threaded in any implementation.

9 Further Comments


10 Example


10.1 Program Text

Program Text (s19aace.c)

10.2 Program Data

Program Data (s19aace.d)

10.3 Program Results

Program Results (s19aace.r)