11 - 2/12/2010 Multiplying a matrix by its inverse should...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
2/12/2010 1 Multiplying a matrix by its inverse should give the identity matrix: A = 150 -100 0 -100 150 -50 0 -50 50 >> Ainv = inv(A) Ainv = 0.0200 0.0200 0.0200 0.0200 0.0300 0.0300 0.0200 0.0300 0.0500 >> format long >> test = A * Ainv test = 1.000000000000000 0 0 -0.000000000000000 1.000000000000000 0 0 0 1.000000000000000 >> test == eye(3) ans = 0 1 1 0 1 1 1 1 1 The answer is close, but not quite right… Some calculator exercises: Evaluate (1 + 1e 13) 1 The answer should be 1e 13 but is zero…. Evaluate (1e13 + 1)–1e13 The answer should be 1 but is zero …. Evaluate (1 + 4e 11 + 8e 11)–1 The answer should be 1.2e 10 but is zero (Casio fx 991) …. . Evaluate (4e 11 + 8e 11 + 1)–1 The answer should be 1.2e 10 and is (Casio fx 991) …. . All these issues are a result of the way in which values are represented within computers (and within calculators).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2/12/2010 2 +/ 1 0 0 0 0 . 1 1 Mantissa Exponent Sign Th t i td i 49” ft A Pseudo IEEE Standard Floating Point Format The exponent is stored in “excess 49” format. Stored exponent = actual exponent + 49 Actual exponent = stored exponent–49 A stored exponent value of 99 is reserved for special cases (infinity, not a number). Possible actual exponent values range from 49 to +49. Except when the actual exponent is 49, values are always normalized (leftmost mantissa digit is non zero). Very realistic apart from base 10 rather than base 2. +/ 9 9 9 9 9 . 9 8 Largest possible magnitude = 9.9999 x 10 49 +/ 0 0 0 0 1 . 0 0 Smallest possible magnitude = 0.0001 x 10 49 = 1 x 10 53 (note–only 1 significant digit) +/ 1 0 0 0 0 . 0 0 Smallest possible magnitude with five significant digits = 1.0000 x 10 49
Background image of page 2
2/12/2010 3 Values 0.0001 x 10 49 = 1x10 53 apart Values 0.0001 x 10 48 = 1x10 52 apart Values 0.0001 x 10 47 = 1x10 51 apart “Subnormals” (loss of precision) zero 1.0000 x 10 48 1.0000 x 10 49 1.0000 x 10 47 Rounding A number of strategies are possible: Round to nearest, ties to even Round to nearest, ties away from zero (ties round up) Round towards zero (truncation) Round towards + Round towards ‐∞ First possibility is the default behaviour for computers.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

11 - 2/12/2010 Multiplying a matrix by its inverse should...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online