fnrpow.gms : Test correctness of rpower intrinsic

Description

rpower(x,y) = x**y
these points are the "easy" ones, i.e. there should not be any
exceptions as all the inputs are of reasonable size.


Small Model of Type : GAMS


Category : GAMS Test library


Main file : fnrpow.gms   includes :   fnset_xy.inc [htmlfntest_xy.inc [html]

$title 'Test correctness of rpower intrinsic' (FNRPOW,SEQ=194)

* rpower(x,y) = x**y
* these points are the "easy" ones, i.e. there should not be any
* exceptions as all the inputs are of reasonable size.
$include fnset_xy.inc

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

* hack, reps in GDX file to narrow for Delphi math libs
reps = reps * 2;

* hack for GDX bug
relToInput = max(0,relToInput);

data(T,'fyx_') = data(T,'fxy_');

loop {T,
  data(T,  'f')  = rpower.value(   data(T,'x'),data(T,'y'));
  data(T, 'fx')  = rpower.grad(1:  data(T,'x'),data(T,'y'));
  data(T, 'fy')  = rpower.grad(2:  data(T,'x'),data(T,'y'));
  data(T,'fxx')  = rpower.hess(1:1:data(T,'x'),data(T,'y'));
  data(T,'fxy')  = rpower.hess(1:2:data(T,'x'),data(T,'y'));
  data(T,'fyx')  = rpower.hess(2:1:data(T,'x'),data(T,'y'));
  data(T,'fyy')  = rpower.hess(2:2:data(T,'x'),data(T,'y'));
  data(T, 'rc')  = mathlastrc;
  data(T, 'ec')  = mathlastec;
};

display relToInput;
$include fntest_xy.inc