Safe Haskell | None |
---|
Synopsis
- data Fraction a
- data Func
- eval :: Floating a => Fraction a -> a -> a
- calculator :: Floating a => Func -> a -> a
- cheatsheet :: Floating a => Func -> Fraction a
- simplify :: (Eq a, Floating a) => Fraction a -> Fraction a
- rewrite :: (Fractional a, Eq a) => Fraction a -> Fraction a
- diff :: (Eq a, Floating a) => Fraction a -> Fraction a
- diffS :: (Eq a, Floating a) => Fraction a -> Fraction a
Documentation
X | |
Constf a | |
(Fraction a) :+: (Fraction a) infixl 6 | |
(Fraction a) :*: (Fraction a) infixl 7 | |
(Fraction a) :/: (Fraction a) infixl 7 | |
Apply Func (Fraction a) |
Instances
Eq a => Eq (Fraction a) Source # | |
Floating a => Floating (Fraction a) Source # | |
Defined in AronSymbolicAlgebra exp :: Fraction a -> Fraction a log :: Fraction a -> Fraction a sqrt :: Fraction a -> Fraction a (**) :: Fraction a -> Fraction a -> Fraction a logBase :: Fraction a -> Fraction a -> Fraction a sin :: Fraction a -> Fraction a cos :: Fraction a -> Fraction a tan :: Fraction a -> Fraction a asin :: Fraction a -> Fraction a acos :: Fraction a -> Fraction a atan :: Fraction a -> Fraction a sinh :: Fraction a -> Fraction a cosh :: Fraction a -> Fraction a tanh :: Fraction a -> Fraction a asinh :: Fraction a -> Fraction a acosh :: Fraction a -> Fraction a atanh :: Fraction a -> Fraction a log1p :: Fraction a -> Fraction a expm1 :: Fraction a -> Fraction a | |
Fractional a => Fractional (Fraction a) Source # | |
Defined in AronSymbolicAlgebra | |
Num a => Num (Fraction a) Source # | |
Defined in AronSymbolicAlgebra | |
Show a => Show (Fraction a) Source # | |
calculator :: Floating a => Func -> a -> a Source #
cheatsheet :: Floating a => Func -> Fraction a Source #
rewrite :: (Fractional a, Eq a) => Fraction a -> Fraction a Source #
rewrite (f :*: (g :*: h)) = rewrite (f :*: g) :*: rewrite h rewrite (f :+: (g :+: h)) = rewrite (f :+: g) :+: rewrite h rewrite (f :/: Constf 1) = f rewrite (Constf a :*: Constf b) = Constf (a * b) rewrite (Constf a :+: Constf b) = Constf (a + b) rewrite (f :*: Constf a) = Constf a :*: f rewrite (Constf a :*: f :+: Constf b :*: g) | f == g = rewrite (Constf a :+: Constf b) :*: rewrite f | otherwise = rewrite (Constf a :*: f) :+: rewrite (Constf b :*: g) rewrite (Apply func (Constf a)) = Constf (calculator func a) rewrite (f :+: g) = Constf 1 :*: f :+: Constf 1 :*: g rewrite (f :*: g) = rewrite f :*: rewrite g rewrite (f :: g) = rewrite f :: rewrite g rewrite f = f