NAG Library Manual, Mark 27.3
```/* E01EB_T1W_F C++ Header Example Program.
*
* Copyright 2021 Numerical Algorithms Group.
* Mark 27.3, 2021.
*/

#include <dco.hpp>
#include <iostream>
#include <math.h>
#include <nag.h>
#include <stdio.h>
#include <string>
using namespace std;

int main()
{
// Scalars
int exit_status = 0;

cout << "E01EB_T1W_F C++ Header Example Program Results\n\n";

// Skip first line of data file
string mystr;
getline(cin, mystr);
// Read number of data points
Integer n;
cin >> n;

// Allocate arrays for data and interpolant
nagad_t1w_w_rtype *x = 0, *y = 0, *f = 0;
Integer *          triang = 0;
triang                    = new Integer[7 * n];

// Create AD configuration data object
Integer           ifail = 0;

// Read data and register variables
for (int i = 0; i < n; i++)
{
double xr, yr, fr;
cin >> xr >> yr >> fr;
x[i] = xr;
y[i] = yr;
f[i] = fr;
}

ifail = 0;
// Evaluate interpolant and derivatives at a mid-point
double            xint, yint;
xint  = 0.5 * (dco::value(x[n / 2 - 1]) + dco::value(x[n / 2]));
yint  = 0.5 * (dco::value(y[n / 2 - 1]) + dco::value(y[n / 2]));
px[0] = xint;
py[0] = yint;

double  inc = 1.0, zero = 0.0;
Integer m              = 1;
dco::derivative(px[0]) = inc;
ifail                  = 0;
double dx              = dco::derivative(pf[0]);
dco::derivative(px[0]) = zero;

dco::derivative(py[0]) = inc;
ifail                  = 0;
double dy = dco::derivative(pf[0]);

cout << "\n Interpolant point: x = " << xint << " y = " << yint << endl;
cout.precision(5);
cout << " Interpolated value = " << dco::value(pf[0]) << endl;

cout << "\n Derivatives calculated: First order tangents\n";
cout << " Computational mode    : algorithmic\n";

cout.setf(ios::scientific, ios::floatfield);
cout.precision(4);
cout << "\n Derivatives of fitted value w.r.t. fit point:\n\n";
cout << "     d/dx  = " << dx << endl;
cout << "     d/dy  = " << dy << endl;

delete[] x;
delete[] y;
delete[] f;
delete[] triang;
return exit_status;
}
```