    -- | Partial derivatives of scalar Futhark operations and built-in functions.
    module Futhark.AD.Derivatives
      ( pdBuiltin,
        pdBinOp,
        pdUnOp,
      )
    where

    import Data.Bifunctor (bimap)
    import Futhark.Analysis.PrimExp.Convert
    import Futhark.IR.Syntax.Core (Name, VName, nameToText)
    import Futhark.Util.IntegralExp
    import Prelude hiding (quot)

    iConst :: IntType -> Integer -> PrimExp VName
    iConst :: IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    x = PrimValue -> PrimExp VName
    forall v. PrimValue -> PrimExp v
    ValueExp (PrimValue -> PrimExp VName) -> PrimValue -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ IntValue -> PrimValue
    IntValue (IntValue -> PrimValue) -> IntValue -> PrimValue
    forall a b. (a -> b) -> a -> b
    $ IntType -> Integer -> IntValue
    forall int. Integral int => IntType -> int -> IntValue
    intValue IntType
    it Integer
    x

    fConst :: FloatType -> Double -> PrimExp VName
    fConst :: FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft Double
    x = PrimValue -> PrimExp VName
    forall v. PrimValue -> PrimExp v
    ValueExp (PrimValue -> PrimExp VName) -> PrimValue -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ FloatValue -> PrimValue
    FloatValue (FloatValue -> PrimValue) -> FloatValue -> PrimValue
    forall a b. (a -> b) -> a -> b
    $ FloatType -> Double -> FloatValue
    forall num. Real num => FloatType -> num -> FloatValue
    floatValue FloatType
    ft Double
    x

    untyped2 :: (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 :: forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 = (TPrimExp t v -> PrimExp v)
    -> (TPrimExp t v -> PrimExp v)
    -> (TPrimExp t v, TPrimExp t v)
    -> (PrimExp v, PrimExp v)
    forall a b c d. (a -> b) -> (c -> d) -> (a, c) -> (b, d)
    forall (p :: * -> * -> *) a b c d.
    Bifunctor p =>
    (a -> b) -> (c -> d) -> p a c -> p b d
    bimap TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped

    -- | @pdUnOp op x@ computes the partial derivatives of @op@
    -- with respect to @x@.
    pdUnOp :: UnOp -> PrimExp VName -> PrimExp VName
    pdUnOp :: UnOp -> PrimExp VName -> PrimExp VName
    pdUnOp (Abs IntType
    it) PrimExp VName
    a = UnOp -> PrimExp VName -> PrimExp VName
    forall v. UnOp -> PrimExp v -> PrimExp v
    UnOpExp (IntType -> UnOp
    SSignum IntType
    it) PrimExp VName
    a
    pdUnOp (FAbs FloatType
    ft) PrimExp VName
    a = UnOp -> PrimExp VName -> PrimExp VName
    forall v. UnOp -> PrimExp v -> PrimExp v
    UnOpExp (FloatType -> UnOp
    FSignum FloatType
    ft) PrimExp VName
    a
    pdUnOp (Neg PrimType
    Bool) PrimExp VName
    x = PrimExp VName
    x
    pdUnOp (Neg PrimType
    Unit) PrimExp VName
    x = PrimExp VName
    x
    pdUnOp (Neg (IntType IntType
    it)) PrimExp VName
    _ = IntType -> Integer -> PrimExp VName
    iConst IntType
    it (-Integer
    1)
    pdUnOp (Neg (FloatType FloatType
    ft)) PrimExp VName
    _ = FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft (-Double
    1)
    pdUnOp (Complement IntType
    it) PrimExp VName
    x = UnOp -> PrimExp VName -> PrimExp VName
    forall v. UnOp -> PrimExp v -> PrimExp v
    UnOpExp (IntType -> UnOp
    Complement IntType
    it) PrimExp VName
    x
    pdUnOp (SSignum IntType
    it) PrimExp VName
    _ = IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0
    pdUnOp (USignum IntType
    it) PrimExp VName
    _ = IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0
    pdUnOp (FSignum FloatType
    ft) PrimExp VName
    _ = FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft Double
    0

    type OnBinOp t v = TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)

    intBinOp ::
      OnBinOp Int8 v ->
      OnBinOp Int16 v ->
      OnBinOp Int32 v ->
      OnBinOp Int64 v ->
      IntType ->
      PrimExp v ->
      PrimExp v ->
      (PrimExp v, PrimExp v)
    intBinOp :: forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 v
    f OnBinOp Int16 v
    _ OnBinOp Int32 v
    _ OnBinOp Int64 v
    _ IntType
    Int8 PrimExp v
    a PrimExp v
    b = (TPrimExp Int8 v, TPrimExp Int8 v) -> (PrimExp v, PrimExp v)
    forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 ((TPrimExp Int8 v, TPrimExp Int8 v) -> (PrimExp v, PrimExp v))
    -> (TPrimExp Int8 v, TPrimExp Int8 v) -> (PrimExp v, PrimExp v)
    forall a b. (a -> b) -> a -> b
    $ OnBinOp Int8 v
    f (PrimExp v -> TPrimExp Int8 v
    forall v. PrimExp v -> TPrimExp Int8 v
    isInt8 PrimExp v
    a) (PrimExp v -> TPrimExp Int8 v
    forall v. PrimExp v -> TPrimExp Int8 v
    isInt8 PrimExp v
    b)
    intBinOp OnBinOp Int8 v
    _ OnBinOp Int16 v
    f OnBinOp Int32 v
    _ OnBinOp Int64 v
    _ IntType
    Int16 PrimExp v
    a PrimExp v
    b = (TPrimExp Int16 v, TPrimExp Int16 v) -> (PrimExp v, PrimExp v)
    forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 ((TPrimExp Int16 v, TPrimExp Int16 v) -> (PrimExp v, PrimExp v))
    -> (TPrimExp Int16 v, TPrimExp Int16 v) -> (PrimExp v, PrimExp v)
    forall a b. (a -> b) -> a -> b
    $ OnBinOp Int16 v
    f (PrimExp v -> TPrimExp Int16 v
    forall v. PrimExp v -> TPrimExp Int16 v
    isInt16 PrimExp v
    a) (PrimExp v -> TPrimExp Int16 v
    forall v. PrimExp v -> TPrimExp Int16 v
    isInt16 PrimExp v
    b)
    intBinOp OnBinOp Int8 v
    _ OnBinOp Int16 v
    _ OnBinOp Int32 v
    f OnBinOp Int64 v
    _ IntType
    Int32 PrimExp v
    a PrimExp v
    b = (TPrimExp Int32 v, TPrimExp Int32 v) -> (PrimExp v, PrimExp v)
    forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 ((TPrimExp Int32 v, TPrimExp Int32 v) -> (PrimExp v, PrimExp v))
    -> (TPrimExp Int32 v, TPrimExp Int32 v) -> (PrimExp v, PrimExp v)
    forall a b. (a -> b) -> a -> b
    $ OnBinOp Int32 v
    f (PrimExp v -> TPrimExp Int32 v
    forall v. PrimExp v -> TPrimExp Int32 v
    isInt32 PrimExp v
    a) (PrimExp v -> TPrimExp Int32 v
    forall v. PrimExp v -> TPrimExp Int32 v
    isInt32 PrimExp v
    b)
    intBinOp OnBinOp Int8 v
    _ OnBinOp Int16 v
    _ OnBinOp Int32 v
    _ OnBinOp Int64 v
    f IntType
    Int64 PrimExp v
    a PrimExp v
    b = (TPrimExp Int64 v, TPrimExp Int64 v) -> (PrimExp v, PrimExp v)
    forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 ((TPrimExp Int64 v, TPrimExp Int64 v) -> (PrimExp v, PrimExp v))
    -> (TPrimExp Int64 v, TPrimExp Int64 v) -> (PrimExp v, PrimExp v)
    forall a b. (a -> b) -> a -> b
    $ OnBinOp Int64 v
    f (PrimExp v -> TPrimExp Int64 v
    forall v. PrimExp v -> TPrimExp Int64 v
    isInt64 PrimExp v
    a) (PrimExp v -> TPrimExp Int64 v
    forall v. PrimExp v -> TPrimExp Int64 v
    isInt64 PrimExp v
    b)

    floatBinOp ::
      OnBinOp Half v ->
      OnBinOp Float v ->
      OnBinOp Double v ->
      FloatType ->
      PrimExp v ->
      PrimExp v ->
      (PrimExp v, PrimExp v)
    floatBinOp :: forall v.
    OnBinOp Half v
    -> OnBinOp Float v
    -> OnBinOp Double v
    -> FloatType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    floatBinOp OnBinOp Half v
    f OnBinOp Float v
    _ OnBinOp Double v
    _ FloatType
    Float16 PrimExp v
    a PrimExp v
    b = (TPrimExp Half v, TPrimExp Half v) -> (PrimExp v, PrimExp v)
    forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 ((TPrimExp Half v, TPrimExp Half v) -> (PrimExp v, PrimExp v))
    -> (TPrimExp Half v, TPrimExp Half v) -> (PrimExp v, PrimExp v)
    forall a b. (a -> b) -> a -> b
    $ OnBinOp Half v
    f (PrimExp v -> TPrimExp Half v
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp v
    a) (PrimExp v -> TPrimExp Half v
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp v
    b)
    floatBinOp OnBinOp Half v
    _ OnBinOp Float v
    f OnBinOp Double v
    _ FloatType
    Float32 PrimExp v
    a PrimExp v
    b = (TPrimExp Float v, TPrimExp Float v) -> (PrimExp v, PrimExp v)
    forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 ((TPrimExp Float v, TPrimExp Float v) -> (PrimExp v, PrimExp v))
    -> (TPrimExp Float v, TPrimExp Float v) -> (PrimExp v, PrimExp v)
    forall a b. (a -> b) -> a -> b
    $ OnBinOp Float v
    f (PrimExp v -> TPrimExp Float v
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp v
    a) (PrimExp v -> TPrimExp Float v
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp v
    b)
    floatBinOp OnBinOp Half v
    _ OnBinOp Float v
    _ OnBinOp Double v
    f FloatType
    Float64 PrimExp v
    a PrimExp v
    b = (TPrimExp Double v, TPrimExp Double v) -> (PrimExp v, PrimExp v)
    forall {k} (t :: k) v.
    (TPrimExp t v, TPrimExp t v) -> (PrimExp v, PrimExp v)
    untyped2 ((TPrimExp Double v, TPrimExp Double v) -> (PrimExp v, PrimExp v))
    -> (TPrimExp Double v, TPrimExp Double v) -> (PrimExp v, PrimExp v)
    forall a b. (a -> b) -> a -> b
    $ OnBinOp Double v
    f (PrimExp v -> TPrimExp Double v
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp v
    a) (PrimExp v -> TPrimExp Double v
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp v
    b)

    -- | @pdBinOp op x y@ computes the partial derivatives of @op@ with
    -- respect to @x@ and @y@.
    pdBinOp :: BinOp -> PrimExp VName -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    pdBinOp :: BinOp
    -> PrimExp VName -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    pdBinOp (Add IntType
    it Overflow
    _) PrimExp VName
    _ PrimExp VName
    _ = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    1, IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    1)
    pdBinOp (Sub IntType
    it Overflow
    _) PrimExp VName
    _ PrimExp VName
    _ = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    1, IntType -> Integer -> PrimExp VName
    iConst IntType
    it (-Integer
    1))
    pdBinOp (Mul IntType
    _ Overflow
    _) PrimExp VName
    x PrimExp VName
    y = (PrimExp VName
    y, PrimExp VName
    x)
    pdBinOp (Pow IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {a} {b}. (IntegralExp a, Num b) => a -> a -> (a, b)
    derivs OnBinOp Int16 VName
    forall {a} {b}. (IntegralExp a, Num b) => a -> a -> (a, b)
    derivs OnBinOp Int32 VName
    forall {a} {b}. (IntegralExp a, Num b) => a -> a -> (a, b)
    derivs OnBinOp Int64 VName
    forall {a} {b}. (IntegralExp a, Num b) => a -> a -> (a, b)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: a -> a -> (a, b)
    derivs a
    x a
    y = ((a
    x a -> a -> a
    forall e. IntegralExp e => e -> e -> e
    `pow` (a
    y a -> a -> a
    forall a. Num a => a -> a -> a
    - a
    1)) a -> a -> a
    forall a. Num a => a -> a -> a
    * a
    y, b
    0) -- FIXME (wrt y)
    pdBinOp (SDiv IntType
    it Safety
    _) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int16 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int32 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int64 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: b -> b -> (b, b)
    derivs b
    x b
    y = (b
    1 b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` b
    y, b -> b
    forall a. Num a => a -> a
    negate (b
    x b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` (b
    y b -> b -> b
    forall a. Num a => a -> a -> a
    * b
    y)))
    pdBinOp (SDivUp IntType
    it Safety
    _) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int16 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int32 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int64 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: b -> b -> (b, b)
    derivs b
    x b
    y = (b
    1 b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` b
    y, b -> b
    forall a. Num a => a -> a
    negate (b
    x b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` (b
    y b -> b -> b
    forall a. Num a => a -> a -> a
    * b
    y)))
    pdBinOp (SQuot IntType
    it Safety
    _) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int16 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int32 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int64 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: b -> b -> (b, b)
    derivs b
    x b
    y = (b
    1 b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` b
    y, b -> b
    forall a. Num a => a -> a
    negate (b
    x b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` (b
    y b -> b -> b
    forall a. Num a => a -> a -> a
    * b
    y)))
    pdBinOp (UDiv IntType
    it Safety
    _) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int16 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int32 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int64 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: b -> b -> (b, b)
    derivs b
    x b
    y = (b
    1 b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` b
    y, b -> b
    forall a. Num a => a -> a
    negate (b
    x b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` (b
    y b -> b -> b
    forall a. Num a => a -> a -> a
    * b
    y)))
    pdBinOp (UDivUp IntType
    it Safety
    _) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int16 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int32 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs OnBinOp Int64 VName
    forall {b}. IntegralExp b => b -> b -> (b, b)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: b -> b -> (b, b)
    derivs b
    x b
    y = (b
    1 b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` b
    y, b -> b
    forall a. Num a => a -> a
    negate (b
    x b -> b -> b
    forall e. IntegralExp e => e -> e -> e
    `quot` (b
    y b -> b -> b
    forall a. Num a => a -> a -> a
    * b
    y)))
    pdBinOp (UMod IntType
    it Safety
    _) PrimExp VName
    _ PrimExp VName
    _ = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    1, IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0) -- FIXME
    pdBinOp (SMod IntType
    it Safety
    _) PrimExp VName
    _ PrimExp VName
    _ = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    1, IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0) -- FIXME
    pdBinOp (SRem IntType
    it Safety
    _) PrimExp VName
    _ PrimExp VName
    _ = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    1, IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0) -- FIXME
    pdBinOp (FMod FloatType
    ft) PrimExp VName
    _ PrimExp VName
    _ = (FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft Double
    1, FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft Double
    0) -- FIXME
    pdBinOp (UMax IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int16 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int32 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int64 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs TPrimExp t v
    x TPrimExp t v
    y = (TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .>=. TPrimExp t v
    y), TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .<. TPrimExp t v
    y))
    pdBinOp (SMax IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int16 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int32 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int64 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs TPrimExp t v
    x TPrimExp t v
    y = (TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .>=. TPrimExp t v
    y), TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .<. TPrimExp t v
    y))
    pdBinOp (UMin IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int16 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int32 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int64 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs TPrimExp t v
    x TPrimExp t v
    y = (TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .<=. TPrimExp t v
    y), TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .>. TPrimExp t v
    y))
    pdBinOp (SMin IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Int8 VName
    -> OnBinOp Int16 VName
    -> OnBinOp Int32 VName
    -> OnBinOp Int64 VName
    -> IntType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Int8 v
    -> OnBinOp Int16 v
    -> OnBinOp Int32 v
    -> OnBinOp Int64 v
    -> IntType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    intBinOp OnBinOp Int8 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int16 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int32 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Int64 VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs IntType
    it PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs TPrimExp t v
    x TPrimExp t v
    y = (TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .<=. TPrimExp t v
    y), TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .>. TPrimExp t v
    y))
    --
    pdBinOp (Shl IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      BinOp
    -> PrimExp VName -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    pdBinOp (IntType -> Overflow -> BinOp
    Mul IntType
    it Overflow
    OverflowWrap) PrimExp VName
    a (PrimExp VName -> (PrimExp VName, PrimExp VName))
    -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    forall a b. (a -> b) -> a -> b
    $ BinOp -> PrimExp VName -> PrimExp VName -> PrimExp VName
    forall v. BinOp -> PrimExp v -> PrimExp v -> PrimExp v
    BinOpExp (IntType -> BinOp
    Pow IntType
    it) (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    2) PrimExp VName
    b
    pdBinOp (LShr IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      BinOp
    -> PrimExp VName -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    pdBinOp (IntType -> Safety -> BinOp
    UDiv IntType
    it Safety
    Unsafe) PrimExp VName
    a (PrimExp VName -> (PrimExp VName, PrimExp VName))
    -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    forall a b. (a -> b) -> a -> b
    $ BinOp -> PrimExp VName -> PrimExp VName -> PrimExp VName
    forall v. BinOp -> PrimExp v -> PrimExp v -> PrimExp v
    BinOpExp (IntType -> BinOp
    Pow IntType
    it) (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    2) PrimExp VName
    b
    pdBinOp (AShr IntType
    it) PrimExp VName
    a PrimExp VName
    b =
      BinOp
    -> PrimExp VName -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    pdBinOp (IntType -> Safety -> BinOp
    SDiv IntType
    it Safety
    Unsafe) PrimExp VName
    a (PrimExp VName -> (PrimExp VName, PrimExp VName))
    -> PrimExp VName -> (PrimExp VName, PrimExp VName)
    forall a b. (a -> b) -> a -> b
    $ BinOp -> PrimExp VName -> PrimExp VName -> PrimExp VName
    forall v. BinOp -> PrimExp v -> PrimExp v -> PrimExp v
    BinOpExp (IntType -> BinOp
    Pow IntType
    it) (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    2) PrimExp VName
    b
    pdBinOp (And IntType
    it) PrimExp VName
    _a PrimExp VName
    _b = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0, IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0) -- FIXME
    pdBinOp (Or IntType
    it) PrimExp VName
    _a PrimExp VName
    _b = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0, IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0) -- FIXME
    pdBinOp (Xor IntType
    it) PrimExp VName
    _a PrimExp VName
    _b = (IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0, IntType -> Integer -> PrimExp VName
    iConst IntType
    it Integer
    0) -- FIXME
    --
    pdBinOp (FAdd FloatType
    ft) PrimExp VName
    _ PrimExp VName
    _ = (FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft Double
    1, FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft Double
    1)
    pdBinOp (FSub FloatType
    ft) PrimExp VName
    _ PrimExp VName
    _ = (FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft Double
    1, FloatType -> Double -> PrimExp VName
    fConst FloatType
    ft (-Double
    1))
    pdBinOp (FMul FloatType
    _) PrimExp VName
    x PrimExp VName
    y = (PrimExp VName
    y, PrimExp VName
    x)
    pdBinOp (FDiv FloatType
    ft) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Half VName
    -> OnBinOp Float VName
    -> OnBinOp Double VName
    -> FloatType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Half v
    -> OnBinOp Float v
    -> OnBinOp Double v
    -> FloatType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    floatBinOp OnBinOp Half VName
    forall {b}. Fractional b => b -> b -> (b, b)
    derivs OnBinOp Float VName
    forall {b}. Fractional b => b -> b -> (b, b)
    derivs OnBinOp Double VName
    forall {b}. Fractional b => b -> b -> (b, b)
    derivs FloatType
    ft PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: b -> b -> (b, b)
    derivs b
    x b
    y = (b
    1 b -> b -> b
    forall a. Fractional a => a -> a -> a
    / b
    y, b -> b
    forall a. Num a => a -> a
    negate (b
    x b -> b -> b
    forall a. Fractional a => a -> a -> a
    / (b
    y b -> b -> b
    forall a. Num a => a -> a -> a
    * b
    y)))
    pdBinOp (FPow FloatType
    ft) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Half VName
    -> OnBinOp Float VName
    -> OnBinOp Double VName
    -> FloatType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Half v
    -> OnBinOp Float v
    -> OnBinOp Double v
    -> FloatType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    floatBinOp OnBinOp Half VName
    forall {k} {t :: k} {v}.
    (Pretty v, Floating (TPrimExp t v), Eq v, FloatExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Float VName
    forall {k} {t :: k} {v}.
    (Pretty v, Floating (TPrimExp t v), Eq v, FloatExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Double VName
    forall {k} {t :: k} {v}.
    (Pretty v, Floating (TPrimExp t v), Eq v, FloatExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs FloatType
    ft PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs TPrimExp t v
    x TPrimExp t v
    y =
          ( TPrimExp t v
    y TPrimExp t v -> TPrimExp t v -> TPrimExp t v
    forall a. Num a => a -> a -> a
    * (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp t v
    forall a. Floating a => a -> a -> a
    ** (TPrimExp t v
    y TPrimExp t v -> TPrimExp t v -> TPrimExp t v
    forall a. Num a => a -> a -> a
    - TPrimExp t v
    1)),
            (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp t v
    forall a. Floating a => a -> a -> a
    ** TPrimExp t v
    y) TPrimExp t v -> TPrimExp t v -> TPrimExp t v
    forall a. Num a => a -> a -> a
    * TPrimExp Bool v -> TPrimExp t v -> TPrimExp t v -> TPrimExp t v
    forall {k} v (t :: k).
    TPrimExp Bool v -> TPrimExp t v -> TPrimExp t v -> TPrimExp t v
    condExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .<=. TPrimExp t v
    0) TPrimExp t v
    0 (TPrimExp t v -> TPrimExp t v
    forall a. Floating a => a -> a
    log TPrimExp t v
    x)
          )
    pdBinOp (FMax FloatType
    ft) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Half VName
    -> OnBinOp Float VName
    -> OnBinOp Double VName
    -> FloatType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Half v
    -> OnBinOp Float v
    -> OnBinOp Double v
    -> FloatType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    floatBinOp OnBinOp Half VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Float VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Double VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs FloatType
    ft PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs TPrimExp t v
    x TPrimExp t v
    y = (TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .>=. TPrimExp t v
    y), TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .<. TPrimExp t v
    y))
    pdBinOp (FMin FloatType
    ft) PrimExp VName
    a PrimExp VName
    b =
      OnBinOp Half VName
    -> OnBinOp Float VName
    -> OnBinOp Double VName
    -> FloatType
    -> PrimExp VName
    -> PrimExp VName
    -> (PrimExp VName, PrimExp VName)
    forall v.
    OnBinOp Half v
    -> OnBinOp Float v
    -> OnBinOp Double v
    -> FloatType
    -> PrimExp v
    -> PrimExp v
    -> (PrimExp v, PrimExp v)
    floatBinOp OnBinOp Half VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Float VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs OnBinOp Double VName
    forall {k} {k} {k} {v} {t :: k} {t :: k} {t :: k}.
    (Eq v, NumExp t, NumExp t) =>
    TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs FloatType
    ft PrimExp VName
    a PrimExp VName
    b
      where
        derivs :: TPrimExp t v -> TPrimExp t v -> (TPrimExp t v, TPrimExp t v)
    derivs TPrimExp t v
    x TPrimExp t v
    y = (TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .<=. TPrimExp t v
    y), TPrimExp Bool v -> TPrimExp t v
    forall v. TPrimExp Bool v -> TPrimExp t v
    forall {k} (t :: k) v. NumExp t => TPrimExp Bool v -> TPrimExp t v
    fromBoolExp (TPrimExp t v
    x TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    forall {k} v (t :: k).
    Eq v =>
    TPrimExp t v -> TPrimExp t v -> TPrimExp Bool v
    .>. TPrimExp t v
    y))
    pdBinOp BinOp
    LogAnd PrimExp VName
    a PrimExp VName
    b = (PrimExp VName
    b, PrimExp VName
    a)
    pdBinOp BinOp
    LogOr PrimExp VName
    _ PrimExp VName
    _ = (PrimValue -> PrimExp VName
    forall v. PrimValue -> PrimExp v
    ValueExp (PrimValue -> PrimExp VName) -> PrimValue -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ Bool -> PrimValue
    BoolValue Bool
    True, PrimValue -> PrimExp VName
    forall v. PrimValue -> PrimExp v
    ValueExp (PrimValue -> PrimExp VName) -> PrimValue -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ Bool -> PrimValue
    BoolValue Bool
    False)

    -- | @pdBuiltin f args i@ computes the partial derivative of @f@
    -- applied to @args@ with respect to each of its arguments.  Returns
    -- 'Nothing' if no such derivative is known.
    pdBuiltin :: Name -> [PrimExp VName] -> Maybe [PrimExp VName]
    pdBuiltin :: Name -> [PrimExp VName] -> Maybe [PrimExp VName]
    pdBuiltin Name
    "sqrt16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    2 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x))]
    pdBuiltin Name
    "sqrt32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    2 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x))]
    pdBuiltin Name
    "sqrt64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    2 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x))]
    pdBuiltin Name
    "rsqrt16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    2 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a -> a
    ** (TPrimExp Half VName
    3 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Half VName
    2)))]
    pdBuiltin Name
    "rsqrt32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    2 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a -> a
    ** (TPrimExp Float VName
    3 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Float VName
    2)))]
    pdBuiltin Name
    "rsqrt64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    2 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a -> a
    ** (TPrimExp Double VName
    3 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Double VName
    2)))]
    pdBuiltin Name
    "cbrt16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    3 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall {k} {t :: k} {v}. TPrimExp t v -> TPrimExp Half v
    cbrt16 (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall {k} {t :: k} {v}. TPrimExp t v -> TPrimExp Half v
    cbrt16 (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x))]
      where
        cbrt16 :: TPrimExp t v -> TPrimExp Half v
    cbrt16 TPrimExp t v
    a = PrimExp v -> TPrimExp Half v
    forall v. PrimExp v -> TPrimExp Half v
    isF16 (PrimExp v -> TPrimExp Half v) -> PrimExp v -> TPrimExp Half v
    forall a b. (a -> b) -> a -> b
    $ Text -> [PrimExp v] -> PrimType -> PrimExp v
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "cbrt16" [TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp t v
    a] (PrimType -> PrimExp v) -> PrimType -> PrimExp v
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float16
    pdBuiltin Name
    "cbrt32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    3 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall {k} {t :: k} {v}. TPrimExp t v -> TPrimExp Float v
    cbrt32 (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall {k} {t :: k} {v}. TPrimExp t v -> TPrimExp Float v
    cbrt32 (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x))]
      where
        cbrt32 :: TPrimExp t v -> TPrimExp Float v
    cbrt32 TPrimExp t v
    a = PrimExp v -> TPrimExp Float v
    forall v. PrimExp v -> TPrimExp Float v
    isF32 (PrimExp v -> TPrimExp Float v) -> PrimExp v -> TPrimExp Float v
    forall a b. (a -> b) -> a -> b
    $ Text -> [PrimExp v] -> PrimType -> PrimExp v
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "cbrt32" [TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp t v
    a] (PrimType -> PrimExp v) -> PrimType -> PrimExp v
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float32
    pdBuiltin Name
    "cbrt64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    3 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall {k} {t :: k} {v}. TPrimExp t v -> TPrimExp Double v
    cbrt64 (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall {k} {t :: k} {v}. TPrimExp t v -> TPrimExp Double v
    cbrt64 (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x))]
      where
        cbrt64 :: TPrimExp t v -> TPrimExp Double v
    cbrt64 TPrimExp t v
    a = PrimExp v -> TPrimExp Double v
    forall v. PrimExp v -> TPrimExp Double v
    isF64 (PrimExp v -> TPrimExp Double v) -> PrimExp v -> TPrimExp Double v
    forall a b. (a -> b) -> a -> b
    $ Text -> [PrimExp v] -> PrimType -> PrimExp v
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "cbrt64" [TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp t v
    a] (PrimType -> PrimExp v) -> PrimType -> PrimExp v
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float32
    pdBuiltin Name
    "log16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x]
    pdBuiltin Name
    "log32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x]
    pdBuiltin Name
    "log64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x]
    pdBuiltin Name
    "log10_16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    log TPrimExp Half VName
    10)]
    pdBuiltin Name
    "log10_32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    log TPrimExp Float VName
    10)]
    pdBuiltin Name
    "log10_64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    log TPrimExp Double VName
    10)]
    pdBuiltin Name
    "log2_16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    log TPrimExp Half VName
    2)]
    pdBuiltin Name
    "log2_32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    log TPrimExp Float VName
    2)]
    pdBuiltin Name
    "log2_64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    log TPrimExp Double VName
    2)]
    pdBuiltin Name
    "log1p_16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + TPrimExp Half VName
    1)]
    pdBuiltin Name
    "log1p_32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + TPrimExp Float VName
    1)]
    pdBuiltin Name
    "log1p_64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + TPrimExp Double VName
    1)]
    pdBuiltin Name
    "exp16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    exp (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "exp32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    exp (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "exp64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    exp (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "sin16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "sin32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "sin64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "sinpi16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cos (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "sinpi32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cos (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "sinpi64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cos (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "sinh16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "sinh32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "sinh64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "cos16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sin (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "cos32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sin (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "cos64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sin (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "cospi16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sin (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "cospi32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sin (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "cospi64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sin (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "cosh16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sinh (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "cosh32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sinh (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "cosh64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sinh (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "tan16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x))]
    pdBuiltin Name
    "tan32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x))]
    pdBuiltin Name
    "tan64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cos (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x))]
    pdBuiltin Name
    "tanpi16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cos (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cos (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)))]
    pdBuiltin Name
    "tanpi32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cos (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cos (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)))]
    pdBuiltin Name
    "tanpi64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cos (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cos (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)))]
    pdBuiltin Name
    "asin16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "asin32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "asin64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "asinpi16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x))]
    pdBuiltin Name
    "asinpi32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x))]
    pdBuiltin Name
    "asinpi64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x))]
    pdBuiltin Name
    "asinh16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "asinh32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "asinh64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "acos16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "acos32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "acos64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "acospi16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x))]
    pdBuiltin Name
    "acospi32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x))]
    pdBuiltin Name
    "acospi64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x))]
    pdBuiltin Name
    "acosh16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - TPrimExp Half VName
    1)]
    pdBuiltin Name
    "acosh32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - TPrimExp Float VName
    1)]
    pdBuiltin Name
    "acosh64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - TPrimExp Double VName
    1)]
    pdBuiltin Name
    "atan16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "atan32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "atan64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x))]
    pdBuiltin Name
    "atanpi16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x))]
    pdBuiltin Name
    "atanpi32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x))]
    pdBuiltin Name
    "atanpi64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "atanh16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "atanh32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "atanh64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    cosh (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "atan2_16" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y),
          TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y)
        ]
    pdBuiltin Name
    "atan2_32" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y),
          TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y)
        ]
    pdBuiltin Name
    "atan2_64" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y),
          TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y)
        ]
    pdBuiltin Name
    "atan2pi_16" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y)),
          TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Half VName
    forall a. Floating a => a
    pi TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y))
        ]
    pdBuiltin Name
    "atan2pi_32" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y)),
          TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Float VName
    forall a. Floating a => a
    pi TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y))
        ]
    pdBuiltin Name
    "atan2pi_64" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y)),
          TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ -PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / (TPrimExp Double VName
    forall a. Floating a => a
    pi TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    + PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y))
        ]
    pdBuiltin Name
    "tanh16" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    tanh (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    tanh (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x)]
    pdBuiltin Name
    "tanh32" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    tanh (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    tanh (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x)]
    pdBuiltin Name
    "tanh64" [PrimExp VName
    x] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    tanh (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    tanh (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x)]
    pdBuiltin Name
    "fma16" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    1]
    pdBuiltin Name
    "fma32" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    1]
    pdBuiltin Name
    "fma64" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    1]
    pdBuiltin Name
    "mad16" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    1]
    pdBuiltin Name
    "mad32" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    1]
    pdBuiltin Name
    "mad64" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    1]
    pdBuiltin Name
    "hypot16" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 (Text -> [PrimExp VName] -> PrimType -> PrimExp VName
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "hypot16" [PrimExp VName
    x, PrimExp VName
    y] (PrimType -> PrimExp VName) -> PrimType -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float16),
          TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 (Text -> [PrimExp VName] -> PrimType -> PrimExp VName
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "hypot16" [PrimExp VName
    x, PrimExp VName
    y] (PrimType -> PrimExp VName) -> PrimType -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float16)
        ]
    pdBuiltin Name
    "hypot32" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 (Text -> [PrimExp VName] -> PrimType -> PrimExp VName
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "hypot32" [PrimExp VName
    x, PrimExp VName
    y] (PrimType -> PrimExp VName) -> PrimType -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float32),
          TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 (Text -> [PrimExp VName] -> PrimType -> PrimExp VName
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "hypot32" [PrimExp VName
    x, PrimExp VName
    y] (PrimType -> PrimExp VName) -> PrimType -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float32)
        ]
    pdBuiltin Name
    "hypot64" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 (Text -> [PrimExp VName] -> PrimType -> PrimExp VName
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "hypot64" [PrimExp VName
    x, PrimExp VName
    y] (PrimType -> PrimExp VName) -> PrimType -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float64),
          TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 (Text -> [PrimExp VName] -> PrimType -> PrimExp VName
    forall v. Text -> [PrimExp v] -> PrimType -> PrimExp v
    FunExp Text
    "hypot64" [PrimExp VName
    x, PrimExp VName
    y] (PrimType -> PrimExp VName) -> PrimType -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ FloatType -> PrimType
    FloatType FloatType
    Float64)
        ]
    pdBuiltin Name
    "lerp16" [PrimExp VName
    v0, PrimExp VName
    v1, PrimExp VName
    t] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall v. TPrimExp Half v -> TPrimExp Half v -> TPrimExp Half v
    fMax16 TPrimExp Half VName
    0 (TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall v. TPrimExp Half v -> TPrimExp Half v -> TPrimExp Half v
    fMin16 TPrimExp Half VName
    1 (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    t)),
          TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall v. TPrimExp Half v -> TPrimExp Half v -> TPrimExp Half v
    fMax16 TPrimExp Half VName
    0 (TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall v. TPrimExp Half v -> TPrimExp Half v -> TPrimExp Half v
    fMin16 TPrimExp Half VName
    1 (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    t)),
          TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    v1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    v0
        ]
    pdBuiltin Name
    "lerp32" [PrimExp VName
    v0, PrimExp VName
    v1, PrimExp VName
    t] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall v. TPrimExp Float v -> TPrimExp Float v -> TPrimExp Float v
    fMax32 TPrimExp Float VName
    0 (TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall v. TPrimExp Float v -> TPrimExp Float v -> TPrimExp Float v
    fMin32 TPrimExp Float VName
    1 (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    t)),
          TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall v. TPrimExp Float v -> TPrimExp Float v -> TPrimExp Float v
    fMax32 TPrimExp Float VName
    0 (TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall v. TPrimExp Float v -> TPrimExp Float v -> TPrimExp Float v
    fMin32 TPrimExp Float VName
    1 (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    t)),
          TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    v1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    v0
        ]
    pdBuiltin Name
    "lerp64" [PrimExp VName
    v0, PrimExp VName
    v1, PrimExp VName
    t] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall v.
    TPrimExp Double v -> TPrimExp Double v -> TPrimExp Double v
    fMax64 TPrimExp Double VName
    0 (TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall v.
    TPrimExp Double v -> TPrimExp Double v -> TPrimExp Double v
    fMin64 TPrimExp Double VName
    1 (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    t)),
          TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall v.
    TPrimExp Double v -> TPrimExp Double v -> TPrimExp Double v
    fMax64 TPrimExp Double VName
    0 (TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall v.
    TPrimExp Double v -> TPrimExp Double v -> TPrimExp Double v
    fMin64 TPrimExp Double VName
    1 (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    t)),
          TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    v1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    - PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    v0
        ]
    pdBuiltin Name
    "ldexp16" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    2 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a -> a
    ** PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x,
          TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    log TPrimExp Half VName
    2 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Half VName
    2 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a -> a
    ** PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    y) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    x
        ]
    pdBuiltin Name
    "ldexp32" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    2 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a -> a
    ** PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x,
          TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    log TPrimExp Float VName
    2 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Float VName
    2 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a -> a
    ** PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    y) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    x
        ]
    pdBuiltin Name
    "ldexp64" [PrimExp VName
    x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
        [ TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    2 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a -> a
    ** PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x,
          TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    log TPrimExp Double VName
    2 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * (TPrimExp Double VName
    2 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a -> a
    ** PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    y) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    x
        ]
    pdBuiltin Name
    "erf16" [PrimExp VName
    z] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ (TPrimExp Half VName
    2 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt TPrimExp Half VName
    forall a. Floating a => a
    pi) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    exp (TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a
    negate (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    z TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    z))]
    pdBuiltin Name
    "erf32" [PrimExp VName
    z] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ (TPrimExp Float VName
    2 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt TPrimExp Float VName
    forall a. Floating a => a
    pi) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    exp (TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a
    negate (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    z TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    z))]
    pdBuiltin Name
    "erf64" [PrimExp VName
    z] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ (TPrimExp Double VName
    2 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt TPrimExp Double VName
    forall a. Floating a => a
    pi) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    exp (TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a
    negate (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    z TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    z))]
    pdBuiltin Name
    "erfc16" [PrimExp VName
    z] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a
    negate (TPrimExp Half VName -> TPrimExp Half VName)
    -> TPrimExp Half VName -> TPrimExp Half VName
    forall a b. (a -> b) -> a -> b
    $ (TPrimExp Half VName
    2 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    sqrt TPrimExp Half VName
    forall a. Floating a => a
    pi) TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * TPrimExp Half VName -> TPrimExp Half VName
    forall a. Floating a => a -> a
    exp (TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a
    negate (PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    z TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 PrimExp VName
    z))]
    pdBuiltin Name
    "erfc32" [PrimExp VName
    z] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a
    negate (TPrimExp Float VName -> TPrimExp Float VName)
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a b. (a -> b) -> a -> b
    $ (TPrimExp Float VName
    2 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    sqrt TPrimExp Float VName
    forall a. Floating a => a
    pi) TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * TPrimExp Float VName -> TPrimExp Float VName
    forall a. Floating a => a -> a
    exp (TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a
    negate (PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    z TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 PrimExp VName
    z))]
    pdBuiltin Name
    "erfc64" [PrimExp VName
    z] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a
    negate (TPrimExp Double VName -> TPrimExp Double VName)
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a b. (a -> b) -> a -> b
    $ (TPrimExp Double VName
    2 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Fractional a => a -> a -> a
    / TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    sqrt TPrimExp Double VName
    forall a. Floating a => a
    pi) TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * TPrimExp Double VName -> TPrimExp Double VName
    forall a. Floating a => a -> a
    exp (TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a
    negate (PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    z TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 PrimExp VName
    z))]
    pdBuiltin Name
    "copysign16" [PrimExp VName
    _x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Half VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Half VName -> PrimExp VName)
    -> TPrimExp Half VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Half VName
    1 TPrimExp Half VName -> TPrimExp Half VName -> TPrimExp Half VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Half VName
    forall v. PrimExp v -> TPrimExp Half v
    isF16 (UnOp -> PrimExp VName -> PrimExp VName
    forall v. UnOp -> PrimExp v -> PrimExp v
    UnOpExp (FloatType -> UnOp
    FSignum FloatType
    Float16) PrimExp VName
    y), FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    0]
    pdBuiltin Name
    "copysign32" [PrimExp VName
    _x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Float VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Float VName -> PrimExp VName)
    -> TPrimExp Float VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Float VName
    1 TPrimExp Float VName
    -> TPrimExp Float VName -> TPrimExp Float VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Float VName
    forall v. PrimExp v -> TPrimExp Float v
    isF32 (UnOp -> PrimExp VName -> PrimExp VName
    forall v. UnOp -> PrimExp v -> PrimExp v
    UnOpExp (FloatType -> UnOp
    FSignum FloatType
    Float32) PrimExp VName
    y), FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    0]
    pdBuiltin Name
    "copysign64" [PrimExp VName
    _x, PrimExp VName
    y] =
      [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Double VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped (TPrimExp Double VName -> PrimExp VName)
    -> TPrimExp Double VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Double VName
    1 TPrimExp Double VName
    -> TPrimExp Double VName -> TPrimExp Double VName
    forall a. Num a => a -> a -> a
    * PrimExp VName -> TPrimExp Double VName
    forall v. PrimExp v -> TPrimExp Double v
    isF64 (UnOp -> PrimExp VName -> PrimExp VName
    forall v. UnOp -> PrimExp v -> PrimExp v
    UnOpExp (FloatType -> UnOp
    FSignum FloatType
    Float64) PrimExp VName
    y), FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    0]
    pdBuiltin Name
    h [PrimExp VName
    x, PrimExp VName
    _y, PrimExp VName
    _z]
      | Just PrimType
    t <- Text -> Maybe PrimType
    isCondFun (Text -> Maybe PrimType) -> Text -> Maybe PrimType
    forall a b. (a -> b) -> a -> b
    $ Name -> Text
    nameToText Name
    h =
          [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just
            [ PrimType -> TPrimExp Bool VName -> PrimExp VName
    forall {k} {t :: k} {v}. PrimType -> TPrimExp t v -> PrimExp v
    boolToT PrimType
    t TPrimExp Bool VName
    forall v. TPrimExp Bool v
    false,
              PrimType -> TPrimExp Bool VName -> PrimExp VName
    forall {k} {t :: k} {v}. PrimType -> TPrimExp t v -> PrimExp v
    boolToT PrimType
    t (TPrimExp Bool VName -> PrimExp VName)
    -> TPrimExp Bool VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Bool VName
    forall v. PrimExp v -> TPrimExp Bool v
    isBool PrimExp VName
    x,
              PrimType -> TPrimExp Bool VName -> PrimExp VName
    forall {k} {t :: k} {v}. PrimType -> TPrimExp t v -> PrimExp v
    boolToT PrimType
    t (TPrimExp Bool VName -> PrimExp VName)
    -> TPrimExp Bool VName -> PrimExp VName
    forall a b. (a -> b) -> a -> b
    $ TPrimExp Bool VName -> TPrimExp Bool VName
    forall v. TPrimExp Bool v -> TPrimExp Bool v
    bNot (TPrimExp Bool VName -> TPrimExp Bool VName)
    -> TPrimExp Bool VName -> TPrimExp Bool VName
    forall a b. (a -> b) -> a -> b
    $ PrimExp VName -> TPrimExp Bool VName
    forall v. PrimExp v -> TPrimExp Bool v
    isBool PrimExp VName
    x
            ]
      where
        boolToT :: PrimType -> TPrimExp t v -> PrimExp v
    boolToT PrimType
    t = case PrimType
    t of
          IntType IntType
    it ->
            ConvOp -> PrimExp v -> PrimExp v
    forall v. ConvOp -> PrimExp v -> PrimExp v
    ConvOpExp (IntType -> ConvOp
    BToI IntType
    it) (PrimExp v -> PrimExp v)
    -> (TPrimExp t v -> PrimExp v) -> TPrimExp t v -> PrimExp v
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped
          FloatType FloatType
    ft ->
            ConvOp -> PrimExp v -> PrimExp v
    forall v. ConvOp -> PrimExp v -> PrimExp v
    ConvOpExp (IntType -> FloatType -> ConvOp
    SIToFP IntType
    Int32 FloatType
    ft) (PrimExp v -> PrimExp v)
    -> (TPrimExp t v -> PrimExp v) -> TPrimExp t v -> PrimExp v
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ConvOp -> PrimExp v -> PrimExp v
    forall v. ConvOp -> PrimExp v -> PrimExp v
    ConvOpExp (IntType -> ConvOp
    BToI IntType
    Int32) (PrimExp v -> PrimExp v)
    -> (TPrimExp t v -> PrimExp v) -> TPrimExp t v -> PrimExp v
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped
          PrimType
    Bool -> TPrimExp t v -> PrimExp v
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped
          PrimType
    Unit -> PrimExp v -> TPrimExp t v -> PrimExp v
    forall a b. a -> b -> a
    const (PrimExp v -> TPrimExp t v -> PrimExp v)
    -> PrimExp v -> TPrimExp t v -> PrimExp v
    forall a b. (a -> b) -> a -> b
    $ PrimValue -> PrimExp v
    forall v. PrimValue -> PrimExp v
    ValueExp PrimValue
    UnitValue
    -- More problematic derivatives follow below.
    pdBuiltin Name
    "umul_hi8" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "umul_hi16" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "umul_hi32" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "umul_hi64" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "umad_hi8" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int8 Integer
    1]
    pdBuiltin Name
    "umad_hi16" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int16 Integer
    1]
    pdBuiltin Name
    "umad_hi32" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    1]
    pdBuiltin Name
    "umad_hi64" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int64 Integer
    1]
    pdBuiltin Name
    "smul_hi8" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "smul_hi16" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "smul_hi32" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "smul_hi64" [PrimExp VName
    x, PrimExp VName
    y] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    y, PrimExp VName
    x]
    pdBuiltin Name
    "smad_hi8" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int8 Integer
    1]
    pdBuiltin Name
    "smad_hi16" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int16 Integer
    1]
    pdBuiltin Name
    "smad_hi32" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    1]
    pdBuiltin Name
    "smad_hi64" [PrimExp VName
    a, PrimExp VName
    b, PrimExp VName
    _c] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [PrimExp VName
    b, PrimExp VName
    a, IntType -> Integer -> PrimExp VName
    iConst IntType
    Int64 Integer
    1]
    pdBuiltin Name
    "isnan16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Bool VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp Bool VName
    forall v. TPrimExp Bool v
    false]
    pdBuiltin Name
    "isnan32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Bool VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp Bool VName
    forall v. TPrimExp Bool v
    false]
    pdBuiltin Name
    "isnan64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Bool VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp Bool VName
    forall v. TPrimExp Bool v
    false]
    pdBuiltin Name
    "isinf16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Bool VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp Bool VName
    forall v. TPrimExp Bool v
    false]
    pdBuiltin Name
    "isinf32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Bool VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp Bool VName
    forall v. TPrimExp Bool v
    false]
    pdBuiltin Name
    "isinf64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [TPrimExp Bool VName -> PrimExp VName
    forall {k} (t :: k) v. TPrimExp t v -> PrimExp v
    untyped TPrimExp Bool VName
    forall v. TPrimExp Bool v
    false]
    pdBuiltin Name
    "round16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    0]
    pdBuiltin Name
    "round32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    0]
    pdBuiltin Name
    "round64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    0]
    pdBuiltin Name
    "ceil16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    0]
    pdBuiltin Name
    "ceil32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    0]
    pdBuiltin Name
    "ceil64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    0]
    pdBuiltin Name
    "floor16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    0]
    pdBuiltin Name
    "floor32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    0]
    pdBuiltin Name
    "floor64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    0]
    pdBuiltin Name
    "nextafter16" [PrimExp VName
    _, PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    1, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float16 Double
    0]
    pdBuiltin Name
    "nextafter32" [PrimExp VName
    _, PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    1, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float32 Double
    0]
    pdBuiltin Name
    "nextafter64" [PrimExp VName
    _, PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    1, FloatType -> Double -> PrimExp VName
    fConst FloatType
    Float64 Double
    0]
    pdBuiltin Name
    "clz8" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "clz16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "clz32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "clz64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "ctz8" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "ctz16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "ctz32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "ctz64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "popc8" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "popc16" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "popc32" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    "popc64" [PrimExp VName
    _] = [PrimExp VName] -> Maybe [PrimExp VName]
    forall a. a -> Maybe a
    Just [IntType -> Integer -> PrimExp VName
    iConst IntType
    Int32 Integer
    0]
    pdBuiltin Name
    _ [PrimExp VName]
    _ = Maybe [PrimExp VName]
    forall a. Maybe a
    Nothing