newtype Fixed r { } #
Fixed Integer
type FixedS16 = Fixed S16 { } #
16-bit signed fixed point (1/65536 resolution).
type FixedS32 = Fixed S32 { } #
32-bit signed fixed point (1/4294967296 resolution).
type FixedU16 = Fixed U16 { } #
16-bit unsigned fixed point.
type FixedU32 = Fixed U32 { } #
32-bit unsigned fixed point.
type Rational = Ratio Integer { } #
data RoundingMode { } #
RoundNearest

Round to nearest, ties to even

RoundDown

Round toward negative infinity

RoundUp

Round toward positive infinity

RoundToZero

Round toward zero

IEEE 754 rounding modes.
data FPException { } #
FPInvalid

Invalid operation (e.g., sqrt(-1))

FPDivByZero

Division by zero

FPOverflow

Result too large

FPUnderflow

Result too small

FPInexact

Rounded result

Floating point exception flags.
class Num a => Real a { } #

Methods

toRational :: a -> Rational
Real numbers (can convert to Rational).
class Real a, Enum a => Integral a { } #

Methods

quot :: a -> a -> a
rem :: a -> a -> a
div :: a -> a -> a
mod :: a -> a -> a
quotRem :: a -> a -> (a, a)
divMod :: a -> a -> (a, a)
toInteger :: a -> Integer
Integral numbers.
class Num a => Fractional a { } #

Methods

/ :: a -> a -> a
recip :: a -> a
fromRational :: Rational -> a
Fractional numbers.
class Fractional a => Floating a { } #

Methods

pi :: a
exp :: a -> a
log :: a -> a
sqrt :: a -> a
** :: a -> a -> a
logBase :: a -> a -> a
sin :: a -> a
cos :: a -> a
tan :: a -> a
asin :: a -> a
acos :: a -> a
atan :: a -> a
sinh :: a -> a
cosh :: a -> a
tanh :: a -> a
asinh :: a -> a
acosh :: a -> a
atanh :: a -> a
Floating point numbers.
class Real a, Fractional a => RealFrac a { } #

Methods

properFraction :: (Integral b) => a -> (b, a)
truncate :: (Integral b) => a -> b
round :: (Integral b) => a -> b
ceiling :: (Integral b) => a -> b
floor :: (Integral b) => a -> b
Real fractional numbers.
class RealFrac a, Floating a => RealFloat a { } #

Methods

floatRadix :: a -> Integer
floatDigits :: a -> Int
floatRange :: a -> (Int, Int)
decodeFloat :: a -> (Integer, Int)
encodeFloat :: Integer -> Int -> a
exponent :: a -> Int
significand :: a -> a
scaleFloat :: Int -> a -> a
isNaN :: a -> Bool
isInfinite :: a -> Bool
isDenormalized :: a -> Bool
isNegativeZero :: a -> Bool
isIEEE :: a -> Bool
atan2 :: a -> a -> a
Real floating point numbers.
class NumericPrimitive a { } #
Primitive numeric types.
class Unboxed a { } #
Unboxed types.
class SimdPrimitive v a { } #

Methods

simdWidth :: v -> Int
SIMD primitive types.
class Eq a => Bits a { } #

Methods

.&. :: a -> a -> a
.|. :: a -> a -> a
xor :: a -> a -> a
complement :: a -> a
shift :: a -> Int -> a
shiftL :: a -> Int -> a
shiftR :: a -> Int -> a
rotate :: a -> Int -> a
rotateL :: a -> Int -> a
rotateR :: a -> Int -> a
bit :: Int -> a
setBit :: a -> Int -> a
clearBit :: a -> Int -> a
complementBit :: a -> Int -> a
testBit :: a -> Int -> Bool
bitSize :: a -> Int
bitSizeMaybe :: a -> Maybe Int
isSigned :: a -> Bool
popCount :: a -> Int
Class for types with bit operations.
class Bits a => FiniteBits a { } #

Methods

