toysolver-0.0.6: Assorted decision procedures for SAT, Max-SAT, PB, MIP, etc

Portability non-portable (Rank2Types) provisional masahiro.sakai@gmail.com None

Data.AlgebraicNumber.Real

Description

Algebraic reals

Reference:

Synopsis

Algebraic real type

data AReal Source

Algebraic real numbers.

Instances

 Eq AReal Fractional AReal Num AReal Ord AReal Real AReal RealFrac AReal Show AReal Pretty AReal PrettyCoeff AReal Degree AReal Degree of the algebraic number. If the algebraic number's `minimalPolynomial` has degree `n`, then the algebraic number is said to be degree `n`.

Construction

Real roots of the polynomial in ascending order.

Real roots of the polynomial in ascending order.

Properties

The polynomial of which the algebraic number is root.

Whether the algebraic number is a rational.

Whether the algebraic number is a root of a polynomial with integer coefficients with leading coefficient `1` (a monic polynomial).

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.

root index, satisfying

``` `realRoots` (`minimalPolynomial` a) !! rootIndex a == a
```

Operations

The `n`th root of `a`

Approximation

Arguments

 :: AReal a -> Rational epsilon -> Rational

Returns approximate rational value such that `abs (a - approx a epsilon) <= epsilon`.

Arguments

 :: AReal a -> Rational epsilon -> Interval Rational

Returns approximate interval such that `width (approxInterval a epsilon) <= epsilon`.

Golden ratio