hunk ./src/MathObj/Gaussian/Bell.hs 87
-let x=Cons (1+:3) (4+:5) (7::Rational); y=Cons (1+:4) (3+:2) (5::Rational)
+let x=Cons 2 (1+:3) (4+:5) (7::Rational); y=Cons 7 (1+:4) (3+:2) (5::Rational)
hunk ./src/MathObj/Gaussian/Bell.hs 108
-          ((amp f * amp g) / (c2 f + c2 g))
+          (amp f * amp g / s)
hunk ./src/MathObj/Gaussian/Bell.hs 128
+       s = c2 f1 + c2 g1
hunk ./src/MathObj/Gaussian/Bell.hs 131
-          ((amp f0 * amp g0) / (c2 f0 + c2 g0))
+          (amp f1 * amp g1 / s)
hunk ./src/MathObj/Gaussian/Bell.hs 133
-          (recip $ recip (c2 f1) + recip (c2 g1))
+          (c2 f1 * c2 g1 / s)
hunk ./src/MathObj/Gaussian/Bell.hs 145
-       c = c2 f
-       rc = recip c
+       rc = recip $ c2 f
hunk ./src/MathObj/Gaussian/Bell.hs 147
-          (amp f / c2 f)
+          (amp f * rc)
hunk ./src/MathObj/Gaussian/Bell.hs 274
-      (k^2 * c2 f)
+      (c2 f * k^2)
hunk ./src/MathObj/Gaussian/Polynomial.hs 60
-instance (Ring.C a, Ord a) => Eq (T a) where
+instance (Absolute.C a, Eq a) => Eq (T a) where
hunk ./src/MathObj/Gaussian/Polynomial.hs 63
+
+{-
+Helper data type for 'equal',
+that allows to call the (not quite trivial) polynomial equality check.
+@RootProduct r a@ represents @sqrt r * a@.
+The test using 'signum' works for real numbers,
+and I do not know, whether it is correct for other mathematical objects.
+However I cannot imagine other mathematical objects,
+that make sense at all, here.
+Maybe elements of a finite field.
+-}
+data RootProduct a = RootProduct a a
+
+instance (Absolute.C a, Eq a) => Eq (RootProduct a) where
+   (RootProduct xr xa) == (RootProduct yr ya)  =
+      let xp = xr*xa^2
+          yp = yr*ya^2
+      in  xp==yp &&
+          (isZero xp || signum xa == signum ya)
+
+instance (ZeroTestable.C a) => ZeroTestable.C (RootProduct a) where
+   isZero (RootProduct r a) = isZero r || isZero a
+
+
hunk ./src/MathObj/Gaussian/Polynomial.hs 92
-equal :: (Ring.C a, Ord a) => T a -> T a -> Bool
+equal :: (Absolute.C a, Eq a) => T a -> T a -> Bool
hunk ./src/MathObj/Gaussian/Polynomial.hs 96
-       csign c =
-          Complex.real c > 0 ||
-          (Complex.real c == 0 && Complex.imag c > 0)
hunk ./src/MathObj/Gaussian/Polynomial.hs 97
-          map (\c -> (Complex.scale (Bell.amp b) (c^2), csign c)) .
-          Poly.coeffs . polynomial
+          (\p ->
+              (fmap (RootProduct (Bell.amp b) . Complex.real) p,
+               fmap (RootProduct (Bell.amp b) . Complex.imag) p))
+           . polynomial
hunk ./src/MathObj/Gaussian/Polynomial.hs 108
-       scaleSqr by x == scaleSqr bx y
+       scaleSqr bx x == scaleSqr by y
hunk ./src/MathObj/Gaussian/Polynomial.hs 172
-eigenfunctionIterative :: (Field.C a, Ord a) => Int -> T a
+eigenfunctionIterative :: (Field.C a, Absolute.C a, Eq a) => Int -> T a
hunk ./src/MathObj/Gaussian/Polynomial.hs 197
-convolve :: (Field.C a) =>
+convolve, {- convolveByDifferentiation, -} convolveByFourier :: (Field.C a) =>
hunk ./src/MathObj/Gaussian/Polynomial.hs 199
-convolve f g =
+convolve = convolveByFourier
+
+{-
+f <*> g =
+   let (foff,fint) = integrate f
+   in  fint <*> differentiate g + makeGaussPoly foff * g
+
+In principle this would work,
+but (makeGaussPoly foff * g) contains a lot of
+convolutions of Gaussian with Gaussian-polynomial-product,
+where the Gaussians have different parameters.
+
+convolveByDifferentiation f g =
+   case polynomial f of
+      fpoly ->
+         if null $ Poly.coeffs fpoly
+           then ...
+           else ...
+-}
+
+convolveByFourier f g =
hunk ./src/MathObj/Gaussian/Polynomial.hs 230
-  = fourier (Cons bell (Poly.const a)) + C * differentiate (fourier (Cons bell f))
+  = fourier (Cons bell (Poly.const a)) + differentiate (fourier (Cons bell f))
hunk ./test/Test/MathObj/Gaussian/Polynomial.hs 55
+{-
+      ("convolution by differentiation vs. fourier",
+          simple $ \x y ->
+             G.convolveByDifferentiation x y
+              == G.convolveByFourier x y) :
+-}
hunk ./src/MathObj/Gaussian/Polynomial.hs 244
-{-
+{- |
hunk ./src/MathObj/Gaussian/Polynomial.hs 257
+
+g = (bell f * poly f)'
+  = bell f * ((poly f)' - (exppoly (bell f))' * poly f)
+poly g = (poly f)' - (exppoly (bell f))' * poly f
+
+Integration means we have g and ask for f.
+
+poly f = ((poly f)' - poly g) / (exppoly (bell f))'
+
+However must start with the highest term of 'poly f',
+and thus we need to perform the division on reversed polynomials.
hunk ./test/Test/MathObj/Gaussian/Polynomial.hs 128
+      ("differentiate integrate",
+          simple $ \x@(G.Cons b p) ->
+             let (xoff,xint) = G.integrate x
+             in  G.differentiate xint == G.Cons b (p + Poly.const xoff)) :
hunk ./test/Test/MathObj/Gaussian/Polynomial.hs 138
+      ("differentiate convolve",
+          simple $ \x y ->
+             G.convolve (G.differentiate x) y ==
+             G.convolve x (G.differentiate y)) :
hunk ./src/MathObj/Gaussian/Variance.hs 34
+{- |
+Since @amp@ is the square of the actual amplitude it must be non-negative.
+-}
hunk ./src/MathObj/Gaussian/Variance.hs 43
-         arbitrary
+         (fmap abs arbitrary)
hunk ./src/MathObj/Gaussian/Variance.hs 62
-norm1 :: (Algebraic.C a, Absolute.C a) => T a -> a
+norm1 :: (Algebraic.C a) => T a -> a
hunk ./src/MathObj/Gaussian/Variance.hs 64
-   sqrt $ abs (amp f) / c f
+   sqrt $ amp f / c f
hunk ./src/MathObj/Gaussian/Variance.hs 66
-norm2 :: (Algebraic.C a, Absolute.C a) => T a -> a
+norm2 :: (Algebraic.C a) => T a -> a
hunk ./src/MathObj/Gaussian/Variance.hs 68
-   sqrt $ abs (amp f) / (sqrt $ 2 * c f)
+   sqrt $ amp f / (sqrt $ 2 * c f)
hunk ./src/MathObj/Gaussian/Variance.hs 70
-normP :: (Trans.C a, Absolute.C a) => a -> T a -> a
+normInf :: (Algebraic.C a) => T a -> a
+normInf f =
+   sqrt (amp f)
+
+normP :: (Trans.C a) => a -> T a -> a
hunk ./src/MathObj/Gaussian/Variance.hs 76
-   sqrt (abs (amp f)) * (p * c f) ^? (- recip (2*p))
+   sqrt (amp f) * (p * c f) ^? (- recip (2*p))
hunk ./src/MathObj/Gaussian/Variance.hs 120
+{- |
+@amplify k@ scales by @abs k@!
+-}
hunk ./src/MathObj/Gaussian/Variance.hs 89
+powerRing :: (Trans.C a) =>
+   Integer -> T a -> T a
+powerRing p f =
+   Cons (amp f ^ p) (fromInteger p * c f)
+
+{-
+powerField does not makes sense,
+since the reciprocal of a Gaussian diverges.
+-}
+
+powerAlgebraic :: (Trans.C a) =>
+   Rational -> T a -> T a
+powerAlgebraic p f =
+   Cons (amp f ^/ p) (fromRational' p * c f)
+
+powerTranscendental :: (Trans.C a) =>
+   a -> T a -> T a
+powerTranscendental p f =
+   Cons (amp f ^? p) (p * c f)
+
hunk ./src/MathObj/Gaussian/Variance.hs 112
+
+Convergence only for @c f + c g > 0@.
hunk ./src/MathObj/Gaussian/Variance.hs 118
-   Cons
-      (amp f * amp g / (c f + c g))
-      (recip $ recip (c f) + recip (c g))
+   let s = c f + c g
+   in  Cons
+          (amp f * amp g / s)
+          (c f * c g / s)
hunk ./src/MathObj/Gaussian/Variance.hs 126
+
+Convergence only for @c f > 0@.
hunk ./numeric-prelude.cabal 2
-Version:        0.2.0.1
+Version:        0.2.1
hunk ./numeric-prelude.cabal 153
-  Tag:         0.2.0.1
+  Tag:         0.2.1
hunk ./numeric-prelude.cabal 254
+    Number.Root
addfile ./src/Number/Root.hs
hunk ./src/Number/Root.hs 1
+module Number.Root where
+
+import qualified Algebra.Algebraic as Algebraic
+import qualified Algebra.Field as Field
+import qualified Algebra.Ring as Ring
+
+import qualified MathObj.RootSet as RootSet
+import qualified Number.Ratio as Ratio
+
+import Algebra.IntegralDomain (safeDiv, )
+
+import qualified NumericPrelude.Numeric as NP
+import NumericPrelude.Numeric hiding (recip, )
+import NumericPrelude.Base
+import Prelude ()
+
+{- |
+The root degree must be positive.
+This way we can implement multiplication
+using only multiplication from type @a@.
+-}
+data T a = Cons Integer a
+   deriving (Show)
+
+{- |
+When you use @fmap@ you must assert that
+@forall n. fmap f (Cons d x) == fmap f (Cons (n*d) (x^n))@
+-}
+instance Functor T where
+   fmap f (Cons d x) = Cons d (f x)
+
+fromNumber :: a -> T a
+fromNumber = Cons 1
+
+toNumber :: Algebraic.C a => T a -> a
+toNumber (Cons n x) = Algebraic.root n x
+
+toRootSet :: Ring.C a => T a -> RootSet.T a
+toRootSet (Cons d x) =
+   RootSet.lift0 ([negate x] ++ replicate (pred (fromInteger d)) zero ++ [one])
+
+
+commonDegree :: Ring.C a => T a -> T a -> T (a,a)
+commonDegree (Cons xd x) (Cons yd y) =
+   let zd = lcm xd yd
+   in  Cons zd (x ^ safeDiv zd xd, y ^ safeDiv zd yd)
+
+instance (Eq a, Ring.C a) => Eq (T a) where
+   x == y  =
+      case commonDegree x y of
+         Cons _ (xn,yn) -> xn==yn
+
+instance (Ord a, Ring.C a) => Ord (T a) where
+   compare x y  =
+      case commonDegree x y of
+         Cons _ (xn,yn) -> compare xn yn
+
+
+mul :: Ring.C a => T a -> T a -> T a
+mul x y = fmap (uncurry (*)) $ commonDegree x y
+
+div :: Field.C a => T a -> T a -> T a
+div x y = fmap (uncurry (/)) $ commonDegree x y
+
+recip :: Field.C a => T a -> T a
+recip = fmap NP.recip
+
+{- |
+exponent must be non-negative
+-}
+cardinalPower :: Ring.C a => Integer -> T a -> T a
+cardinalPower n (Cons d x) =
+   let m = gcd n d
+   in  Cons (safeDiv d m) (x ^ safeDiv n m)
+
+{- |
+exponent can be negative
+-}
+integerPower :: Field.C a => Integer -> T a -> T a
+integerPower n =
+   if n<0
+     then cardinalPower (-n) . recip
+     else cardinalPower n
+
+rationalPower :: Field.C a => Rational -> T a -> T a
+rationalPower n =
+   integerPower (Ratio.numerator n) .
+   root (Ratio.denominator n)
+
+{- |
+exponent must be positive
+-}
+root :: Ring.C a => Integer -> T a -> T a
+root n (Cons d x) = Cons (d*n) x
+
+sqrt :: Ring.C a => T a -> T a
+sqrt = root 2
hunk ./src/MathObj/Gaussian/Variance.hs 13
+import qualified Number.Root as Root
hunk ./src/MathObj/Gaussian/Variance.hs 18
-import qualified Algebra.Absolute           as Absolute
+import qualified Algebra.Absolute       as Absolute
hunk ./src/MathObj/Gaussian/Variance.hs 62
+
+norm1Root :: (Field.C a) => T a -> Root.T a
+norm1Root f =
+   Root.sqrt $ Root.fromNumber $ amp f / c f
+
+norm2Root :: (Field.C a) => T a -> Root.T a
+norm2Root f =
+   Root.sqrt $
+      Root.fromNumber (amp f)
+      `Root.div`
+      Root.sqrt (Root.fromNumber $ 2 * c f)
+
+normInfRoot :: (Field.C a) => T a -> Root.T a
+normInfRoot f =
+   Root.sqrt $ Root.fromNumber $ amp f
+
+normPRoot :: (Field.C a) => Rational -> T a -> Root.T a
+normPRoot p f =
+   Root.sqrt (Root.fromNumber (amp f))
+   `Root.div`
+   Root.rationalPower (recip (2*p)) (Root.fromNumber (fromRational' p * c f))
+
hunk ./test/Test/MathObj/Gaussian/Variance.hs 7
+import qualified Number.Root as Root
hunk ./test/Test/MathObj/Gaussian/Variance.hs 17
+import Data.Bool.HT (if', )
hunk ./test/Test/MathObj/Gaussian/Variance.hs 24
+{- |
+From two numbers, generate @p@ and @q@, such that
+
+> 1/p + 1/q = 1
+-}
+hoelderConjugates ::
+   (Integer,Integer) -> (Rational,Rational)
+hoelderConjugates (p0,q0) =
+   let p1 = 1 + abs p0
+       q1 = 1 + abs q0
+       s  = 1%p1 + 1%q1
+   in  (fromInteger p1 * s, fromInteger q1 * s)
+
+{- |
+From three rational numbers, generate @p@, @q@ and @r@, such that
+
+> 1/p + 1/q = 1/r + 1
+
+Find positive natural numbers @a, b, c, d@ with
+
+> a + b = c + d
+
+and
+
+> d >= a, d >= b, d >= c
+
+then set
+
+> p=d/a, q=d/b, r=d/c
+
+
+a+b<=c
+b+c<=a
+->  2b <= 0
+-}
+youngConjugates ::
+   (Integer,Integer,Integer) -> (Rational,Rational,Rational)
+youngConjugates (a0,b0,c0) =
+   let a1 = 1 + abs a0
+       b1 = 1 + abs b0
+       c1 = 1 + abs c0
+       (a2,b2,c2) =
+          if' (a1+b1>c1) (a1,b1,c1) $
+          if' (b1+c1>a1) (b1,c1,a1) $
+          error "cannot occur"
+--          (c1,a1,b1)  -- this case only occurs when a1==c1
+       d2 = a2+b2-c2
+       guardSwap cond (x,y) =
+          if cond then (x,y) else (y,x)
+       (a3,b3) = guardSwap (a2<=b2) (a2,b2)
+       (c3,d3) = guardSwap (c2<=d2) (c2,d2)
+       ((a4,b4),(c4,d4)) = guardSwap (b3<=d3) ((a3,b3), (c3,d3))
+   in  (d4%a4, d4%b4, d4%c4)
+
+
hunk ./test/Test/MathObj/Gaussian/Variance.hs 87
-   HUnit.TestLabel "polynomial" $
+   HUnit.TestLabel "variance" $
hunk ./test/Test/MathObj/Gaussian/Variance.hs 90
+   testList
+
+testList :: [(String, IO ())]
+testList =
hunk ./test/Test/MathObj/Gaussian/Variance.hs 123
+      ("norm1 vs. normP 1",
+          simple $ \x -> G.norm1Root x == G.normPRoot 1 x) :
+      ("norm2 vs. normP 2",
+          simple $ \x -> G.norm2Root x == G.normPRoot 2 x) :
+{-
+I would have liked to test for a monotony of norms.
+Unfortunately, it does not hold.
+
+Means contain a division by the size of the domain.
+Norms do not have this division.
+Means are monotonic with respect to the degree.
+Norms are not.
+We cannot turn the norms into means since the size of the domain
+(the complete real axis) is infinitely large.
+      ("norm monotony",
+          simple $ \x p0 q0 ->
+             let p = 1 + abs p0
+                 q = 1 + abs q0
+             in  case compare p q of
+                    EQ -> G.normPRoot p x == G.normPRoot q x
+                    LT -> G.normPRoot p x <= G.normPRoot q x
+                    GT -> G.normPRoot p x >= G.normPRoot q x) :
+
+This should also fail,
+but QuickCheck does not seem to try counterexamples.
+      ("infinity norm upper bound",
+          simple $ \x p0 ->
+             let p = 1 + abs p0
+             in  G.normPRoot p x <= G.normInfRoot x) :
+-}
+      ("Cauchy-Schwarz inequality",
+          simple $ \x y ->
+             G.norm1Root (G.multiply x y)
+                <= G.norm2Root x `Root.mul` G.norm2Root y) :
+      ("Hoelder conjugates",
+          quickCheck $ \pq ->
+             case hoelderConjugates pq of
+                (p,q) -> p>=1 && q>=1 && 1/p + 1/q == 1) :
+      ("Hoelder inequality with infinity norm",
+          simple $ \x y ->
+             G.norm1Root (G.multiply x y)
+                <= G.norm1Root x `Root.mul` G.normInfRoot y) :
+      ("Hoelder inequality",
+          simple $ \x y pq ->
+             case hoelderConjugates pq of
+                (p,q) ->
+                   G.norm1Root (G.multiply x y)
+                      <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
+      ("Young inequality with two infinity norms",
+          simple $ \x y ->
+             G.normInfRoot (G.convolve x y)
+                <= G.norm1Root x `Root.mul` G.normInfRoot y) :
+      ("Young inequality with infinity norm",
+          simple $ \x y pq ->
+             case hoelderConjugates pq of
+                (p,q) ->
+                   G.normInfRoot (G.convolve x y)
+                      <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
+      ("Young conjugates",
+          quickCheck $ \pqr ->
+             case youngConjugates pqr of
+                (p,q,r) -> p>=1 && q>=1 && r>=1 && 1/p + 1/q == 1/r + 1) :
+      ("Young inequality",
+          simple $ \x y pqr ->
+             case youngConjugates pqr of
+                (p,q,r) ->
+                   G.normPRoot r (G.convolve x y)
+                      <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
hunk ./test/Test/MathObj/Gaussian/Variance.hs 14
-import Test.QuickCheck (Testable, quickCheck, (==>))
+import Test.QuickCheck (Testable, quickCheck, (==>), Arbitrary, arbitrary, )
hunk ./test/Test/MathObj/Gaussian/Variance.hs 17
-import Data.Bool.HT (if', )
-import Data.Function.HT (nest, )
+import Control.Monad (liftM2, liftM3, )
+
+import Data.Function.HT (nest, compose2, )
hunk ./test/Test/MathObj/Gaussian/Variance.hs 25
+newtype PositiveInteger = PositiveInteger Integer
+   deriving Show
+
+instance Arbitrary PositiveInteger where
+   arbitrary =
+      fmap (\p -> PositiveInteger $ 1 + abs p) arbitrary
+
+
hunk ./test/Test/MathObj/Gaussian/Variance.hs 34
-From two numbers, generate @p@ and @q@, such that
+For @(HoelderConjugates p q)@ it holds
hunk ./test/Test/MathObj/Gaussian/Variance.hs 38
-hoelderConjugates ::
-   (Integer,Integer) -> (Rational,Rational)
-hoelderConjugates (p0,q0) =
-   let p1 = 1 + abs p0
-       q1 = 1 + abs q0
-       s  = 1%p1 + 1%q1
-   in  (fromInteger p1 * s, fromInteger q1 * s)
+data HoelderConjugates = HoelderConjugates Rational Rational
+   deriving Show
+
+instance Arbitrary HoelderConjugates where
+   arbitrary = liftM2
+      (\(PositiveInteger p) (PositiveInteger q) ->
+         let s  = 1%p + 1%q
+         in  HoelderConjugates (fromInteger p * s) (fromInteger q * s))
+      arbitrary arbitrary
hunk ./test/Test/MathObj/Gaussian/Variance.hs 49
-From three rational numbers, generate @p@, @q@ and @r@, such that
+For @(YoungConjugates p q r)@ it holds
hunk ./test/Test/MathObj/Gaussian/Variance.hs 52
+-}
+data YoungConjugates = YoungConjugates Rational Rational Rational
+   deriving Show
hunk ./test/Test/MathObj/Gaussian/Variance.hs 56
+{-
hunk ./test/Test/MathObj/Gaussian/Variance.hs 74
-youngConjugates ::
-   (Integer,Integer,Integer) -> (Rational,Rational,Rational)
-youngConjugates (a0,b0,c0) =
-   let a1 = 1 + abs a0
-       b1 = 1 + abs b0
-       c1 = 1 + abs c0
-       (a2,b2,c2) =
-          if' (a1+b1>c1) (a1,b1,c1) $
-          if' (b1+c1>a1) (b1,c1,a1) $
-          error "cannot occur"
---          (c1,a1,b1)  -- this case only occurs when a1==c1
-       d2 = a2+b2-c2
-       guardSwap cond (x,y) =
-          if cond then (x,y) else (y,x)
-       (a3,b3) = guardSwap (a2<=b2) (a2,b2)
-       (c3,d3) = guardSwap (c2<=d2) (c2,d2)
-       ((a4,b4),(c4,d4)) = guardSwap (b3<=d3) ((a3,b3), (c3,d3))
-   in  (d4%a4, d4%b4, d4%c4)
+instance Arbitrary YoungConjugates where
+   arbitrary = liftM3
+      (\(PositiveInteger a0) (PositiveInteger b0) (PositiveInteger c0) ->
+         let guardSwap cond (x,y) =
+                if cond x y then (x,y) else (y,x)
+             {-
+             If a+b<=c, then from b>0 it follows a<c and thus c+b>a.
+             Swapping a and c is enough and we have not to consider more cases.
+             -}
+             (a1,c1) = guardSwap (\a c -> a+b0>c) (a0,c0)
+             b1 = b0
+             d1 = a1+b1-c1
+             ((a2,b2),(c2,d2)) =
+                guardSwap (compose2 (<=) snd)
+                   (guardSwap (<=) (a1,b1),
+                    guardSwap (<=) (c1,d1))
+         in  YoungConjugates (d2%a2) (d2%b2) (d2%c2))
+      arbitrary arbitrary arbitrary
hunk ./test/Test/MathObj/Gaussian/Variance.hs 173
-          quickCheck $ \pq ->
-             case hoelderConjugates pq of
-                (p,q) -> p>=1 && q>=1 && 1/p + 1/q == 1) :
+          quickCheck $ \(HoelderConjugates p q) ->
+             p>=1 && q>=1 && 1/p + 1/q == 1) :
hunk ./test/Test/MathObj/Gaussian/Variance.hs 180
-          simple $ \x y pq ->
-             case hoelderConjugates pq of
-                (p,q) ->
-                   G.norm1Root (G.multiply x y)
-                      <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
+          simple $ \x y (HoelderConjugates p q) ->
+             G.norm1Root (G.multiply x y)
+                <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
hunk ./test/Test/MathObj/Gaussian/Variance.hs 188
-          simple $ \x y pq ->
-             case hoelderConjugates pq of
-                (p,q) ->
-                   G.normInfRoot (G.convolve x y)
-                      <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
+          simple $ \x y (HoelderConjugates p q) ->
+             G.normInfRoot (G.convolve x y)
+                <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
hunk ./test/Test/MathObj/Gaussian/Variance.hs 192
-          quickCheck $ \pqr ->
-             case youngConjugates pqr of
-                (p,q,r) -> p>=1 && q>=1 && r>=1 && 1/p + 1/q == 1/r + 1) :
+          quickCheck $ \(YoungConjugates p q r) ->
+             p>=1 && q>=1 && r>=1 && 1/p + 1/q == 1/r + 1) :
hunk ./test/Test/MathObj/Gaussian/Variance.hs 195
-          simple $ \x y pqr ->
-             case youngConjugates pqr of
-                (p,q,r) ->
-                   G.normPRoot r (G.convolve x y)
-                      <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
+          simple $ \x y (YoungConjugates p q r) ->
+             G.normPRoot r (G.convolve x y)
+                <= G.normPRoot p x `Root.mul` G.normPRoot q y) :
hunk ./src/MathObj/Gaussian/Bell.hs 13
-import qualified Algebra.Absolute           as Absolute
+import qualified Algebra.Absolute       as Absolute
hunk ./src/MathObj/Gaussian/Bell.hs 36
-         (\k a b c -> Cons k a b (1 + abs c))
+         (\k a b c -> Cons (abs k) a b (1 + abs c))
hunk ./src/MathObj/Gaussian/Bell.hs 85
+powerRing :: (Trans.C a) =>
+   Integer -> T a -> T a
+powerRing p f =
+   let pa = fromInteger p
+   in  Cons
+          (amp f ^ p)
+          (pa * c0 f) (pa * c1 f) (fromInteger p * c2 f)
+
+{-
+powerField does not makes sense,
+since the reciprocal of a Gaussian diverges.
+-}
+
+powerAlgebraic :: (Trans.C a) =>
+   Rational -> T a -> T a
+powerAlgebraic p f =
+   let pa = fromRational' p
+   in  Cons
+          (amp f ^/ p)
+          (pa * c0 f) (pa * c1 f) (fromRational' p * c2 f)
+
+powerTranscendental :: (Trans.C a) =>
+   a -> T a -> T a
+powerTranscendental p f =
+   Cons
+      (amp f ^? p)
+      (Complex.scale p $ c0 f) (Complex.scale p $ c1 f) (p * c2 f)
+
