<div class="gmail_quote">Hi,<div><br></div><div>I am trying to find the jacobian for a function that has a few tanh functions in it . I&#39;ve noticed that the differentiation of tanh function fails for some arguments.</div>

<div><br></div><div>A test example  is y=tanh(c*x1)+x2</div>
<div><br></div><div>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.</div><div><br></div><div>This is the error that I receive.</div>


<div><br></div><div><div>cppad-20110711 error from a known source:</div><div>y_p = f.Forward(p, x_p): has a nan in y_p for p = 0.</div><div>Error detected by false result for</div><div>    false</div></div><div><br></div>


<div>Is there something that I need to do to make the differentiation work? Any help is appreciated.</div><div><br></div><div>The sample code in c++ is attached. The system is a intel core 2 quad machine running on 64 bit ubuntu 10.04.</div>


<div><br></div><div>Thanks.</div><div><br></div><div>Regards</div><div>Srikrishnan</div>
</div><br>