fnsllog10.gms : Test correctness of sllog10 intrinsic

Description

sllog10(x,S) = log_10(x)                 if x >= S
               (1/log 10) (ln(S) + r/S)  otherwise, r = x - S
for S >= 1e-150, default S = 1e-150.

Contributor: Steve, Mar 2017


Small Model of Type : GAMS


Category : GAMS Test library


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

$title 'Test correctness of sllog10 intrinsic' (FNSLLOG10,SEQ=721)

$ontext
sllog10(x,S) = log_10(x)                 if x >= S
               (1/log 10) (ln(S) + r/S)  otherwise, r = x - S
for S >= 1e-150, default S = 1e-150.

Contributor: Steve, Mar 2017
$offtext

$include fnset_xy.inc

$gdxin fnsllog10
$load aeps reps relToInput T data
$gdxin

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

$include fntest_xy.inc