-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | double-double and quad-double number type via libqd -- -- This package supports both a double-double datatype (approx. 32 -- decimal digits) and a quad-double datatype (approx. 64 decimal -- digits), using libqd (which is implemented in C++ with C and Fortran -- wrappers). To compile this package you need libqd to be installed. -- -- Numeric.QD.DoubleDouble.DoubleDouble and -- Numeric.QD.QuadDouble.QuadDouble are strict tuples of -- CDoubles, with the following instances: -- --
Eq
Floating
Fractional
Num
Ord
Real
RealFloat
RealFrac
Show
Storable
properFraction
truncate
round
decodeFloat
encodeFloat
exponent
significand
-- import Foreign (nullPtr) -- import GHC.Conc (forkOnIO, numCapabilities) -- import Numeric.QD.FPU.Raw (fpu_fix_start) -- main :: IO () -- main = do -- mapM_ (flip forkOnIO $ fpu_fix_start nullPtr) [ 0 .. numCapabilities - 1 ] -- -- ... --@package qd @version 0.2 module Numeric.QD.QuadDouble.Raw c_qd_add :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_add_dd_qd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_add_qd_dd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_add_d_qd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_add_qd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_qd_selfadd :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfadd_dd :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfadd_d :: CDouble -> Ptr CDouble -> IO () c_qd_sub :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_sub_dd_qd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_sub_qd_dd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_sub_d_qd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_sub_qd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_qd_selfsub :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfsub_dd :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfsub_d :: CDouble -> Ptr CDouble -> IO () c_qd_mul :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_mul_dd_qd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_mul_qd_dd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_mul_d_qd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_mul_qd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_qd_selfmul :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfmul_dd :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfmul_d :: CDouble -> Ptr CDouble -> IO () c_qd_div :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_div_dd_qd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_div_qd_dd :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_div_d_qd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_div_qd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_qd_selfdiv :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfdiv_dd :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_selfdiv_d :: CDouble -> Ptr CDouble -> IO () c_qd_copy :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_copy_dd :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_copy_d :: CDouble -> Ptr CDouble -> IO () c_qd_sqrt :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_sqr :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_abs :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_npwr :: Ptr CDouble -> CInt -> Ptr CDouble -> IO () c_qd_nroot :: Ptr CDouble -> CInt -> Ptr CDouble -> IO () c_qd_nint :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_aint :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_floor :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_ceil :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_exp :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_log :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_log10 :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_sin :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_cos :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_tan :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_asin :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_acos :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_atan :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_atan2 :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_sinh :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_cosh :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_tanh :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_asinh :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_acosh :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_atanh :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_sincos :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_sincosh :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_qd_read :: Ptr CChar -> Ptr CDouble -> IO () c_qd_swrite :: Ptr CDouble -> CInt -> Ptr CChar -> CInt -> IO () c_qd_neg :: Ptr CDouble -> Ptr CDouble -> IO () c_qd_comp :: Ptr CDouble -> Ptr CDouble -> Ptr CInt -> IO () c_qd_comp_qd_d :: Ptr CDouble -> CDouble -> Ptr CInt -> IO () c_qd_comp_d_qd :: CDouble -> Ptr CDouble -> Ptr CInt -> IO () c_qd_pi :: Ptr CDouble -> IO () c_qd_write :: Ptr CDouble -> IO () c_qd_rand :: Ptr CDouble -> IO () module Numeric.QD.FPU.Raw fpu_fix_start :: Ptr CInt -> IO () fpu_fix_end :: Ptr CInt -> IO () module Numeric.QD.DoubleDouble.Raw c_dd_add :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_add_d_dd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_add_dd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_dd_sub :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_sub_d_dd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_sub_dd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_dd_mul :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_mul_d_dd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_mul_dd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_dd_div :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_div_d_dd :: CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_div_dd_d :: Ptr CDouble -> CDouble -> Ptr CDouble -> IO () c_dd_copy :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_copy_d :: CDouble -> Ptr CDouble -> IO () c_dd_sqrt :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_sqr :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_abs :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_npwr :: Ptr CDouble -> CInt -> Ptr CDouble -> IO () c_dd_nroot :: Ptr CDouble -> CInt -> Ptr CDouble -> IO () c_dd_nint :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_aint :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_floor :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_ceil :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_exp :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_log :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_log10 :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_sin :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_cos :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_tan :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_asin :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_acos :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_atan :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_atan2 :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_sinh :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_cosh :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_tanh :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_asinh :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_acosh :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_atanh :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_sincos :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_sincosh :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO () c_dd_read :: Ptr CChar -> Ptr CDouble -> IO () c_dd_swrite :: Ptr CDouble -> CInt -> Ptr CChar -> CInt -> IO () c_dd_neg :: Ptr CDouble -> Ptr CDouble -> IO () c_dd_comp :: Ptr CDouble -> Ptr CDouble -> Ptr CInt -> IO () c_dd_comp_dd_d :: Ptr CDouble -> CDouble -> Ptr CInt -> IO () c_dd_comp_d_dd :: CDouble -> Ptr CDouble -> Ptr CInt -> IO () c_dd_pi :: Ptr CDouble -> IO () c_dd_write :: Ptr CDouble -> IO () c_dd_rand :: Ptr CDouble -> IO () module Numeric.QD.Bits.Raw get_double_expn :: CDouble -> IO CInt module Numeric.QD.Raw module Numeric.QD.FPU -- | unsafePreservingFPU f executes the computation -- f, ensuring that the FPU control words are set to avoid -- problems from excess precision. See the libqd documentation for -- further details. -- -- This function is unsafe in a threaded runtime as Haskell threads can -- migrate between OS threads, moreover there is no checking for nested -- calls which results in race conditions. -- -- Some steps can be taken to mitigate some of this badness; perhaps -- using (for example) GHC.Conc.forkOnIO might help. unsafePreservingFPU :: IO a -> IO a module Numeric.QD.DoubleDouble data DoubleDouble DoubleDouble :: !!CDouble -> !!CDouble -> DoubleDouble toDouble :: DoubleDouble -> Double fromDouble :: Double -> DoubleDouble sqr :: DoubleDouble -> DoubleDouble instance Typeable DoubleDouble instance Storable DoubleDouble instance RealFloat DoubleDouble instance Floating DoubleDouble instance RealFrac DoubleDouble instance Real DoubleDouble instance Fractional DoubleDouble instance Num DoubleDouble instance Show DoubleDouble instance Ord DoubleDouble instance Eq DoubleDouble module Numeric.QD.QuadDouble data QuadDouble QuadDouble :: !!CDouble -> !!CDouble -> !!CDouble -> !!CDouble -> QuadDouble toDouble :: QuadDouble -> Double fromDouble :: Double -> QuadDouble toDoubleDouble :: QuadDouble -> DoubleDouble fromDoubleDouble :: DoubleDouble -> QuadDouble sqr :: QuadDouble -> QuadDouble instance Typeable QuadDouble instance Storable QuadDouble instance RealFloat QuadDouble instance Floating QuadDouble instance RealFrac QuadDouble instance Real QuadDouble instance Fractional QuadDouble instance Num QuadDouble instance Show QuadDouble instance Ord QuadDouble instance Eq QuadDouble module Numeric.QD.Bits module Numeric.QD