[CppAD] Automatic differentiation of tanh fails for some values

Brad Bell bradbell at seanet.com
Thu Jul 28 10:15:09 EDT 2011


The tan and tanh functions have been converted to CppAD atomic 
functions; see the heading 07-27 in
     http://www.coin-or.org/CppAD/Doc/whats_new_11.xml#07-27
This seems to have fixed the problem.

On 7/12/2011 10:37 AM, Srikrishnan Ramadurai wrote:
> Hi,
>
> I am trying to find the jacobian for a function that has a few tanh
> functions in it . I've noticed that the differentiation of tanh function
> fails for some arguments.
>
> A test example  is y=tanh(c*x1)+x2
>
> The Jacobian of y is obtained when c is small say 20, but fails with an
> error when c is something like 100. This is using the driver function
> Jacobian.
>
> This is the error that I receive.
>
> cppad-20110711 error from a known source:
> y_p = f.Forward(p, x_p): has a nan in y_p for p = 0.
> Error detected by false result for
>      false
>
> Is there something that I need to do to make the differentiation work? Any
> help is appreciated.
>
> The sample code in c++ is attached. The system is a intel core 2 quad
> machine running on 64 bit ubuntu 10.04.
>
> Thanks.
>
> Regards
> Srikrishnan
>
>
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/cppad/attachments/20110728/35792963/attachment.html 


More information about the CppAD mailing list