cpplib02.gms : Test extrinsic functions in cppcclib

Description

```Here we test that the extrinsic function in cppcclib for the bi-variate
normal distribution CDF works as expected, by comparing the function
values to precomputed ones and derivative values to numeric
derivatives.

Contributor: Steve
```

Small Model of Type : GAMS

Category : GAMS Test library

Main file : cpplib02.gms

``````\$title Test extrinsic functions in cppcclib (CPPLIB02,SEQ=636)

\$onText
Here we test that the extrinsic function in cppcclib for the bi-variate
normal distribution CDF works as expected, by comparing the function
values to precomputed ones and derivative values to numeric
derivatives.

Contributor: Steve
\$offText
\$onDollar

\$funcLibIn mvnLib cppcclib

* function pdf2    'PDF of bivariate normal'  / mvnLib.pdfBVN /;
function cdf2    'CDF of bivariate normal'  / mvnLib.cdfBVN /;

\$if not set INFILE \$set INFILE bvnFull
\$macro f0     cdf2.value(data(T,'x'),data(T,'y'),data(T,'r'))
\$macro f2(j1,j2)  cdf2.hess (j1:j2:data(T,'x'),data(T,'y'),data(T,'r'));
\$macro f2n(j1,j2) cdf2.hessn(j1:j2:data(T,'x'),data(T,'y'),data(T,'r'));

\$include extrtest2a.inc

data(T, 'f_') = data(T,'cdf');

scalar
aeps0       'absolute error tolerance: function' / 1e-15 /
reps0       'relative error tolerance: function' / 1e-15 /
aeps1       'absolute error tolerance: grad'     / 1e-5 /
reps1       'relative error tolerance: grad'     / 1e-5 /
aeps2       'absolute error tolerance: hess'     / 1e-5 /
reps2       'relative error tolerance: hess'     / 1e-5 /
aepsr       'absolute error tolerance: hess xr'  / 1e-2 /
repsr       'relative error tolerance: hess xr'  / 1e-2 /
;

\$include extrtest2b.inc
``````
GAMS Development Corp.
GAMS Software GmbH

General Information and Sales
U.S. (+1) 202 342-0180
Europe: (+49) 221 949-9170
GAMS is a registered trademark of GAMS Software GmbH in the European Union