NAG Library Manual, Mark 27.2
```    Program e01aa_t1w_fe

!     E01AA_T1W_F Example Program Text

!     Mark 27.2 Release. NAG Copyright 2021.

!     .. Use Statements ..
Use iso_c_binding, Only: c_ptr
Assignment (=)
Use nag_library, Only: nag_wp
!     .. Implicit None Statement ..
Implicit None
!     .. Parameters ..
Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
Real (Kind=nag_wp)               :: fx, xr
Integer                          :: i, ifail, j, n, n1, n2
!     .. Local Arrays ..
Type (nagad_t1w_w_rtype), Allocatable :: a(:), b(:), c(:)
Real (Kind=nag_wp), Allocatable  :: ar(:), br(:), dx(:)
!     .. Executable Statements ..
Write (nout,*) 'E01AA_T1W_F Example Program Results'

!     Skip heading in data file

n1 = n + 1
n2 = n*(n+1)/2
Allocate (a(n1),b(n1),c(n2))
Allocate (ar(n1),br(n1),dx(n1))

!     Create AD configuration data object and set computational mode
ifail = 0
ifail = 0

Do i = 1, n1

x = xr
a(1:n1) = ar(1:n1)
b(1:n1) = br(1:n1)
c(1:n2) = 0.0_nag_wp

ifail = 0

If (i==1) Then
fx = c(n2)%value
End If
dx(i) = c(n2)%tangent

End Do

Write (nout,*)
Write (nout,99999) 'Interpolation point = ', xr
Write (nout,*)
Write (nout,99999) 'Function value at interpolation point = ', fx

Write (nout,*)
Write (nout,*) ' Derivatives calculated: First order tangents'
Write (nout,*) ' Computational mode    : algorithmic'

Write (nout,*)
Write (nout,*) ' Derivatives of fitted value w.r.t. x values:'
Write (nout,*) '  j         d/dx(j)'
Do j = 1, n1
Write (nout,99998) j, dx(j)
End Do

!     Remove computational data object