Description
Small Model of Type : GAMS
Category : GAMS Test library
Main file : fnsigmo2.gms includes : fnset_x.inc [html] fntest_x.inc [html]
$title 'Test correctness of sigmoid intrinsic' (FNSIGMO2,SEQ=193)
$include fnset_x.inc
reps = 2e-14;
relToInput = 0;
set T / t1 * t5 /;
table data(T,V)
x f_ fx_ fxx_
t1 0 0.5 .25 0
t2 1 0.731058578630005 0.196611933241482 -0.0908577476729484
t3 -1 0.268941421369995 0.196611933241482 0.0908577476729484
t4 100 1 3.72007597602084e-044 -3.72007597602084e-044
t5 -100 3.72007597602084e-044 3.72007597602084e-044 3.72007597602084e-044
;
loop {T,
data(T, 'f') = sigmoid.value (data(T,'x'));
data(T, 'fx') = sigmoid.grad (data(T,'x'));
data(T,'fxx') = sigmoid.hess (data(T,'x'));
data(T, 'rc') = mathlastrc;
data(T, 'ec') = mathlastec;
};
$include fntest_x.inc
display data;