Discussion Oct 17

Discussion Oct 17 - DEPENDENCE ON SIZE CPU time = t Total...

This preview shows pages 1–15. Sign up to view the full content.

ERROR TOLERANCE computed "exact" some answer answer tolerance   -    

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

View Full Document
ERRORS Absolute error = approximate value true value Relative error = absolute error / true value
TRUNCATION ERRORS 2 3 1 2! 3! x x x e x = + + + + L 2 2 1 2! x S x = + + 1 1 S x = +

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

View Full Document
TRUNCATION ERRORS 2 1 2! ! n n x x S x n = + + + + K 1 tol n n S S + - <
ROUNDOFF ERRORS Machine resolution ε ε = 2 –52 2×10 –16 1 + ε / 2 == 1 >> 1 + (eps/2)*1.000001 == 1 ans = 0 >> 1 + (eps/2)/1.000001 == 1 ans = 1

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

View Full Document
machine epsilon: distance from 1  to  the next machine represented number >> 1 + (eps/2)*1.000001 == 1 ans = 0 >> 1 + (eps/2)/1.000001 == 1 ans = 1 ε real line 1+ ε 1 1+ ε /2
>> 1 + (eps/2)*1.000001 == 1 ans = 0 >> 1 + (eps/2)/1.000001 == 1 ans = 1 machine epsilon: distance from 1  to  the next machine represented number ε real line 1+ ε 1 1+ ε /2 2 ε δ= 2

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

View Full Document
Big-O
BIG-O NOTATION A measure of ASYMPTOTIC COMPLEXITY O(N x ) O(N 0 )=O(1) O(N 1 ) O(N 2 )   . . . Order of

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

View Full Document
for i = 1:N y(i) = i; end

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: DEPENDENCE ON SIZE CPU time = t Total CPU time = t * N ~ O(N ) for i = 1:N for j = 1:N z(i,j) = i; end end DEPENDENCE ON SIZE CPU time = t ~ O(N ) Total CPU time = t * N * N Time = 100 N + 2 N 2 10 20 30 40 50 60 70 80 90 100 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 4 N Time 100 N 2 N DEPENDENCE ON SIZE LOG-LOG PLOTS Time ~ a N b log(Time) ~ log(a) + b log(N) 10-2 10-1 10 10 1 10 2 10 3 10-4 10-2 10 10 2 10 4 10 6 10 8 log(N) log(Time) slope = 2 slope = 1 RULES FOR USING BIG-O • Ignore constants; e.g., O(c N ) = O( N ) • Use only the highest-power term; e.g., O(a N 2 + bN + c log N + d) = O( N 2 ) MATLAB TIMING FUNCTIONS >> tic >> … >> … >> toc >> cputime...
View Full Document

This note was uploaded on 11/01/2009 for the course ENGLISH 7 taught by Professor Sengupta during the Spring '09 term at Berkeley.

Page1 / 15

Discussion Oct 17 - DEPENDENCE ON SIZE CPU time = t Total...

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

View Full Document
Ask a homework question - tutors are online