Copyright | (c) Masahiro Sakai 2012-2013 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable (Rank2Types) |
Safe Haskell | None |
Language | Haskell2010 |
Algebraic reals
Reference:
- Why the concept of a field extension is a natural one http://www.dpmms.cam.ac.uk/~wtg10/galois.html
- data AReal
- realRoots :: UPolynomial Rational -> [AReal]
- realRootsEx :: UPolynomial AReal -> [AReal]
- minimalPolynomial :: AReal -> UPolynomial Rational
- isolatingInterval :: AReal -> Interval Rational
- isRational :: AReal -> Bool
- isAlgebraicInteger :: AReal -> Bool
- height :: AReal -> Integer
- rootIndex :: AReal -> Int
- nthRoot :: Integer -> AReal -> AReal
- refineIsolatingInterval :: AReal -> AReal
- approx :: AReal -> Rational -> Rational
- approxInterval :: AReal -> Rational -> Interval Rational
- simpARealPoly :: UPolynomial AReal -> UPolynomial Rational
- goldenRatio :: AReal
Algebraic real type
Algebraic real numbers.
Construction
realRoots :: UPolynomial Rational -> [AReal] Source
Real roots of the polynomial in ascending order.
realRootsEx :: UPolynomial AReal -> [AReal] Source
Real roots of the polynomial in ascending order.
Properties
minimalPolynomial :: AReal -> UPolynomial Rational Source
The polynomial of which the algebraic number is root.
isolatingInterval :: AReal -> Interval Rational Source
Isolating interval that separate the number from other roots of minimalPolynomial
of it.
isRational :: AReal -> Bool Source
Whether the algebraic number is a rational.
isAlgebraicInteger :: AReal -> Bool Source
Whether the algebraic number is a root of a polynomial with integer
coefficients with leading coefficient 1
(a monic polynomial).
height :: AReal -> Integer Source
Height of the algebraic number.
The height of an algebraic number is the greatest absolute value of the coefficients of the irreducible and primitive polynomial with integral rational coefficients.
rootIndex :: AReal -> Int Source
root index, satisfying
realRoots
(minimalPolynomial
a) !! rootIndex a == a
Operations
refineIsolatingInterval :: AReal -> AReal Source
Same algebraic real, but represented using finer grained isolatingInterval
.
Approximation
Returns approximate rational value such that abs (a - approx a epsilon) <= epsilon
.
Returns approximate interval such that width (approxInterval a epsilon) <= epsilon
.
Misc
Golden ratio