cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [RT] Adaptive Caching
Date Wed, 16 Jul 2003 20:36:45 GMT
Hunsberger, Peter wrote:

> Berin Loritsch <bloritsch@apache.org> asks:
> 
>>Speaking of accademic, anyone have a Java implementation of 
>>tanh(x)?  The java.lang.Math class only has tan(x) or 
>>atan(x), but no hyperbolic function.
> 
>  
> Can't recall the details off the top of my head, but I believe you just
> need the natural log function to calculate it.  I have it buried in a
> Fortran program somewhere at home...

Here is a definition I found after googling:

http://mathworld.wolfram.com/HyperbolicTangent.html

I *think* that translates to:


     public double tanh( double z )
     {
         return (Math.exp(2 * z) - 1) / (Math.exp(2 * z) + 1);
     }



-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


Mime
View raw message