ESBTanh Function
Returns the hyperbolic tangent of X.

Unit
QESBPCSMath

Declaration
Function ESBTanh(const X: Extended): Extended;

Parameters
Value to process.

Category
Arithmetic Routines for Floats

Implementation

function ESBTanh (const X: Extended): Extended;
var
     Y, Z, InvZ: Extended;
begin
     Z := Exp (X);
     InvZ := 1 / Z;
     Y := Z + InvZ;
     if FloatIsZero (Y) then // Should never happen
          raise EMathError.Create (rsNotDefinedForValue);

     Result := (Z - InvZ) / Y;
End;


HTML generated by Time2HELP
http://www.time2help.com