Hi:
You'd better define some temporary variables and use short expressions in your function, such as:
double temp1 = sqrt(ln(2)/PI)/w1;
double temp2 = 4*pow( (x-xc), 2 );
if(xc<0)
{
y = temp1 + temp2;
}
else
{
y = temp1 * temp2;
}
Or, it's very easy to make mistakes.
Thanks
Larry
OriginLab Technical Services
Edited by - larry_lan on 04/14/2008 05:59:00 AM