00001 #include "expmax.h" 00002 00003 double exp_plus_quadratic_function (double x, void *params) 00004 { 00005 struct exp_plus_quadratic_params *p 00006 = (struct exp_plus_quadratic_params *) params; 00007 00008 double A0 = p->A0; 00009 double A1 = p->A1; 00010 double A2 = p->A2; 00011 double A3 = p->A3; 00012 double A4 = p->A4; 00013 double A5 = p->A5; 00014 00015 double z = (x - A1) / A2; 00016 return -(A0 * exp (-z * z / 2.) +A3 + A4 *x + A5 * x * x); 00017 } 00018