admb-project / admb

AD Model Builder
http://admb-project.org
Other
64 stars 19 forks source link

Incorrect derivative computation in function mfexp for values greater than 60 #113

Closed johnoel closed 5 years ago

johnoel commented 5 years ago

In linad99/fvar_a50.cpp line 34, the computed mfexp values for x > 60 is

vtmp.elem_value(i)=exp(60.)*(1.+2.*x)/(1.+x);

and the incorrect computed derivative value is

dfv1(i)=dfvtmp(i)*exp(60.0)*(1./(1.+b*b));

from line 74 in adjoint function DF_dvmfexp.

The computed derivative should be

dfv1(i)=dfvtmp(i)*exp(60.0)*(1./((1.+b)*(1.+b)));
johnoel commented 5 years ago

Dave confirmed it is okay. Merged ac4072bc4671e421130c75a5e193318006b76477