File: node80.html

package info (click to toggle)
lapack 3.0.20000531a-28
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 61,920 kB
  • ctags: 46,200
  • sloc: fortran: 584,835; perl: 8,226; makefile: 2,331; awk: 71; sh: 45
file content (357 lines) | stat: -rw-r--r-- 10,021 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 98.2 beta6 (August 14th, 1998)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Error Bounds for Linear Equation Solving</TITLE>
<META NAME="description" CONTENT="Error Bounds for Linear Equation Solving">
<META NAME="keywords" CONTENT="lug_l2h">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="lug_l2h.css">
<LINK REL="next" HREF="node82.html">
<LINK REL="previous" HREF="node77.html">
<LINK REL="up" HREF="node72.html">
<LINK REL="next" HREF="node81.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html5313"
 HREF="node81.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 SRC="next_motif.png"></A> 
<A NAME="tex2html5307"
 HREF="node72.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 SRC="up_motif.png"></A> 
<A NAME="tex2html5301"
 HREF="node79.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 SRC="previous_motif.png"></A> 
<A NAME="tex2html5309"
 HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
 SRC="contents_motif.png"></A> 
<A NAME="tex2html5311"
 HREF="node152.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
 SRC="index_motif.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html5314"
 HREF="node81.html">Further Details: Error Bounds</A>
<B> Up:</B> <A NAME="tex2html5308"
 HREF="node72.html">Accuracy and Stability</A>
<B> Previous:</B> <A NAME="tex2html5302"
 HREF="node79.html">Improved Error Bounds</A>
 &nbsp <B>  <A NAME="tex2html5310"
 HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html5312"
 HREF="node152.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION03440000000000000000"></A><A NAME="secAx_b"></A>
<BR>
Error Bounds for Linear Equation Solving
</H1>

<P>
 
<P>
Let <B><I>Ax</I>=<I>b</I></B> be the system to be solved, and <IMG
 WIDTH="14" HEIGHT="16" ALIGN="BOTTOM" BORDER="0"
 SRC="img295.png"
 ALT="$\hat{x}$">
the computed
solution. Let <B><I>n</I></B> be the dimension of <B><I>A</I></B>.
An approximate error bound<A NAME="10532"></A>
for <IMG
 WIDTH="14" HEIGHT="16" ALIGN="BOTTOM" BORDER="0"
 SRC="img295.png"
 ALT="$\hat{x}$">
may be obtained in one of the following two ways,
depending on whether the solution is computed by a simple driver or
an expert driver:

<P>
<DL COMPACT>
<DT>1.
<DD>Suppose that <B><I>Ax</I>=<I>b</I></B> is solved using the simple driver SGESV
<A NAME="10535"></A>
(subsection&nbsp;<A HREF="node26.html#subsecdrivelineq">2.3.1</A>).
Then the approximate error bound<A NAME="tex2html2046"
HREF="footnode.html#foot13155"><SUP>4.10</SUP></A>
<BR><P></P>
<DIV ALIGN="CENTER">

<!-- MATH
 \begin{displaymath}
\frac{\| \hat{x} - x \|_{\infty}}{\|x\|_{\infty}} \leq {\tt ERRBD}
\end{displaymath}
 -->


<IMG
 WIDTH="144" HEIGHT="48" BORDER="0"
 SRC="img396.png"
 ALT="\begin{displaymath}
\frac{\Vert \hat{x} - x \Vert _{\infty}}{\Vert x\Vert _{\infty}} \leq {\tt ERRBD}
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
can be computed by the following code fragment.

<P>
<PRE>
      EPSMCH = SLAMCH( 'E' )
*     Get infinity-norm of A
      ANORM = SLANGE( 'I', N, N, A, LDA, WORK )
*     Solve system; The solution X overwrites B
      CALL SGESV( N, 1, A, LDA, IPIV, B, LDB, INFO )
      IF( INFO.GT.0 ) THEN
         PRINT *,'Singular Matrix'
      ELSE IF (N .GT. 0) THEN
