import Prelude
import Data.Typeable
+#ifdef __GLASGOW_HASKELL__
+import Data.Data (Data)
+#endif
#ifdef __HUGS__
import Hugs.Prelude(Num(fromInt), Fractional(fromDouble))
data (RealFloat a) => Complex a
= !a :+ !a -- ^ forms a complex number from its real and imaginary
-- rectangular components.
+# if __GLASGOW_HASKELL__
+ deriving (Eq, Show, Read, Data)
+# else
deriving (Eq, Show, Read)
+# endif
-- -----------------------------------------------------------------------------
-- Functions over Complex
asinh z = log (z + sqrt (1+z*z))
acosh z = log (z + (z+1) * sqrt ((z-1)/(z+1)))
- atanh z = log ((1+z) / sqrt (1-z*z))
+ atanh z = 0.5 * log ((1.0+z) / (1.0-z))