{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UndecidableInstances #-}
module Numeric.DataFrame.Internal.Backend.Family.DoubleX4 (DoubleX4 (..)) where
import GHC.Base
import Numeric.DataFrame.Internal.PrimArray
import Numeric.PrimBytes
import Numeric.ProductOrd
import qualified Numeric.ProductOrd.NonTransitive as NonTransitive
import qualified Numeric.ProductOrd.Partial as Partial
data DoubleX4 = DoubleX4# Double# Double# Double# Double#
instance Bounded Double => Bounded DoubleX4 where
maxBound :: DoubleX4
maxBound = case Double
forall a. Bounded a => a
maxBound of D# Double#
x -> Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
x Double#
x Double#
x
minBound :: DoubleX4
minBound = case Double
forall a. Bounded a => a
minBound of D# Double#
x -> Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
x Double#
x Double#
x
instance Eq DoubleX4 where
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 == :: DoubleX4 -> DoubleX4 -> Bool
== DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4 =
Int# -> Bool
isTrue#
( (Double#
a1 Double# -> Double# -> Int#
==## Double#
b1)
Int# -> Int# -> Int#
`andI#` (Double#
a2 Double# -> Double# -> Int#
==## Double#
b2)
Int# -> Int# -> Int#
`andI#` (Double#
a3 Double# -> Double# -> Int#
==## Double#
b3)
Int# -> Int# -> Int#
`andI#` (Double#
a4 Double# -> Double# -> Int#
==## Double#
b4)
)
{-# INLINE (==) #-}
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 /= :: DoubleX4 -> DoubleX4 -> Bool
/= DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4 =
Int# -> Bool
isTrue#
( (Double#
a1 Double# -> Double# -> Int#
/=## Double#
b1)
Int# -> Int# -> Int#
`orI#` (Double#
a2 Double# -> Double# -> Int#
/=## Double#
b2)
Int# -> Int# -> Int#
`orI#` (Double#
a3 Double# -> Double# -> Int#
/=## Double#
b3)
Int# -> Int# -> Int#
`orI#` (Double#
a4 Double# -> Double# -> Int#
/=## Double#
b4)
)
{-# INLINE (/=) #-}
cmp' :: Double# -> Double# -> PartialOrdering
cmp' :: Double# -> Double# -> PartialOrdering
cmp' Double#
a Double#
b
| Int# -> Bool
isTrue# (Double#
a Double# -> Double# -> Int#
>## Double#
b) = PartialOrdering
PGT
| Int# -> Bool
isTrue# (Double#
a Double# -> Double# -> Int#
<## Double#
b) = PartialOrdering
PLT
| Bool
otherwise = PartialOrdering
PEQ
instance ProductOrder DoubleX4 where
cmp :: DoubleX4 -> DoubleX4 -> PartialOrdering
cmp (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4)
= Double# -> Double# -> PartialOrdering
cmp' Double#
a1 Double#
b1 PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Semigroup a => a -> a -> a
<> Double# -> Double# -> PartialOrdering
cmp' Double#
a2 Double#
b2 PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Semigroup a => a -> a -> a
<> Double# -> Double# -> PartialOrdering
cmp' Double#
a3 Double#
b3 PartialOrdering -> PartialOrdering -> PartialOrdering
forall a. Semigroup a => a -> a -> a
<> Double# -> Double# -> PartialOrdering
cmp' Double#
a4 Double#
b4
{-# INLINE cmp #-}
instance Ord (NonTransitive.ProductOrd DoubleX4) where
NonTransitive.ProductOrd DoubleX4
x > :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
> NonTransitive.ProductOrd DoubleX4
y = DoubleX4 -> DoubleX4 -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp DoubleX4
x DoubleX4
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
NonTransitive.ProductOrd DoubleX4
x < :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
< NonTransitive.ProductOrd DoubleX4
y = DoubleX4 -> DoubleX4 -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp DoubleX4
x DoubleX4
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
>= :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
(>=) (NonTransitive.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(NonTransitive.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4)) = Int# -> Bool
isTrue#
((Double#
a1 Double# -> Double# -> Int#
>=## Double#
b1) Int# -> Int# -> Int#
`andI#` (Double#
a2 Double# -> Double# -> Int#
>=## Double#
b2) Int# -> Int# -> Int#
`andI#` (Double#
a3 Double# -> Double# -> Int#
>=## Double#
b3) Int# -> Int# -> Int#
`andI#` (Double#
a4 Double# -> Double# -> Int#
>=## Double#
b4))
{-# INLINE (>=) #-}
<= :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
(<=) (NonTransitive.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(NonTransitive.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4)) = Int# -> Bool
isTrue#
((Double#
a1 Double# -> Double# -> Int#
<=## Double#
b1) Int# -> Int# -> Int#
`andI#` (Double#
a2 Double# -> Double# -> Int#
<=## Double#
b2) Int# -> Int# -> Int#
`andI#` (Double#
a3 Double# -> Double# -> Int#
<=## Double#
b3) Int# -> Int# -> Int#
`andI#` (Double#
a4 Double# -> Double# -> Int#
<=## Double#
b4))
{-# INLINE (<=) #-}
compare :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Ordering
compare (NonTransitive.ProductOrd DoubleX4
a) (NonTransitive.ProductOrd DoubleX4
b)
= PartialOrdering -> Ordering
NonTransitive.toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
$ DoubleX4 -> DoubleX4 -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp DoubleX4
a DoubleX4
b
{-# INLINE compare #-}
min :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> ProductOrd DoubleX4
min (NonTransitive.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(NonTransitive.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4))
= DoubleX4 -> ProductOrd DoubleX4
forall a. a -> ProductOrd a
NonTransitive.ProductOrd
( Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(if Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
b1) then Double#
b1 else Double#
a1)
(if Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
b2) then Double#
b2 else Double#
a2)
(if Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
b3) then Double#
b3 else Double#
a3)
(if Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
>## Double#
b4) then Double#
b4 else Double#
a4)
)
{-# INLINE min #-}
max :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> ProductOrd DoubleX4
max (NonTransitive.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(NonTransitive.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4))
= DoubleX4 -> ProductOrd DoubleX4
forall a. a -> ProductOrd a
NonTransitive.ProductOrd
( Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(if Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
b1) then Double#
b1 else Double#
a1)
(if Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
b2) then Double#
b2 else Double#
a2)
(if Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
b3) then Double#
b3 else Double#
a3)
(if Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
<## Double#
b4) then Double#
b4 else Double#
a4)
)
{-# INLINE max #-}
instance Ord (Partial.ProductOrd DoubleX4) where
Partial.ProductOrd DoubleX4
x > :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
> Partial.ProductOrd DoubleX4
y = DoubleX4 -> DoubleX4 -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp DoubleX4
x DoubleX4
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PGT
{-# INLINE (>) #-}
Partial.ProductOrd DoubleX4
x < :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
< Partial.ProductOrd DoubleX4
y = DoubleX4 -> DoubleX4 -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp DoubleX4
x DoubleX4
y PartialOrdering -> PartialOrdering -> Bool
forall a. Eq a => a -> a -> Bool
== PartialOrdering
PLT
{-# INLINE (<) #-}
>= :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
(>=) (Partial.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(Partial.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4)) = Int# -> Bool
isTrue#
((Double#
a1 Double# -> Double# -> Int#
>=## Double#
b1) Int# -> Int# -> Int#
`andI#` (Double#
a2 Double# -> Double# -> Int#
>=## Double#
b2) Int# -> Int# -> Int#
`andI#` (Double#
a3 Double# -> Double# -> Int#
>=## Double#
b3) Int# -> Int# -> Int#
`andI#` (Double#
a4 Double# -> Double# -> Int#
>=## Double#
b4))
{-# INLINE (>=) #-}
<= :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Bool
(<=) (Partial.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(Partial.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4)) = Int# -> Bool
isTrue#
((Double#
a1 Double# -> Double# -> Int#
<=## Double#
b1) Int# -> Int# -> Int#
`andI#` (Double#
a2 Double# -> Double# -> Int#
<=## Double#
b2) Int# -> Int# -> Int#
`andI#` (Double#
a3 Double# -> Double# -> Int#
<=## Double#
b3) Int# -> Int# -> Int#
`andI#` (Double#
a4 Double# -> Double# -> Int#
<=## Double#
b4))
{-# INLINE (<=) #-}
compare :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> Ordering
compare (Partial.ProductOrd DoubleX4
a) (Partial.ProductOrd DoubleX4
b)
= PartialOrdering -> Ordering
Partial.toOrdering (PartialOrdering -> Ordering) -> PartialOrdering -> Ordering
forall a b. (a -> b) -> a -> b
$ DoubleX4 -> DoubleX4 -> PartialOrdering
forall a. ProductOrder a => a -> a -> PartialOrdering
cmp DoubleX4
a DoubleX4
b
{-# INLINE compare #-}
min :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> ProductOrd DoubleX4
min (Partial.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(Partial.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4))
= DoubleX4 -> ProductOrd DoubleX4
forall a. a -> ProductOrd a
Partial.ProductOrd
( Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(if Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
b1) then Double#
b1 else Double#
a1)
(if Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
b2) then Double#
b2 else Double#
a2)
(if Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
b3) then Double#
b3 else Double#
a3)
(if Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
>## Double#
b4) then Double#
b4 else Double#
a4)
)
{-# INLINE min #-}
max :: ProductOrd DoubleX4 -> ProductOrd DoubleX4 -> ProductOrd DoubleX4
max (Partial.ProductOrd (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4))
(Partial.ProductOrd (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4))
= DoubleX4 -> ProductOrd DoubleX4
forall a. a -> ProductOrd a
Partial.ProductOrd
( Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(if Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
b1) then Double#
b1 else Double#
a1)
(if Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
b2) then Double#
b2 else Double#
a2)
(if Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
b3) then Double#
b3 else Double#
a3)
(if Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
<## Double#
b4) then Double#
b4 else Double#
a4)
)
{-# INLINE max #-}
instance Ord DoubleX4 where
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 > :: DoubleX4 -> DoubleX4 -> Bool
> DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
b1) = Bool
True
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
b1) = Bool
False
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
b2) = Bool
True
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
b2) = Bool
False
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
b3) = Bool
True
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
b3) = Bool
False
| Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
>## Double#
b4) = Bool
True
| Bool
otherwise = Bool
False
{-# INLINE (>) #-}
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 < :: DoubleX4 -> DoubleX4 -> Bool
< DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
b1) = Bool
True
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
b1) = Bool
False
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
b2) = Bool
True
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
b2) = Bool
False
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
b3) = Bool
True
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
b3) = Bool
False
| Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
<## Double#
b4) = Bool
True
| Bool
otherwise = Bool
False
{-# INLINE (<) #-}
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 >= :: DoubleX4 -> DoubleX4 -> Bool
>= DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
b1) = Bool
False
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
b1) = Bool
True
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
b2) = Bool
False
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
b2) = Bool
True
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
b3) = Bool
False
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
b3) = Bool
True
| Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
<## Double#
b4) = Bool
False
| Bool
otherwise = Bool
True
{-# INLINE (>=) #-}
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 <= :: DoubleX4 -> DoubleX4 -> Bool
<= DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
b1) = Bool
False
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
b1) = Bool
True
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
b2) = Bool
False
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
b2) = Bool
True
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
b3) = Bool
False
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
b3) = Bool
True
| Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
>## Double#
b4) = Bool
False
| Bool
otherwise = Bool
True
{-# INLINE (<=) #-}
compare :: DoubleX4 -> DoubleX4 -> Ordering
compare (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) (DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4)
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
b1) = Ordering
GT
| Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
b1) = Ordering
LT
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
b2) = Ordering
GT
| Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
b2) = Ordering
LT
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
b3) = Ordering
GT
| Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
b3) = Ordering
LT
| Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
>## Double#
b4) = Ordering
GT
| Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
<## Double#
b4) = Ordering
LT
| Bool
otherwise = Ordering
EQ
{-# INLINE compare #-}
instance Num DoubleX4 where
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 + :: DoubleX4 -> DoubleX4 -> DoubleX4
+ DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4
= Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# (Double# -> Double# -> Double#
(+##) Double#
a1 Double#
b1) (Double# -> Double# -> Double#
(+##) Double#
a2 Double#
b2) (Double# -> Double# -> Double#
(+##) Double#
a3 Double#
b3) (Double# -> Double# -> Double#
(+##) Double#
a4 Double#
b4)
{-# INLINE (+) #-}
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 - :: DoubleX4 -> DoubleX4 -> DoubleX4
- DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4
= Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# (Double# -> Double# -> Double#
(-##) Double#
a1 Double#
b1) (Double# -> Double# -> Double#
(-##) Double#
a2 Double#
b2) (Double# -> Double# -> Double#
(-##) Double#
a3 Double#
b3) (Double# -> Double# -> Double#
(-##) Double#
a4 Double#
b4)
{-# INLINE (-) #-}
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 * :: DoubleX4 -> DoubleX4 -> DoubleX4
* DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4
= Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# (Double# -> Double# -> Double#
(*##) Double#
a1 Double#
b1) (Double# -> Double# -> Double#
(*##) Double#
a2 Double#
b2) (Double# -> Double# -> Double#
(*##) Double#
a3 Double#
b3) (Double# -> Double# -> Double#
(*##) Double#
a4 Double#
b4)
{-# INLINE (*) #-}
negate :: DoubleX4 -> DoubleX4
negate (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
negateDouble# Double#
a1) (Double# -> Double#
negateDouble# Double#
a2) (Double# -> Double#
negateDouble# Double#
a3) (Double# -> Double#
negateDouble# Double#
a4)
{-# INLINE negate #-}
abs :: DoubleX4 -> DoubleX4
abs (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4)
= Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(if Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>=## Double#
0.0##) then Double#
a1 else Double# -> Double#
negateDouble# Double#
a1)
(if Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>=## Double#
0.0##) then Double#
a2 else Double# -> Double#
negateDouble# Double#
a2)
(if Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>=## Double#
0.0##) then Double#
a3 else Double# -> Double#
negateDouble# Double#
a3)
(if Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
>=## Double#
0.0##) then Double#
a4 else Double# -> Double#
negateDouble# Double#
a4)
{-# INLINE abs #-}
signum :: DoubleX4 -> DoubleX4
signum (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4)
= Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# (if Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
>## Double#
0.0##)
then Double#
1.0##
else if Int# -> Bool
isTrue# (Double#
a1 Double# -> Double# -> Int#
<## Double#
0.0##) then Double#
-1.0## else Double#
0.0## )
(if Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
>## Double#
0.0##)
then Double#
1.0##
else if Int# -> Bool
isTrue# (Double#
a2 Double# -> Double# -> Int#
<## Double#
0.0##) then Double#
-1.0## else Double#
0.0## )
(if Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
>## Double#
0.0##)
then Double#
1.0##
else if Int# -> Bool
isTrue# (Double#
a3 Double# -> Double# -> Int#
<## Double#
0.0##) then Double#
-1.0## else Double#
0.0## )
(if Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
>## Double#
0.0##)
then Double#
1.0##
else if Int# -> Bool
isTrue# (Double#
a4 Double# -> Double# -> Int#
<## Double#
0.0##) then Double#
-1.0## else Double#
0.0## )
{-# INLINE signum #-}
fromInteger :: Integer -> DoubleX4
fromInteger Integer
n = case Integer -> Double
forall a. Num a => Integer -> a
fromInteger Integer
n of D# Double#
x -> Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
x Double#
x Double#
x
{-# INLINE fromInteger #-}
instance Fractional DoubleX4 where
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 / :: DoubleX4 -> DoubleX4 -> DoubleX4
/ DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4 = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double# -> Double#
(/##) Double#
a1 Double#
b1) (Double# -> Double# -> Double#
(/##) Double#
a2 Double#
b2) (Double# -> Double# -> Double#
(/##) Double#
a3 Double#
b3) (Double# -> Double# -> Double#
(/##) Double#
a4 Double#
b4)
{-# INLINE (/) #-}
recip :: DoubleX4 -> DoubleX4
recip (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double# -> Double#
(/##) Double#
1.0## Double#
a1) (Double# -> Double# -> Double#
(/##) Double#
1.0## Double#
a2) (Double# -> Double# -> Double#
(/##) Double#
1.0## Double#
a3) (Double# -> Double# -> Double#
(/##) Double#
1.0## Double#
a4)
{-# INLINE recip #-}
fromRational :: Rational -> DoubleX4
fromRational Rational
r = case Rational -> Double
forall a. Fractional a => Rational -> a
fromRational Rational
r of D# Double#
x -> Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
x Double#
x Double#
x
{-# INLINE fromRational #-}
instance Floating DoubleX4 where
pi :: DoubleX4
pi = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
Double#
3.141592653589793238##
Double#
3.141592653589793238##
Double#
3.141592653589793238##
Double#
3.141592653589793238##
{-# INLINE pi #-}
exp :: DoubleX4 -> DoubleX4
exp (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
expDouble# Double#
a1) (Double# -> Double#
expDouble# Double#
a2) (Double# -> Double#
expDouble# Double#
a3) (Double# -> Double#
expDouble# Double#
a4)
{-# INLINE exp #-}
log :: DoubleX4 -> DoubleX4
log (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
logDouble# Double#
a1) (Double# -> Double#
logDouble# Double#
a2) (Double# -> Double#
logDouble# Double#
a3) (Double# -> Double#
logDouble# Double#
a4)
{-# INLINE log #-}
sqrt :: DoubleX4 -> DoubleX4
sqrt (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
sqrtDouble# Double#
a1) (Double# -> Double#
sqrtDouble# Double#
a2) (Double# -> Double#
sqrtDouble# Double#
a3) (Double# -> Double#
sqrtDouble# Double#
a4)
{-# INLINE sqrt #-}
sin :: DoubleX4 -> DoubleX4
sin (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
sinDouble# Double#
a1) (Double# -> Double#
sinDouble# Double#
a2) (Double# -> Double#
sinDouble# Double#
a3) (Double# -> Double#
sinDouble# Double#
a4)
{-# INLINE sin #-}
cos :: DoubleX4 -> DoubleX4
cos (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
cosDouble# Double#
a1) (Double# -> Double#
cosDouble# Double#
a2) (Double# -> Double#
cosDouble# Double#
a3) (Double# -> Double#
cosDouble# Double#
a4)
{-# INLINE cos #-}
tan :: DoubleX4 -> DoubleX4
tan (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
tanDouble# Double#
a1) (Double# -> Double#
tanDouble# Double#
a2) (Double# -> Double#
tanDouble# Double#
a3) (Double# -> Double#
tanDouble# Double#
a4)
{-# INLINE tan #-}
asin :: DoubleX4 -> DoubleX4
asin (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
asinDouble# Double#
a1) (Double# -> Double#
asinDouble# Double#
a2) (Double# -> Double#
asinDouble# Double#
a3) (Double# -> Double#
asinDouble# Double#
a4)
{-# INLINE asin #-}
acos :: DoubleX4 -> DoubleX4
acos (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
acosDouble# Double#
a1) (Double# -> Double#
acosDouble# Double#
a2) (Double# -> Double#
acosDouble# Double#
a3) (Double# -> Double#
acosDouble# Double#
a4)
{-# INLINE acos #-}
atan :: DoubleX4 -> DoubleX4
atan (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
atanDouble# Double#
a1) (Double# -> Double#
atanDouble# Double#
a2) (Double# -> Double#
atanDouble# Double#
a3) (Double# -> Double#
atanDouble# Double#
a4)
{-# INLINE atan #-}
sinh :: DoubleX4 -> DoubleX4
sinh (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
sinhDouble# Double#
a1) (Double# -> Double#
sinhDouble# Double#
a2) (Double# -> Double#
sinhDouble# Double#
a3) (Double# -> Double#
sinhDouble# Double#
a4)
{-# INLINE sinh #-}
cosh :: DoubleX4 -> DoubleX4
cosh (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
coshDouble# Double#
a1) (Double# -> Double#
coshDouble# Double#
a2) (Double# -> Double#
coshDouble# Double#
a3) (Double# -> Double#
coshDouble# Double#
a4)
{-# INLINE cosh #-}
tanh :: DoubleX4 -> DoubleX4
tanh (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double#
tanhDouble# Double#
a1) (Double# -> Double#
tanhDouble# Double#
a2) (Double# -> Double#
tanhDouble# Double#
a3) (Double# -> Double#
tanhDouble# Double#
a4)
{-# INLINE tanh #-}
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 ** :: DoubleX4 -> DoubleX4 -> DoubleX4
** DoubleX4# Double#
b1 Double#
b2 Double#
b3 Double#
b4 = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(Double# -> Double# -> Double#
(**##) Double#
a1 Double#
b1) (Double# -> Double# -> Double#
(**##) Double#
a2 Double#
b2) (Double# -> Double# -> Double#
(**##) Double#
a3 Double#
b3) (Double# -> Double# -> Double#
(**##) Double#
a4 Double#
b4)
{-# INLINE (**) #-}
logBase :: DoubleX4 -> DoubleX4 -> DoubleX4
logBase DoubleX4
x DoubleX4
y = DoubleX4 -> DoubleX4
forall a. Floating a => a -> a
log DoubleX4
y DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Fractional a => a -> a -> a
/ DoubleX4 -> DoubleX4
forall a. Floating a => a -> a
log DoubleX4
x
{-# INLINE logBase #-}
asinh :: DoubleX4 -> DoubleX4
asinh DoubleX4
x = DoubleX4 -> DoubleX4
forall a. Floating a => a -> a
log (DoubleX4
x DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
+ DoubleX4 -> DoubleX4
forall a. Floating a => a -> a
sqrt (DoubleX4
1.0DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
+DoubleX4
xDoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
*DoubleX4
x))
{-# INLINE asinh #-}
acosh :: DoubleX4 -> DoubleX4
acosh DoubleX4
x = DoubleX4 -> DoubleX4
forall a. Floating a => a -> a
log (DoubleX4
x DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
+ (DoubleX4
xDoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
+DoubleX4
1.0) DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
* DoubleX4 -> DoubleX4
forall a. Floating a => a -> a
sqrt ((DoubleX4
xDoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
-DoubleX4
1.0)DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Fractional a => a -> a -> a
/(DoubleX4
xDoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
+DoubleX4
1.0)))
{-# INLINE acosh #-}
atanh :: DoubleX4 -> DoubleX4
atanh DoubleX4
x = DoubleX4
0.5 DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
* DoubleX4 -> DoubleX4
forall a. Floating a => a -> a
log ((DoubleX4
1.0DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
+DoubleX4
x) DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Fractional a => a -> a -> a
/ (DoubleX4
1.0DoubleX4 -> DoubleX4 -> DoubleX4
forall a. Num a => a -> a -> a
-DoubleX4
x))
{-# INLINE atanh #-}
#define BOFF_TO_PRIMOFF(off) uncheckedIShiftRL# off 3#
#define ELEM_N 4
instance PrimBytes DoubleX4 where
getBytes :: DoubleX4 -> ByteArray#
getBytes (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) = case (State# RealWorld -> (# State# RealWorld, ByteArray# #))
-> (# State# RealWorld, ByteArray# #)
forall o. (State# RealWorld -> o) -> o
runRW#
( \State# RealWorld
s0 -> case Int#
-> State# RealWorld
-> (# State# RealWorld, MutableByteArray# RealWorld #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# (DoubleX4 -> Int#
forall a. PrimBytes a => a -> Int#
byteSize @DoubleX4 DoubleX4
forall a. HasCallStack => a
undefined) State# RealWorld
s0 of
(# State# RealWorld
s1, MutableByteArray# RealWorld
marr #) -> case MutableByteArray# RealWorld
-> Int# -> Double# -> State# RealWorld -> State# RealWorld
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# RealWorld
marr Int#
0# Double#
a1 State# RealWorld
s1 of
State# RealWorld
s2 -> case MutableByteArray# RealWorld
-> Int# -> Double# -> State# RealWorld -> State# RealWorld
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# RealWorld
marr Int#
1# Double#
a2 State# RealWorld
s2 of
State# RealWorld
s3 -> case MutableByteArray# RealWorld
-> Int# -> Double# -> State# RealWorld -> State# RealWorld
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# RealWorld
marr Int#
2# Double#
a3 State# RealWorld
s3 of
State# RealWorld
s4 -> case MutableByteArray# RealWorld
-> Int# -> Double# -> State# RealWorld -> State# RealWorld
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# RealWorld
marr Int#
3# Double#
a4 State# RealWorld
s4 of
State# RealWorld
s5 -> MutableByteArray# RealWorld
-> State# RealWorld -> (# State# RealWorld, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# RealWorld
marr State# RealWorld
s5
) of (# State# RealWorld
_, ByteArray#
a #) -> ByteArray#
a
{-# INLINE getBytes #-}
fromBytes :: Int# -> ByteArray# -> DoubleX4
fromBytes Int#
off ByteArray#
arr
| Int#
i <- BOFF_TO_PRIMOFF(off)
= Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
arr Int#
i)
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
arr (Int#
i Int# -> Int# -> Int#
+# Int#
1#))
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
arr (Int#
i Int# -> Int# -> Int#
+# Int#
2#))
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
arr (Int#
i Int# -> Int# -> Int#
+# Int#
3#))
{-# INLINE fromBytes #-}
readBytes :: MutableByteArray# s -> Int# -> State# s -> (# State# s, DoubleX4 #)
readBytes MutableByteArray# s
mba Int#
off State# s
s0
| Int#
i <- BOFF_TO_PRIMOFF(off)
= case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba Int#
i State# s
s0 of
(# State# s
s1, Double#
a1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
1#) State# s
s1 of
(# State# s
s2, Double#
a2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
2#) State# s
s2 of
(# State# s
s3, Double#
a3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
3#) State# s
s3 of
(# State# s
s4, Double#
a4 #) -> (# State# s
s4, Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 #)
{-# INLINE readBytes #-}
writeBytes :: MutableByteArray# s -> Int# -> DoubleX4 -> State# s -> State# s
writeBytes MutableByteArray# s
mba Int#
off (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) State# s
s
| Int#
i <- BOFF_TO_PRIMOFF(off)
= MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
3#) Double#
a4
( MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
2#) Double#
a3
( MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
1#) Double#
a2
( MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba Int#
i Double#
a1 State# s
s )))
{-# INLINE writeBytes #-}
readAddr :: Addr# -> State# s -> (# State# s, DoubleX4 #)
readAddr Addr#
addr State# s
s0
= case Addr# -> Int# -> State# s -> (# State# s, Double# #)
forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
readDoubleOffAddr# Addr#
addr Int#
0# State# s
s0 of
(# State# s
s1, Double#
a1 #) -> case Addr# -> Int# -> State# s -> (# State# s, Double# #)
forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
readDoubleOffAddr# Addr#
addr Int#
1# State# s
s1 of
(# State# s
s2, Double#
a2 #) -> case Addr# -> Int# -> State# s -> (# State# s, Double# #)
forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
readDoubleOffAddr# Addr#
addr Int#
2# State# s
s2 of
(# State# s
s3, Double#
a3 #) -> case Addr# -> Int# -> State# s -> (# State# s, Double# #)
forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
readDoubleOffAddr# Addr#
addr Int#
3# State# s
s3 of
(# State# s
s4, Double#
a4 #) -> (# State# s
s4, Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 #)
{-# INLINE readAddr #-}
writeAddr :: DoubleX4 -> Addr# -> State# s -> State# s
writeAddr (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) Addr#
addr State# s
s
= Addr# -> Int# -> Double# -> State# s -> State# s
forall d. Addr# -> Int# -> Double# -> State# d -> State# d
writeDoubleOffAddr# Addr#
addr Int#
3# Double#
a4
( Addr# -> Int# -> Double# -> State# s -> State# s
forall d. Addr# -> Int# -> Double# -> State# d -> State# d
writeDoubleOffAddr# Addr#
addr Int#
2# Double#
a3
( Addr# -> Int# -> Double# -> State# s -> State# s
forall d. Addr# -> Int# -> Double# -> State# d -> State# d
writeDoubleOffAddr# Addr#
addr Int#
1# Double#
a2
( Addr# -> Int# -> Double# -> State# s -> State# s
forall d. Addr# -> Int# -> Double# -> State# d -> State# d
writeDoubleOffAddr# Addr#
addr Int#
0# Double#
a1 State# s
s )))
{-# INLINE writeAddr #-}
byteSize :: DoubleX4 -> Int#
byteSize DoubleX4
_ = Double -> Int#
forall a. PrimBytes a => a -> Int#
byteSize @Double Double
forall a. HasCallStack => a
undefined Int# -> Int# -> Int#
*# ELEM_N#
{-# INLINE byteSize #-}
byteAlign :: DoubleX4 -> Int#
byteAlign DoubleX4
_ = Double -> Int#
forall a. PrimBytes a => a -> Int#
byteAlign @Double Double
forall a. HasCallStack => a
undefined
{-# INLINE byteAlign #-}
byteOffset :: DoubleX4 -> Int#
byteOffset DoubleX4
_ = Int#
0#
{-# INLINE byteOffset #-}
byteFieldOffset :: Proxy# name -> DoubleX4 -> Int#
byteFieldOffset Proxy# name
_ DoubleX4
_ = Int# -> Int#
negateInt# Int#
1#
{-# INLINE byteFieldOffset #-}
indexArray :: ByteArray# -> Int# -> DoubleX4
indexArray ByteArray#
ba Int#
off
| Int#
i <- Int#
off Int# -> Int# -> Int#
*# ELEM_N#
= Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba Int#
i)
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba (Int#
i Int# -> Int# -> Int#
+# Int#
1#))
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba (Int#
i Int# -> Int# -> Int#
+# Int#
2#))
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba (Int#
i Int# -> Int# -> Int#
+# Int#
3#))
{-# INLINE indexArray #-}
readArray :: MutableByteArray# s -> Int# -> State# s -> (# State# s, DoubleX4 #)
readArray MutableByteArray# s
mba Int#
off State# s
s0
| Int#
i <- Int#
off Int# -> Int# -> Int#
*# ELEM_N#
= case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba Int#
i State# s
s0 of
(# State# s
s1, Double#
a1 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
1#) State# s
s1 of
(# State# s
s2, Double#
a2 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
2#) State# s
s2 of
(# State# s
s3, Double#
a3 #) -> case MutableByteArray# s -> Int# -> State# s -> (# State# s, Double# #)
forall d.
MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
readDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
3#) State# s
s3 of
(# State# s
s4, Double#
a4 #) -> (# State# s
s4, Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 #)
{-# INLINE readArray #-}
writeArray :: MutableByteArray# s -> Int# -> DoubleX4 -> State# s -> State# s
writeArray MutableByteArray# s
mba Int#
off (DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4) State# s
s
| Int#
i <- Int#
off Int# -> Int# -> Int#
*# ELEM_N#
= MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
3#) Double#
a4
( MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
2#) Double#
a3
( MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba (Int#
i Int# -> Int# -> Int#
+# Int#
1#) Double#
a2
( MutableByteArray# s -> Int# -> Double# -> State# s -> State# s
forall d.
MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
writeDoubleArray# MutableByteArray# s
mba Int#
i Double#
a1 State# s
s )))
{-# INLINE writeArray #-}
instance PrimArray Double DoubleX4 where
broadcast# :: Double -> DoubleX4
broadcast# (D# Double#
x) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
x Double#
x Double#
x
{-# INLINE broadcast# #-}
ix# :: Int# -> DoubleX4 -> Double
ix# Int#
0# (DoubleX4# Double#
a1 Double#
_ Double#
_ Double#
_) = Double# -> Double
D# Double#
a1
ix# Int#
1# (DoubleX4# Double#
_ Double#
a2 Double#
_ Double#
_) = Double# -> Double
D# Double#
a2
ix# Int#
2# (DoubleX4# Double#
_ Double#
_ Double#
a3 Double#
_) = Double# -> Double
D# Double#
a3
ix# Int#
3# (DoubleX4# Double#
_ Double#
_ Double#
_ Double#
a4) = Double# -> Double
D# Double#
a4
ix# Int#
_ DoubleX4
_ = Double
forall a. HasCallStack => a
undefined
{-# INLINE ix# #-}
gen# :: CumulDims -> (s -> (# s, Double #)) -> s -> (# s, DoubleX4 #)
gen# CumulDims
_ s -> (# s, Double #)
f s
s0 = case s -> (# s, Double #)
f s
s0 of
(# s
s1, D# Double#
a1 #) -> case s -> (# s, Double #)
f s
s1 of
(# s
s2, D# Double#
a2 #) -> case s -> (# s, Double #)
f s
s2 of
(# s
s3, D# Double#
a3 #) -> case s -> (# s, Double #)
f s
s3 of
(# s
s4, D# Double#
a4 #) -> (# s
s4, Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
a1 Double#
a2 Double#
a3 Double#
a4 #)
upd# :: CumulDims -> Int# -> Double -> DoubleX4 -> DoubleX4
upd# CumulDims
_ Int#
0# (D# Double#
q) (DoubleX4# Double#
_ Double#
y Double#
z Double#
w) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
q Double#
y Double#
z Double#
w
upd# CumulDims
_ Int#
1# (D# Double#
q) (DoubleX4# Double#
x Double#
_ Double#
z Double#
w) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
q Double#
z Double#
w
upd# CumulDims
_ Int#
2# (D# Double#
q) (DoubleX4# Double#
x Double#
y Double#
_ Double#
w) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
y Double#
q Double#
w
upd# CumulDims
_ Int#
3# (D# Double#
q) (DoubleX4# Double#
x Double#
y Double#
z Double#
_) = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4# Double#
x Double#
y Double#
z Double#
q
upd# CumulDims
_ Int#
_ Double
_ DoubleX4
x = DoubleX4
x
{-# INLINE upd# #-}
withArrayContent# :: (Double -> r)
-> (CumulDims -> Int# -> ByteArray# -> r) -> DoubleX4 -> r
withArrayContent# Double -> r
_ CumulDims -> Int# -> ByteArray# -> r
g DoubleX4
x = CumulDims -> Int# -> ByteArray# -> r
g ([Word] -> CumulDims
CumulDims [ELEM_N, 1]) 0# (getBytes x)
{-# INLINE withArrayContent# #-}
offsetElems :: DoubleX4 -> Int#
offsetElems DoubleX4
_ = Int#
0#
{-# INLINE offsetElems #-}
uniqueOrCumulDims :: DoubleX4 -> Either Double CumulDims
uniqueOrCumulDims DoubleX4
_ = CumulDims -> Either Double CumulDims
forall a b. b -> Either a b
Right ([Word] -> CumulDims
CumulDims [ELEM_N, 1])
{-# INLINE uniqueOrCumulDims #-}
fromElems# :: CumulDims -> Int# -> ByteArray# -> DoubleX4
fromElems# CumulDims
_ Int#
off ByteArray#
ba = Double# -> Double# -> Double# -> Double# -> DoubleX4
DoubleX4#
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba Int#
off)
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba (Int#
off Int# -> Int# -> Int#
+# Int#
1#))
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba (Int#
off Int# -> Int# -> Int#
+# Int#
2#))
(ByteArray# -> Int# -> Double#
indexDoubleArray# ByteArray#
ba (Int#
off Int# -> Int# -> Int#
+# Int#
3#))
{-# INLINE fromElems# #-}