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:46:04 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.
> 
> 
> Spoke to soon, Google search digs it up: 
> 
> 	http://www.bsdg.org/swag/MATH/0067.PAS.html
> 
> Yields:
> 
>  TANH := SINH(x)/COSH(x);
> 
>  SINH := (EXP(x)-EXP(-x))/2;
> 
>  COSH := (EXP(x)+EXP(-x))/2;

Ok.  Using agebraic substitution:
           sinh(x)
tanh(x) = -------
           cosh(x)


            exp(x) - exp(-x)
            ----------------
                    2
tanh(x) = ------------------
            exp(x) + exp(-x)
            ----------------
                    2

           exp(x) - exp(-x)
tanh(x) = ----------------
           exp(x) + exp(-x)


           exp(x) *( exp(x) - exp(-x) )
tanh(x) = ----------------------------
           exp(x) *( exp(x) + exp(-x) )


           exp(2x) - 1
tanh(x) = -----------
           exp(2x) + 1

I think I have it ok.


-- 

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


Mime
View raw message