{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Numeric.Rounded.Hardware.Vector.Unboxed
( roundedSum
, zipWith_roundedAdd
, zipWith_roundedSub
, zipWith_roundedMul
, zipWith3_roundedFusedMultiplyAdd
, zipWith_roundedDiv
, map_roundedSqrt
, sum
, zipWith_add
, zipWith_sub
, zipWith_mul
, zipWith3_fusedMultiplyAdd
, zipWith_div
, map_sqrt
) where
import Data.Coerce
import Data.Proxy
import qualified Data.Vector.Unboxed as VU
import Numeric.Rounded.Hardware.Internal
import Prelude hiding (sum)
sum :: forall r a. (Rounding r, VU.Unbox a, RoundedRing_Vector VU.Vector a) => VU.Vector (Rounded r a) -> Rounded r a
sum :: forall (r :: RoundingMode) a.
(Rounding r, Unbox a, RoundedRing_Vector Vector a) =>
Vector (Rounded r a) -> Rounded r a
sum = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (vector :: * -> *) a.
RoundedRing_Vector vector a =>
RoundingMode -> vector a -> a
roundedSum RoundingMode
r :: VU.Vector a -> a)
where r :: RoundingMode
r = forall (r :: RoundingMode) (proxy :: RoundingMode -> *).
Rounding r =>
proxy r -> RoundingMode
rounding (forall {k} (t :: k). Proxy t
Proxy :: Proxy r)
{-# INLINE sum #-}
zipWith_add :: forall r a. (Rounding r, VU.Unbox a, RoundedRing_Vector VU.Vector a) => VU.Vector (Rounded r a) -> VU.Vector (Rounded r a) -> VU.Vector (Rounded r a)
zipWith_add :: forall (r :: RoundingMode) a.
(Rounding r, Unbox a, RoundedRing_Vector Vector a) =>
Vector (Rounded r a)
-> Vector (Rounded r a) -> Vector (Rounded r a)
zipWith_add = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (vector :: * -> *) a.
RoundedRing_Vector vector a =>
RoundingMode -> vector a -> vector a -> vector a
zipWith_roundedAdd RoundingMode
r :: VU.Vector a -> VU.Vector a -> VU.Vector a)
where r :: RoundingMode
r = forall (r :: RoundingMode) (proxy :: RoundingMode -> *).
Rounding r =>
proxy r -> RoundingMode
rounding (forall {k} (t :: k). Proxy t
Proxy :: Proxy r)
{-# INLINE zipWith_add #-}
zipWith_sub :: forall r a. (Rounding r, VU.Unbox a, RoundedRing_Vector VU.Vector a) => VU.Vector (Rounded r a) -> VU.Vector (Rounded r a) -> VU.Vector (Rounded r a)
zipWith_sub :: forall (r :: RoundingMode) a.
(Rounding r, Unbox a, RoundedRing_Vector Vector a) =>
Vector (Rounded r a)
-> Vector (Rounded r a) -> Vector (Rounded r a)
zipWith_sub = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (vector :: * -> *) a.
RoundedRing_Vector vector a =>
RoundingMode -> vector a -> vector a -> vector a
zipWith_roundedSub RoundingMode
r :: VU.Vector a -> VU.Vector a -> VU.Vector a)
where r :: RoundingMode
r = forall (r :: RoundingMode) (proxy :: RoundingMode -> *).
Rounding r =>
proxy r -> RoundingMode
rounding (forall {k} (t :: k). Proxy t
Proxy :: Proxy r)
{-# INLINE zipWith_sub #-}
zipWith_mul :: forall r a. (Rounding r, VU.Unbox a, RoundedRing_Vector VU.Vector a) => VU.Vector (Rounded r a) -> VU.Vector (Rounded r a) -> VU.Vector (Rounded r a)
zipWith_mul :: forall (r :: RoundingMode) a.
(Rounding r, Unbox a, RoundedRing_Vector Vector a) =>
Vector (Rounded r a)
-> Vector (Rounded r a) -> Vector (Rounded r a)
zipWith_mul = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (vector :: * -> *) a.
RoundedRing_Vector vector a =>
RoundingMode -> vector a -> vector a -> vector a
zipWith_roundedMul RoundingMode
r :: VU.Vector a -> VU.Vector a -> VU.Vector a)
where r :: RoundingMode
r = forall (r :: RoundingMode) (proxy :: RoundingMode -> *).
Rounding r =>
proxy r -> RoundingMode
rounding (forall {k} (t :: k). Proxy t
Proxy :: Proxy r)
{-# INLINE zipWith_mul #-}
zipWith3_fusedMultiplyAdd :: forall r a. (Rounding r, VU.Unbox a, RoundedRing_Vector VU.Vector a) => VU.Vector (Rounded r a) -> VU.Vector (Rounded r a) -> VU.Vector (Rounded r a) -> VU.Vector (Rounded r a)
zipWith3_fusedMultiplyAdd :: forall (r :: RoundingMode) a.
(Rounding r, Unbox a, RoundedRing_Vector Vector a) =>
Vector (Rounded r a)
-> Vector (Rounded r a)
-> Vector (Rounded r a)
-> Vector (Rounded r a)
zipWith3_fusedMultiplyAdd = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (vector :: * -> *) a.
RoundedRing_Vector vector a =>
RoundingMode -> vector a -> vector a -> vector a -> vector a
zipWith3_roundedFusedMultiplyAdd RoundingMode
r :: VU.Vector a -> VU.Vector a -> VU.Vector a -> VU.Vector a)
where r :: RoundingMode
r = forall (r :: RoundingMode) (proxy :: RoundingMode -> *).
Rounding r =>
proxy r -> RoundingMode
rounding (forall {k} (t :: k). Proxy t
Proxy :: Proxy r)
{-# INLINE zipWith3_fusedMultiplyAdd #-}
zipWith_div :: forall r a. (Rounding r, VU.Unbox a, RoundedFractional_Vector VU.Vector a) => VU.Vector (Rounded r a) -> VU.Vector (Rounded r a) -> VU.Vector (Rounded r a)
zipWith_div :: forall (r :: RoundingMode) a.
(Rounding r, Unbox a, RoundedFractional_Vector Vector a) =>
Vector (Rounded r a)
-> Vector (Rounded r a) -> Vector (Rounded r a)
zipWith_div = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (vector :: * -> *) a.
RoundedFractional_Vector vector a =>
RoundingMode -> vector a -> vector a -> vector a
zipWith_roundedDiv RoundingMode
r :: VU.Vector a -> VU.Vector a -> VU.Vector a)
where r :: RoundingMode
r = forall (r :: RoundingMode) (proxy :: RoundingMode -> *).
Rounding r =>
proxy r -> RoundingMode
rounding (forall {k} (t :: k). Proxy t
Proxy :: Proxy r)
{-# INLINE zipWith_div #-}
map_sqrt :: forall r a. (Rounding r, VU.Unbox a, RoundedSqrt_Vector VU.Vector a) => VU.Vector (Rounded r a) -> VU.Vector (Rounded r a)
map_sqrt :: forall (r :: RoundingMode) a.
(Rounding r, Unbox a, RoundedSqrt_Vector Vector a) =>
Vector (Rounded r a) -> Vector (Rounded r a)
map_sqrt = coerce :: forall a b. Coercible a b => a -> b
coerce (forall (vector :: * -> *) a.
RoundedSqrt_Vector vector a =>
RoundingMode -> vector a -> vector a
map_roundedSqrt RoundingMode
r :: VU.Vector a -> VU.Vector a)
where r :: RoundingMode
r = forall (r :: RoundingMode) (proxy :: RoundingMode -> *).
Rounding r =>
proxy r -> RoundingMode
rounding (forall {k} (t :: k). Proxy t
Proxy :: Proxy r)
{-# INLINE map_sqrt #-}