# Computing a dot product s0 for k 1n s s xkyk end let

This preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: product s=0 for k = 1:n s = s + x(k)*y(k) end Let p X sp = fl k =1 xk yk ! From the algorithm sp = (sp;1 + xpyp(1 + p))(1 + p) j jj j jj u With p = 1 s1 = x1y1(1 + 1) j 1j u { Write this as s1 = x1y1(1 + 1)(1 + 1) 1=0 With p = 2 s2 = (s1 + x2y2(1 + 2))(1 + 2) or s2 = x1y1(1 + 1)(1 + 1)(1 + 2) + x2y2(1 + 2)(1 + 2) 4 Roundo Error in a Dot Product With p = 3 s3 = x1y1(1 + 1)(1 + 1)(1 + 2)(1 + 3) +x2y2(1 + 2)(1 + 2)(1 + 3) +x3y3(1 + 3)(1 + 3) With p = n fl(xT y) = sn = n X xk yk (1 + k ) (4a) k =1 where 1+ k = (1 + k ) n Y (1 + j ) j =k Expand (4b) 1+ k =1+ k+ n X j + O(u2) j =k Since j j j, j jj u, j = 1 : n j k j (n ; k + 1)u + O(u2) { Set k = 1 for simplicity nu + O(u2) j kj 5 (4b) Roundo Error in a Dot Product Use (4a) n X jfl(x y) ; x yj T T jxk yk j(nu + O(u2)) k =1 { Let jyj be a vector with elements jyk j, k = 1 : n { Write n X Then jxk yk j := jxjT jyj k =1 nujxjT jyj + O(u2) Dotting the is and crossing the ts { There is a C 1 nujxjT jyj + O(u2) = nujxjT jyj(1 + O(u)) C nujxjT...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online