summaryrefslogtreecommitdiff
path: root/Algebra/Field/AlgebraicReal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Algebra/Field/AlgebraicReal.hs')
-rw-r--r--Algebra/Field/AlgebraicReal.hs19
1 files changed, 2 insertions, 17 deletions
diff --git a/Algebra/Field/AlgebraicReal.hs b/Algebra/Field/AlgebraicReal.hs
index bda7c1c..940bc46 100644
--- a/Algebra/Field/AlgebraicReal.hs
+++ b/Algebra/Field/AlgebraicReal.hs
@@ -150,6 +150,8 @@ instance RightModule (Fraction Integer) Algebraic where
instance Multiplicative Algebraic where
(*) = multA
{-# INLINE (*) #-}
+ pow1p a = powA a . succ
+ {-# INLINE pow1p #-}
instance LeftModule (Scalar (Fraction Integer)) Algebraic where
(.*) = multA . Rational . runScalar
@@ -308,10 +310,6 @@ sqFreePart f = f `quot` gcd f (diff 0 f)
minusA (plusA x y) x = y
"plusminus/left" [~1] forall x (y :: Algebraic) .
plusA x (minusA y x) = y
-"plus-zero-left" [~1] forall x.
- plusA 0 x = x
-"plus-zero-right" [~1] forall x.
- plusA x 0 = x
#-}
plusA :: Algebraic -> Algebraic -> Algebraic
@@ -368,11 +366,6 @@ catcher _ _ _ _ = error "rational is impossible"
normalize :: (Eq r, Euclidean r, Division r) => Unipol r -> Unipol r
normalize = monoize . sqFreePart
-shiftP :: (Domain r, Division r, Eq r, Euclidean r)
- => Unipol r -> Unipol r
-shiftP f | isZero (coeff one f) = f `quot` var 0
- | otherwise = f
-
stabilize :: Algebraic -> Algebraic
stabilize r@Rational{} = r
stabilize ar@(Algebraic f ss int)
@@ -525,10 +518,6 @@ multA a b =
int = catcher multInt fg (stabilize a) (stabilize b)
in fromJust $ algebraic fg int
-defEqn :: Algebraic -> Unipol Rational
-defEqn (Rational a) = var 0 - injectCoeff a
-defEqn a@Algebraic{} = eqn a
-
improveNonzero :: Algebraic -> Interval Rational
improveNonzero (Algebraic _ ss int0) = go int0
where
@@ -637,10 +626,6 @@ powA r n | n < 0 = nthRoot' (abs $ fromIntegral n) r
| otherwise = r ^ P.fromIntegral n
{-# INLINE powA #-}
-iterateImprove :: Rational -> Unipol Rational -> Interval Rational -> Interval Rational
-iterateImprove eps f =
- iterateImproveStrum eps (strum f)
-
iterateImproveStrum :: Rational -> [Unipol Rational] -> Interval Rational -> Interval Rational
iterateImproveStrum eps ss int0 =
until (\int -> size int < eps) (improveWith ss) int0