fngamma.gms : Test correctness of gamma intrinsic

Description

define some sets, etc.

I do not claim the known values in fngamma.gdx are very precise

reps0 = 1e-12;
reps1 = 1e-8;
reps2 = 1e-8;


Small Model of Type : GAMS


Category : GAMS Test library


Main file : fngamma.gms   includes :   fnset_x.inc [htmlfntest_x.inc [html]

$title 'Test correctness of gamma intrinsic' (FNGAMMA,SEQ=183)

* define some sets, etc.
$include fnset_x.inc

* I do not claim the known values in fngamma.gdx are very precise
$gdxIn fngamma
$load aeps reps0 reps1 reps2 relToInput T data
$gdxIn

* reps0 = 1e-12;
* reps1 = 1e-8;
* reps2 = 1e-8;
loop {T,
  data(T,  'f')    = gamma.value (data(T,'x'));
  data(T, 'fx')    = gamma.grad  (data(T,'x'));
  data(T,'fxx')    = gamma.hess  (data(T,'x'));
  data(T, 'rc')    = mathlastrc;
  data(T, 'ec')    = mathlastec;
};

* the data set contains some large values that cause overflow
abort$[execerror < 6] 'Should get execution errors evaluating gamma.XXXX(x) for x large';
execerror = 0;

$include fntest_x.inc