fnsqrt.gms : Test correctness of sqrt intrinsic

Description

define some sets, etc.


Small Model of Type : GAMS


Category : GAMS Test library


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

$title 'Test correctness of sqrt intrinsic' (FNSQRT,SEQ=155)

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

$gdxIn fnsqrt
$load aeps reps relToInput T data
$gdxIn

reps = 5e-16;

loop {T,
  data(T,  'f')    = sqrt.value (data(T,'x'));
  data(T, 'fx')    = sqrt.grad  (data(T,'x'));
  data(T,'fxx')    = sqrt.hess  (data(T,'x'));
  data(T, 'rc')    = mathlastrc;
  data(T, 'ec')    = mathlastec;
};

abort$(execerror lt 2)
  'Should get execution errors evaluating grad/hess of sqrt(x), x tiny';
execerror = 0;

$include fntest_x.inc