24
Exact Computation Theory and Techniques Serge Adamowsky & Lina Ourima Seminar Algorithmen WS 03 / 04

Exact Computation

  • Upload
    vian

  • View
    48

  • Download
    0

Embed Size (px)

DESCRIPTION

Exact Computation. Theory and Techniques. Serge Adamowsky & Lina Ourima Seminar Algorithmen WS 03 / 04. Contents. Evaluating One Determinant Expression Error-bounds Versus Precision-bounds Error-Bounds Precision-bounds Theory of Exact Computation. Evaluating One Determinant Expression. - PowerPoint PPT Presentation

Citation preview

Page 1: Exact Computation

Exact Computation

Theory and Techniques

Serge Adamowsky & Lina Ourima Seminar Algorithmen WS 03 / 04

Page 2: Exact Computation

Contents

Evaluating One Determinant Expression

Error-bounds Versus Precision-bounds

Error-Bounds Precision-bounds Theory of Exact Computation

Page 3: Exact Computation

Evaluating One Determinant Expression

View Expression as labled dag (=directed acyclic graph)

Each sink node is a number Each internal node is an operator

Page 4: Exact Computation

Example

Page 5: Exact Computation

Error-bounds Versus Precision-bounds Error-bounds Bottom-up Deterministic Depends on error

of input

Precision-bounds Top down Not deterministic User-specified

quantity

Page 6: Exact Computation

Example: Error-bounds

Page 7: Exact Computation

Example: Precision-bounds

Page 8: Exact Computation

Error Bounds

Number Representation (Notation) Normalizing Error Digits

Examples for Normalization Algorithms for Maintaining bigFloat

Ranges Addition Multiplication Square Root

Page 9: Exact Computation

Number Representation (Notation)

bigFloats used as aproximation b = 1212/343434 0.35 * 10-2 bigFloats used with error-bounds: b‘ = (0.35 0.01) * 10-2 = (35, -2,

1) (f, e, d) := f d*Be The number is exact when d = 0

Page 10: Exact Computation

Normalizing Error Digits

(35, -2, 1)2 = (1225, -4, 71) Storing many insignificant digits is

a waste of space and time Number is normalized when f doesnt start with 0 and 0 d < B Delayed normalization improves accuracy

Page 11: Exact Computation

Examples for Normalization

Page 12: Exact Computation

Algorithms for Maintaining bigFloat Ranges

Addition Multiplication Square root With a global precision bound (gpb) c‘ = a‘ b‘: the system produces

the most accurate range without the exceeding global p. bound

Page 13: Exact Computation

Addition

A safe Algorithm: Align the least significant bits Add the digits and error values Normalize (123, 0, 1) + (246, -2, 3) (12300, 0, 100) + (246, -2, 3) = (12546, 0,

103) Normalized: (125, 0, 2)

Page 14: Exact Computation

Addition

Problem: far more digits computed then nessesary

Solution: Find the least significant bit (gpb, magnitude of both summands) and don‘t use smaller bits

(123, 0, 1) + (2, -2, 1) = (125, 0, 2)

Page 15: Exact Computation

Multiplication

(f1, e1, d1) * (f2, e2, d2) = (f1 f2, e1+ e2, f1 d2+ f2 d1+ e1 e2)

If f1, f2 positive f1 and f2 (both n digits) not exact => result doesnt have 2n but n significant digits

Don‘t compute more digits then the significant ones (like in Addition)

Page 16: Exact Computation

Square Root

Newton iteration:i+1½ii1 ,2,... converges toward i would be exact but Might be not

exact and operations can‘t be done accurate

still lies between i and i+1

Page 17: Exact Computation

Composite Precision Bounds

X approximates x absolute precision(AP): |X-x| 2-a

relative precision(RP): |X-x| |x| 2-r

composite precision(CP): |X-x| max(2-

a, |x| 2-r) written: X = x[a,r] CP AP r = CP RP a =

Page 18: Exact Computation

Algorithms

Most significant bit (MSB) mx :=log|x|

mx[a,r] = MX 2Mx |x| < 21+Mx + max{2e-r, 2a}

Computing Mx is expensive Often a lower bound for Mx is

sufficient

Page 19: Exact Computation

Theory of Exact Computation

Computation of semi-algebraic problems is theoretically possible.

An algebraic number(AN) is any complex root of a polynomial (with integer coefficients)

2 is AN, since it is root of x2-2 Isolating interval representation:

2 = (x2-2, [1,2])

Page 20: Exact Computation

Semi-algebraic Predicates

(x1, ..., xn) is a Boolean combination of P(x1, ..., x) p 0

p {=, <, >, , } Example: 0(x, y) : (x2 + y2 -1 < 0) (x + y -5 = 0) Is the union of an open disc and a straight

line

Page 21: Exact Computation

Tarski Formula

A first-order formula based on semi-algebraic predicates is a true Tarski sentence.

Example: (x)(y)0(x,y) Sets defined by Tarski formulas are

semi-algebraic.

Page 22: Exact Computation

Practical Use?

Theorem: A semi-algebraic problem can be solved in double-exponential time on a Turing-machine.

Mainly of theoretical interest Practical use if some instances can

be computed quickly (double exponential time is worst case)

Page 23: Exact Computation

Theory of Root Bounds Comparing values is a basic

operation It is sufficient to compare to zero

determine the sign of an expression

How can we know a number is 0 without looking at infinite signs and without using „some heuristic cut-off epsilon value“?

Page 24: Exact Computation

Detecting Zero h is a height bound on The height of an algebraic number

is the maximum value of the coefficients in its minimal polynomial

Cauchy‘s bound says: is non-zero iff || > 1 / (1+h)

Evaluate to an AP of 1+log(1+h) to determine the sign