finiteBitSize :: a -> Int
countLeadingZeros :: a -> Int
countTrailingZeros :: a -> Int
Bits with finite size.
class Enum a { } #
class Bounded a { } #
resolution :: (Fixed r) -> Integer { } #
Get resolution of fixed-point type.
mkFixed :: Integer -> Fixed r { } #
Create fixed-point from integer.
fromFixed :: (Fixed r) -> Integer { } #
Convert fixed to integer (truncates).
fixedToRational :: (Fixed r) -> Rational { } #
Convert fixed to exact Rational.
realPart :: (Complex a) -> a { } #
imagPart :: (Complex a) -> a { } #
Extract imaginary part.
mkPolar :: (Floating a) => a -> a -> Complex a { } #
Create from polar coordinates.
cis :: (Floating a) => a -> Complex a { } #
Unit complex from angle.
polar :: (RealFloat a) => (Complex a) -> (a, a) { } #
Convert to polar form (magnitude, phase).
magnitude :: (RealFloat a) => (Complex a) -> a { } #
Magnitude (absolute value).
phase :: (RealFloat a) => (Complex a) -> a { } #
Phase angle.
conjugate :: (Num a) => (Complex a) -> Complex a { } #
Complex conjugate.
numerator :: (Ratio a) -> a { } #
denominator :: (Ratio a) -> a { } #
Extract denominator.
approxRational :: (RealFrac a) => a -> a -> Rational { } #
Approximate rational.
vec2f32 :: Float -> Float -> Vec2F32 { } #
vec4f32 :: Float -> Float -> Float -> Float -> Vec4F32 { } #
Create 4-element Float vector.
vec8f32 :: Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Vec8F32 { } #
Create 8-element Float vector.
vec16f32 :: Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Vec16F32 { } #
Create 16-element Float vector.
vec2f64 :: Double -> Double -> Vec2F64 { } #
Create 2-element Double vector.
vec4f64 :: Double -> Double -> Double -> Double -> Vec4F64 { } #
Create 4-element Double vector.
vec8f64 :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Vec8F64 { } #
Create 8-element Double vector.
vec2i32 :: Int32 -> Int32 -> Vec2I32 { } #
Create 2-element Int32 vector.
vec4i32 :: Int32 -> Int32 -> Int32 -> Int32 -> Vec4I32 { } #
Create 4-element Int32 vector.
vec8i32 :: Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Vec8I32 { } #
Create 8-element Int32 vector.
vec16i32 :: Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Vec16I32 { } #
Create 16-element Int32 vector.
vec2i64 :: Int64 -> Int64 -> Vec2I64 { } #
Create 2-element Int64 vector.
vec4i64 :: Int64 -> Int64 -> Int64 -> Int64 -> Vec4I64 { } #
Create 4-element Int64 vector.
vec8i64 :: Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> Vec8I64 { } #
Create 8-element Int64 vector.
broadcast :: (SimdPrimitive v a) => a -> v { } #
Broadcast scalar to all elements.
fromList :: (SimdPrimitive v a) => [a] -> v { } #
Create vector from list.
toList :: (SimdPrimitive v a) => v -> [a] { } #
Convert vector to list.
extract :: (SimdPrimitive v a) => Int -> v -> a { } #
Extract element at index.
insert :: (SimdPrimitive v a) => Int -> a -> v -> v { } #
Insert element at index.
shuffle :: (SimdPrimitive v a) => [Int] -> v -> v { } #
Shuffle elements using mask.
permute :: (SimdPrimitive v a) => [Int] -> v -> v -> v { } #
Permute elements.
vAdd :: (SimdPrimitive v a) => v -> v -> v { } #
Vector addition.
vSub :: (SimdPrimitive v a) => v -> v -> v { } #
Vector subtraction.
vMul :: (SimdPrimitive v a) => v -> v -> v { } #
Vector multiplication.
vDiv :: (SimdPrimitive v a) => v -> v -> v { } #
Vector division.
vNeg :: (SimdPrimitive v a) => v -> v { } #
Vector negation.
vAbs :: (SimdPrimitive v a) => v -> v { } #
Vector absolute value.
vMin :: (SimdPrimitive v a) => v -> v -> v { } #
Element-wise minimum.
vMax :: (SimdPrimitive v a) => v -> v -> v { } #
Element-wise maximum.
vSqrt :: (SimdPrimitive v a) => v -> v { } #
Vector square root.
vRsqrt :: (SimdPrimitive v a) => v -> v { } #
Reciprocal square root (approximate).
vRcp :: (SimdPrimitive v a) => v -> v { } #
Reciprocal (approximate).
vFMA :: (SimdPrimitive v a) => v -> v -> v -> v { } #
Fused multiply-add: a * b + c.
vFMS :: (SimdPrimitive v a) => v -> v -> v -> v { } #
Fused multiply-subtract: a * b - c.
vEq :: (SimdPrimitive v a) => v -> v -> v { } #
Vector equality comparison.
vNe :: (SimdPrimitive v a) => v -> v -> v { } #
Vector inequality comparison.
vLt :: (SimdPrimitive v a) => v -> v -> v { } #
Vector less-than comparison.
vLe :: (SimdPrimitive v a) => v -> v -> v { } #
Vector less-equal comparison.
vGt :: (SimdPrimitive v a) => v -> v -> v { } #
Vector greater-than comparison.
vGe :: (SimdPrimitive v a) => v -> v -> v { } #
Vector greater-equal comparison.
vAnd :: (SimdPrimitive v a) => v -> v -> v { } #
Bitwise AND.
vOr :: (SimdPrimitive v a) => v -> v -> v { } #
Bitwise OR.
vXor :: (SimdPrimitive v a) => v -> v -> v { } #
Bitwise XOR.
vAndNot :: (SimdPrimitive v a) => v -> v -> v { } #
Bitwise AND-NOT.
vSelect :: (SimdPrimitive v a) => v -> v -> v -> v { } #
Select elements based on mask.
vSum :: (SimdPrimitive v a) => v -> a { } #
Sum all elements.
vProduct :: (SimdPrimitive v a) => v -> a { } #
Product of all elements.
vMin1 :: (SimdPrimitive v a) => v -> a { } #
Minimum element.
vMax1 :: (SimdPrimitive v a) => v -> a { } #
Maximum element.
vHAdd :: (SimdPrimitive v a) => v -> v -> v { } #
Horizontal add (adjacent pairs).
vHSub :: (SimdPrimitive v a) => v -> v -> v { } #
Horizontal subtract (adjacent pairs).
vLoad :: (SimdPrimitive v a) => (Ptr a) -> IO v { } #
Load vector from memory.
vLoadAligned :: (SimdPrimitive v a) => (Ptr a) -> IO v { } #
Load from aligned memory.
vStore :: (SimdPrimitive v a) => (Ptr a) -> v -> IO () { } #
Store vector to memory.
vStoreAligned :: (SimdPrimitive v a) => (Ptr a) -> v -> IO () { } #
Store to aligned memory.
vMaskedLoad :: (SimdPrimitive v a) => v -> (Ptr a) -> v -> IO v { } #
Masked load.
vMaskedStore :: (SimdPrimitive v a) => (Ptr a) -> v -> v -> IO () { } #
Masked store.
vGather :: (SimdPrimitive v a) => (Ptr a) -> Vec4I32 -> v { } #
Gather from non-contiguous memory.
vScatter :: (SimdPrimitive v a) => (Ptr a) -> Vec4I32 -> v -> IO () { } #
Scatter to non-contiguous memory.
negate :: a -> a { } #
abs :: a -> a { } #
signum :: a -> a { } #
fromInteger :: Integer -> a { } #
fromIntegral :: (Integral a, Num b) => a -> b { } #
Convert between integral types.
realToFrac :: (Real a, Fractional b) => a -> b { } #
Convert between fractional types.
infinity :: (RealFloat a) => a { } #
Positive infinity.
negInfinity :: (RealFloat a) => a { } #
Negative infinity.
nan :: (RealFloat a) => a { } #
Not a number.
minNormal :: (RealFloat a) => a { } #
Smallest positive normal.
maxFinite :: (RealFloat a) => a { } #
Largest finite value.
epsilon :: (RealFloat a) => a { } #
Machine epsilon.
e :: (Floating a) => a { } #
Euler's number.
gcd :: (Integral a) => a -> a -> a { } #
Greatest common divisor.
lcm :: (Integral a) => a -> a -> a { } #
Least common multiple.
subtract :: (Num a) => a -> a -> a { } #
Subtraction (flip of -).
even :: (Integral a) => a -> Bool { } #
Test if even.
odd :: (Integral a) => a -> Bool { } #
Test if odd.
^ :: (Num a, Integral b) => a -> b -> a { } #
Integer power.
^^ :: (Fractional a, Integral b) => a -> b -> a { } #
Fractional power.
sum :: (Num a) => [a] -> a { } #
Sum of list.
product :: (Num a) => [a] -> a { } #
Product of list.
kahanSum :: (RealFloat a) => [a] -> a { } #
Kahan compensated summation.
pairwiseSum :: (RealFloat a) => [a] -> a { } #
Pairwise summation.
neumaierSum :: (RealFloat a) => [a] -> a { } #
Neumaier summation (improved Kahan).
mean :: (Fractional a) => [a] -> a { } #
Arithmetic mean.
variance :: (Floating a) => [a] -> a { } #
Sample variance.
stddev :: (Floating a) => [a] -> a { } #
Standard deviation.
covariance :: (Floating a) => [a] -> [a] -> a { } #
Sample covariance.
correlation :: (Floating a) => [a] -> [a] -> a { } #
Pearson correlation coefficient.
enumFromTo :: (Enum a) => a -> a -> [a] { } #
Enumeration from start to end.
enumFromThenTo :: (Enum a) => a -> a -> a -> [a] { } #
Enumeration with step.
range :: Int -> Int -> [Int] { } #
Integer range.
linspace :: (Fractional a) => a -> a -> Int -> [a] { } #
Linear spacing.
logspace :: (Floating a) => a -> a -> Int -> [a] { } #
Logarithmic spacing.
geomspace :: (Floating a) => a -> a -> Int -> [a] { } #
Geometric spacing.
maxBound :: (Bounded a) => a { } #
Maximum value for bounded type.
minBound :: (Bounded a) => a { } #
Minimum value for bounded type.
setRoundingMode :: RoundingMode -> IO () { } #
Set current rounding mode.
getRoundingMode :: IO RoundingMode { } #
Get current rounding mode.
withRoundingMode :: RoundingMode -> (IO a) -> IO a { } #
Execute with specific rounding mode.
getFPExceptions :: IO [FPException] { } #
Get current FP exception flags.
clearFPExceptions :: IO () { } #
Clear all FP exception flags.
enableFPException :: FPException -> IO () { } #
Enable trapping for exception.
disableFPException :: FPException -> IO () { } #
Disable trapping for exception.