fnset_xy.inc : intrinsics tests for f(x,y)

File : fnset_xy.inc  used by :  fnpower.gms [html]   fnvcpow.gms [htmlfnvcpow2.gms [html]   fnrpow.gms [htmlfnrpow2.gms [html]   fnrpow3.gms [htmlfnatan2.gms [html]   fnatan2n.gms [html]   fnatan2x.gms [html]   fncentry.gms [html]   fncentr4.gms [html]   fncentr5.gms [html]   fncentr6.gms [html]   fnspowx.gms [htmlfnspown.gms [html]   fnslexp.gms [htmlfnslexp2.gms [html]   fnsqexp.gms [htmlfnsqexp2.gms [html]   fnsllog10.gms [html]   fnsllog102.gms [html]   fnsqlog10.gms [html]   fnsqlog102.gms [html]   fnslrec.gms [htmlfnslrec2.gms [html]   fnsqrec.gms [htmlfnsqrec2.gms [html]   fnbinomial.gms [html]   fnncpf3.gms [htmlfnncpvupow2.gms [html]   fnncpvusin2.gms [html]

$onText
How is relative accuracy defined?  Given:
  1. a point x,
  2. the computed value f(x), and
  3. the known value fbar,

we can compute the relative accuracy of f vis-a-vis fbar in two ways:
  1. |f-fbar| <= reps * |fbar|
  2. |f-fbar| <= reps * max(1,|x|)

The first case is the most common, but for some functions
the second is more appropriate (e.g. sin(x)).

We can also pass a test if the absolute accuracy is within some
tolerance aeps:
  1. |f-fbar| <= aeps

Contributor: Steven Dirkse, October 2004
$offText

set V / x, y, d
        f,     f_,     f_a,     f_r
       fx,    fx_,    fx_a,    fx_r
       fy,    fy_,    fy_a,    fy_r
      fxx,   fxx_,   fxx_a,   fxx_r
      fxy,   fxy_,   fxy_a,   fxy_r
      fyx,   fyx_,   fyx_a,   fyx_r
      fyy,   fyy_,   fyy_a,   fyy_r
       rc,    rc_,    rc_e
       ec,    ec_,    ec_e
/;

scalar aeps       'absolute error tolerance';
scalar aeps0      'absolute error tolerance, function';
scalar aeps1      'absolute error tolerance, first derivative';
scalar aeps2      'absolute error tolerance, second derivative';
scalar reps       'relative error tolerance';
scalar reps0      'relative error tolerance, function';
scalar reps1      'relative error tolerance, first derivative';
scalar reps2      'relative error tolerance, second derivative';
scalar relToInput 'reps is relative to input (not output) magnitude';
sets
  T          'all test instances'
  badT(T)    'failed test instances'
  badTV(T,V) 'only the items/checks that failed'
  inV(V)     'inputs' / x, y, d /
  fV(V)      'func info' /  f,   f_,   f_r,   f_a  /
  fxV(V)     'grad info' /  fx,  fx_,  fx_r,  fx_a  /
  fyV(V)     'grad info' /  fy,  fy_,  fy_r,  fy_a  /
  fxxV(V)    'Hess info' /  fxx, fxx_, fxx_r, fxx_a  /
  fxyV(V)    'Hess info' /  fxy, fxy_, fxy_r, fxy_a  /
  fyxV(V)    'Hess info' /  fyx, fyx_, fyx_r, fyx_a  /
  fyyV(V)    'Hess info' /  fyy, fyy_, fyy_r, fyy_a  /
  rcV(V)     'rc info'   /  rc,  rc_,  rc_e /
  ecV(V)     'ec info'   /  ec,  ec_,  ec_e /
  ;
parameters
  data(T,V)
  tmp(T)
  failures(T,V) 'all data for failed test instances'
  fail2(T,V)    'most relevant data for failed test instances'
  ;