ESBTanh Function |
Unit
QESBPCSMath
Declaration
Function ESBTanh(const X: Extended): Extended;
Parameters |
X | Value to process. |
Category
Arithmetic Routines for FloatsImplementation
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; |
|