# NAG FL Interfacec06lcf (invlaplace_​weeks_​eval)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

c06lcf evaluates an inverse Laplace transform at a given point, using the expansion coefficients computed by c06lbf.

## 2Specification

Fortran Interface
 Subroutine c06lcf ( t, b, m, finv,
 Integer, Intent (In) :: m Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (In) :: t, sigma, b, acoef(m), errvec(8) Real (Kind=nag_wp), Intent (Out) :: finv
C Header Interface
#include <nag.h>
 void c06lcf_ (const double *t, const double *sigma, const double *b, const Integer *m, const double acoef[], const double errvec[], double *finv, Integer *ifail)
The routine may be called by the names c06lcf or nagf_sum_invlaplace_weeks_eval.

## 3Description

c06lcf is designed to be used following a call to c06lbf, which computes an inverse Laplace transform by representing it as a Laguerre expansion of the form:
 $f~ (t) = eσt ∑ i=0 m-1 ai e -bt/2 Li (bt) , σ > σO , b > 0$
where ${L}_{i}\left(x\right)$ is the Laguerre polynomial of degree $i$.
This routine simply evaluates the above expansion for a specified value of $t$.
c06lcf is derived from the subroutine MODUL2 in Garbow et al. (1988)

## 4References

Garbow B S, Giunta G, Lyness J N and Murli A (1988) Algorithm 662: A Fortran software package for the numerical inversion of the Laplace transform based on Weeks' method ACM Trans. Math. Software 14 171–176

## 5Arguments

1: $\mathbf{t}$Real (Kind=nag_wp) Input
On entry: the value $t$ for which the inverse Laplace transform $f\left(t\right)$ must be evaluated.
2: $\mathbf{sigma}$Real (Kind=nag_wp) Input
3: $\mathbf{b}$Real (Kind=nag_wp) Input
4: $\mathbf{m}$Integer Input
5: $\mathbf{acoef}\left({\mathbf{m}}\right)$Real (Kind=nag_wp) array Input
6: $\mathbf{errvec}\left(8\right)$Real (Kind=nag_wp) array Input
On entry: sigma, b, m, acoef and errvec must be unchanged from the previous call of c06lbf.
7: $\mathbf{finv}$Real (Kind=nag_wp) Output
On exit: the approximation to the inverse Laplace transform at $t$.
8: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-1$, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
${\mathbf{ifail}}=1$
The approximation to $f\left(t\right)$ is too large to be representable.
${\mathbf{ifail}}=2$
The approximation to $f\left(t\right)$ is too small to be representable.
${\mathbf{ifail}}=-99$
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

## 7Accuracy

The error estimate returned by c06lbf in ${\mathbf{errvec}}\left(1\right)$ has been found in practice to be a highly reliable bound on the pseudo-error $|f\left(t\right)-\stackrel{~}{f}\left(t\right)|{e}^{-\sigma t}$.

## 8Parallelism and Performance

c06lcf is not threaded in any implementation.

## 9Further Comments

c06lcf is primarily designed to evaluate $\stackrel{~}{f}\left(t\right)$ when $t>0$. When $t\le 0$, the result approximates the analytic continuation of $f\left(t\right)$; the approximation becomes progressively poorer as $t$ becomes more negative.

## 10Example

See example for c06lbf.