*        Get reciprocal condition number RCOND of A
         CALL SGECON( 'I', N, A, LDA, ANORM, RCOND, WORK, IWORK, INFO )
         RCOND = MAX( RCOND, EPSMCH )
         ERRBD = EPSMCH / RCOND
      END IF
</PRE>
<A NAME="10546"></A>

<P>
For example, suppose<A NAME="tex2html2047"
 HREF="footnode.html#foot13159"><SUP>4.11</SUP></A>

<!-- MATH
 ${\tt SLAMCH('E')} = 2^{-24} = 5.961 \cdot 10^{-8}$
 -->
<IMG
 WIDTH="259" HEIGHT="37" ALIGN="MIDDLE" BORDER="0"
 SRC="img397.png"
 ALT="${\tt SLAMCH('E')} = 2^{-24} = 5.961 \cdot 10^{-8}$">,
<BR><P></P>
<DIV ALIGN="CENTER">

<!-- MATH
 \begin{displaymath}
A = \left( \begin{array}{ccc} 4 & 16000 & 17000 \\2 & 5 & 8 \\3 & 6 & 10 \end{array} \right) 
\; \; {\rm and} \; \;
b = \left( \begin{array}{c} 100.1 \\.1 \\.01 \end{array} \right) \; . \; \;
\end{displaymath}
 -->


<IMG
 WIDTH="384" HEIGHT="73" BORDER="0"
 SRC="img398.png"
 ALT="\begin{displaymath}
A = \left( \begin{array}{ccc} 4 &amp; 16000 &amp; 17000 \\ 2 &amp; 5 &amp; 8...
...in{array}{c} 100.1 \\ .1 \\ .01 \end{array} \right) \; . \; \;
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
Then (to 4 decimal places)
<BR><P></P>
<DIV ALIGN="CENTER">

<!-- MATH
 \begin{displaymath}
x = \left( \begin{array}{c} -.3974 \\-.3349 \\.3211 \end{array} \right) \; , \; \;
\hat{x} = \left( \begin{array}{c} -.3968 \\-.3344 \\.3207 \end{array} \right) \; ,
\end{displaymath}
 -->


<IMG
 WIDTH="297" HEIGHT="73" BORDER="0"
 SRC="img399.png"
 ALT="\begin{displaymath}
