正在加载图片...
Lecture note 1 Numerical Analysis .Example 元=3.141593. 22 =3.142857 22 不一 =-0.001264 Suppose that your computer work with 4 digits decimal machine,what will happen when you doπe号? f1(π)=3.142(0.3142×102) 号-314g0314g×10 fa)-f2号)=-0,01=-01×10-2 But 2 f1(x-号)=-0.001264=-0.1264×10-2 So,when you do fl(π)efl(号),the computer doesn't give you the machine number which is the closest toπ-号. Gives-0.1000×10-2 instead of-0.1264×10-2. Loss of 3 significant digits. Generally,x and y,two nearly equal numbers with x >y. fl()=0.did2...dpap+iap+1...ax 10" fl(z)=0.dd..dp9p+1p+1…fk×10m fl(fl(x)-fl(g)》=0.0p+10p+1..0k×10m-P. At most k-p significant digits. ·Example: x2-26x+1=0. The solution is x=13±V168 V168=12.961481. 13-V168=0.038519.. Now suppose that we want to do 13v168 with a five digit decimal machine f(V168=12.961=0.12961×102 f1(13)=13.000=0.13000×102 f1(168)-f1(13)=0.039=0.39000×10-1 instead of 0.38519 x 10-1 we get0.39000×10-1 we have loss 3 significant digits. 11Lecture note 1 Numerical Analysis • Example π = 3.141593, 22 7 = 3.142857 π − 22 7 = −0.001264 • Suppose that your computer work with 4 digits decimal machine, what will happen when you do π ⊖ 22 7 ? fl(π) = 3.142 (0.3142 × 101 ) fl( 22 7 ) = 3.143 (0.3143 × 101 ) fl(π) − fl( 22 7 ) = −0, 001 = −0.1 × 10−2 But fl(π − 22 7 ) = −0.001264 = −0.1264 × 10−2 So, when you do fl(π) ⊖ fl( 22 7 ), the computer doesn’t give you the machine number which is the closest to π − 22 7 . Gives −0.1000 × 10−2 instead of −0.1264 × 10−2 . Loss of 3 significant digits. • Generally, x and y, two nearly equal numbers with x > y. fl(x) = 0.d1d2 . . . dpαp+1αp+1 . . . αk × 10n fl(x) = 0.d1d2 . . . dpβp+1βp+1 . . . βk × 10n fl(fl(x) − fl(y)) = 0.σp+1σp+1 . . . σk × 10n−p . At most k − p significant digits. • Example: x 2 − 26x + 1 = 0. The solution is x = 13 ± √ 168 √ 168 = 12.961481... 13 − √ 168 = 0.038519... Now suppose that we want to do 13 ⊖ √ 168 with a five digit decimal machine fl( √ 168) = 12.961 = 0.12961 × 102 fl(13) = 13.000 = 0.13000 × 102 fl( √ 168) − fl(13) = 0.039 = 0.39000 × 10−1 instead of 0.38519 × 10−1 , we get 0.39000 × 10−1 we have loss 3 significant digits. 11
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有