x = \left( \begin{array}{c} -.3974 \\ -.3349 \\ .3211 \end{a...
...n{array}{c} -.3968 \\ -.3344 \\ .3207 \end{array} \right) \; ,
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>

<!-- MATH
 ${\tt ANORM} = 3.300 \cdot 10^4$
 -->
<IMG
 WIDTH="151" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img400.png"
 ALT="${\tt ANORM} = 3.300 \cdot 10^4$">,

<!-- MATH
 ${\tt RCOND} = 3.907 \cdot 10^{-6}$
 -->
<IMG
 WIDTH="161" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img401.png"
 ALT="${\tt RCOND} = 3.907 \cdot 10^{-6}$">,
the true reciprocal condition number 
<!-- MATH
 $= 3.902 \cdot 10^{-6}$
 -->
<IMG
 WIDTH="111" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img402.png"
 ALT="$= 3.902 \cdot 10^{-6}$">,

<!-- MATH
 ${\tt ERRBD} =  1.5 \cdot 10^{-2}$
 -->
<IMG
 WIDTH="144" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img403.png"
 ALT="${\tt ERRBD} = 1.5 \cdot 10^{-2}$">,
and the true error

<!-- MATH
 $= 1.5 \cdot 10^{-3}$
 -->
<IMG
 WIDTH="93" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img404.png"
 ALT="$= 1.5 \cdot 10^{-3}$">.
<A NAME="10566"></A>

<P>
<DT>2.
<DD>Suppose that <B><I>Ax</I>=<I>b</I></B> is solved using the expert driver SGESVX
(subsection&nbsp;<A HREF="node26.html#subsecdrivelineq">2.3.1</A>).
<A NAME="10568"></A>
This routine provides an explicit error bound <TT>FERR</TT>, measured
with the infinity-norm:
<A NAME="10570"></A>
<BR><P></P>
<DIV ALIGN="CENTER">

<!-- MATH
 \begin{displaymath}
\frac{\| \hat{x} - x \|_{\infty}}{\|x\|_{\infty}} \leq {\tt FERR}
\end{displaymath}
 -->


<IMG
 WIDTH="135" HEIGHT="48" BORDER="0"
 SRC="img405.png"
 ALT="\begin{displaymath}
\frac{\Vert \hat{x} - x \Vert _{\infty}}{\Vert x\Vert _{\infty}} \leq {\tt FERR}
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
For example, the following code fragment solves
<B><I>Ax</I>=<I>b</I></B> and computes an approximate error bound <TT>FERR</TT>:

<P>
<PRE>
      CALL SGESVX( 'E', 'N', N, 1, A, LDA, AF, LDAF, IPIV,
     $             EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR,
     $             WORK, IWORK, INFO )
      IF( INFO.GT.0 ) PRINT *,'(Nearly) Singular Matrix'
</PRE>

<P>
For the same <TT>A</TT> and <TT>b</TT> as above,

<!-- MATH
 $\hat{x} = \left( \begin{array}{c} -.3974 \\-.3349 \\.3211 \end{array} \right)$
 -->
<IMG
 WIDTH="135" HEIGHT="83" ALIGN="MIDDLE" BORDER="0"
 SRC="img406.png"
 ALT="$\hat{x} = \left( \begin{array}{c} -.3974 \\ -.3349 \\ .3211 \end{array} \right) $">,

<!-- MATH
 ${\tt FERR} = 3.0 \cdot 10^{-5}$
 -->
<IMG
 WIDTH="135" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img407.png"
 ALT="${\tt FERR} = 3.0 \cdot 10^{-5}$">,
and the actual error is 
<!-- MATH
 $4.3 \cdot 10^{-7}$
 -->
<IMG
 WIDTH="75" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img408.png"
 ALT="$4.3 \cdot 10^{-7}$">.

<P>
</DL>

<P>
This example illustrates
that the expert driver provides an error bound with less programming
effort than the simple driver, and also that it may produce a significantly
more accurate answer.

<P>
Similar code fragments, with obvious adaptations,
may be used with all the driver routines for linear
equations listed in Table&nbsp;<A HREF="node26.html#tabdrivelineq">2.2</A>.
For example, if a symmetric system is solved using the simple driver xSYSV,
then xLANSY must be used to compute <TT>ANORM</TT>, and xSYCON must be used
to compute <TT>RCOND</TT>.

<P>
<BR><HR>
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"></A>

<UL>
<LI><A NAME="tex2html5315"
 HREF="node81.html">Further Details:  Error Bounds for Linear Equation Solving</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<!--Navigation Panel-->
<A NAME="tex2html5313"
 HREF="node81.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 SRC="next_motif.png"></A> 
<A NAME="tex2html5307"
 HREF="node72.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 SRC="up_motif.png"></A> 
<A NAME="tex2html5301"
 HREF="node79.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 SRC="previous_motif.png"></A> 
<A NAME="tex2html5309"
 HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
 SRC="contents_motif.png"></A> 
<A NAME="tex2html5311"
 HREF="node152.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
 SRC="index_motif.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html5314"
 HREF="node81.html">Further Details: Error Bounds</A>
<B> Up:</B> <A NAME="tex2html5308"
 HREF="node72.html">Accuracy and Stability</A>
<B> Previous:</B> <A NAME="tex2html5302"
 HREF="node79.html">Improved Error Bounds</A>
 &nbsp <B>  <A NAME="tex2html5310"
 HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html5312"
 HREF="node152.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
<I>Susan Blackford</I>
<BR><I>1999-10-01</I>
</ADDRESS>
</BODY>
</HTML>