This preview shows pages 1–20. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: cg: P/SQLW, CA jﬂw fl Lg Affmxlma’hﬂ/i! M SCIGA‘H‘Fc Cawxfwyﬂs ‘ Saurux a; W
.Mﬂgdw»)  (jaunt. CFéaWr‘ﬁs ang/u /
€XawTUZ$7 ‘ 60019.2, VWK  UjW’r Wit/5 03' ,x ' a; A CARI
ah} ~7M~e a/mo/ mash/vch bu} .640 m,no,k{ lam/n, SUS’FS {Law (ESSA) V814th % 'HMLOPQHC 4 ﬂ COM? “WORM”
1‘ ‘ QM?ch mausde £04 ’ Fremou: QMYqhmg o ‘j‘rU/LCQUH’VIJ or (315 Crechmom Rx): Rs.) + £‘(C)(x~c)+ 10:9 (XML +.,,
1x
°° m)
: Z {Y CC] {X‘ch / chlnw‘mgc
po F} gwl/SL I44,
’ UAMUaU1> 13 w 13er senes “of 4’ 990% c aha/716310;. lg we know Mn‘w CowsVow *Hru—
Awmm WWW. (m, m, 9mm),
we an ng‘fUQQ 41K) mzwbwe. CLSJVMW; Mug, .94; My, $amawkm,
Owl/M cawjauere , om mfiye Ca”. 734) , . I 3 C’" V. r1 4g: Cax'I’Mdéa)’ 5M6“?! (mm. ’ egg”? T: 3' *4 ‘9”12‘6535Xcz7742557tf526 ’— 14 M‘é_ CM 95 (D‘i‘kok V$V\? ﬁylﬂiljfﬁhc (’5 /£££ ngactdvg fomd" 0,,“ %%r V we 15 M “beat” nywber anAprkaP‘ .. ‘ qu
>< ~ fil a 55w x Z {eyramh u NS
577;» Manch $50: J 52 (mi5
l 19H“ (awardm5 Xeiﬂ )dasu‘é‘ 5mg 546*)!1 [J’ ran/es (“when {a 5:314, msz'“
It GxﬂHmueh. Exawlnik
Jim} “’4 ‘g/el lad/“ms W20) é” a ’pmloa IA Grim).
arm/Ad @ Mdgéli’xp — )7Mpe” ﬁ—Lk Solar Systhem,‘ badnc; aVZ/
Mm—umﬁrm a ewf‘nmﬂ. WSurewm "' hand MUCL $65 Mar: ‘ W‘MH: l5 1% orb}? a {fr‘Et/lauS Cowfvhhoﬂé ' viru/lcow‘wvz “ we W T}: [pk/3L W’J 4/52. mac. 13: MC Jam}; a 1pm. on.” — ( m/ muck dye; my Mtge weigh? m, W24
thrwoL 4&6; 1+ jmamée?) IS ﬂak fﬂfec ﬂCCvmée, @WL , , V d . CMFB . Fauna/{k5 e/‘WK dcwr‘ Jam/7 CaMVuhhom 7:
g
i
(i3
Q
Q
'1
I
Q
v
u
i
t
3
§
\ m value a €><aw~TLgi "HALMws his 0044A.“ M W5 41—
(Ss Mel6M0; *“Vﬁt‘l'um 0% 166/sz XOXIOéKm aux/M OLLbIQPror' z (0 M vgeeyyts bus 8
Mfume era!" 3 (0 M  [0 1’ a jLImj waive— ?0‘ )0 QM a Tum CN— are $VrgoS€vi Q1 Wafck [A 5114’ 194/3"
(Mo, [5 (’0 M' ﬂva Etc; 6x105 err‘dr‘ t (0 M / Miamiwe 6‘er = Rubi: Naw’a'ﬂx error ’w yank, (flahme ever has at am": ﬁda‘dmg errar Hm} with time value, /S W * (01°C (\vahwe. em») 25 ’4' $euwml 39% 03C acct/Maj 5’0 knob/:7 on Mars ewa2 z womb j amid a! acct/Maj C4“? 494' ,, 7 WWW. 7. 7 ,C/L LhVﬁL [23 :Daém ewr v: Cowruéad'wml Wr __————‘ Suffqye we, wmk +0 anrum ’X '. vim/e. Jame $8: Mful A q .' fof‘éX/Myaﬂtﬂaa :‘i‘b x ( (WTFECIS‘L mafyrewd‘j/
{‘W/‘d'As 6WD" 0A Mruh MCaMTszie know/Wm) ‘9‘ K4 WW OC/ncchdn, 9W :I't’ Comfohﬁ If
€Xac4—(ﬁ 494665 (hit/311;) Mochc 011% /\ 1F 5 £9173 afprexwxoéra 4um<ha~
W ’C L/a—ed [oak/j 7/2 = [£65 15.de sysdem SO MXW a! gfﬁq/ We GMde A A
{Mal absdﬁe <9er 2 gb‘) " $09 ? R'lvwe Llme
a/p/oraXIMaée dab/sea JEN—HQ) + (Hm—9m) (Cawfud'udVaM/l WC (Jada 9pm “I rmv‘amw M M wreak 6O ﬁrms} Commons/we, +oau oa—(—?“
Came” rrlaFfJ—kw cmor {a ‘T Clea/19 re.qu If afprwmahvxa ,S‘ // Jul/1C0 47m VS: Mdﬁélb Wt. EM" We €32<4~WVKQ> Camoiwbcnol em:
ans'h/‘chm If Aaé~ vino 07+va 1,15 {Sveﬁj anhcaj) 4WVIC0‘ 0470/! WP 2‘ / PC3944» qu'leA USU/13 0\/\
(OtffmaxMrée alg/r:+km bu)‘  ( +NQ Pesd‘b)
leA {>534 araH‘meM‘ FOUnAh/M?) epmr : CemeéQ) rQSUH~, UNA?
jam air/row Maw/WW“ ml Mexad— air/#1th _ < am
WI Comgwﬁ‘a'hamK WP :
( FOJAA‘AS EN???) ‘1' ( +rudcad7“ 0m) Caf‘v’fél , {kaw Le' 51/610 3 (W1 ¥(X+ML(X) (5 hJQGLnléom W [xx>0 \,\ _,O\ I 1% Tax/(gr $4065 09 ‘( aback ’X: [Cum = $60 + 42;) u + C(x/hz“, —— L W
#9640146 7%; (Ml)
E—y—ge) (X‘C) m.) gr 50M UA kMWAQ’
(NHL! Eda“ecu Cam/)4 cc}th (Mics z}va [1“ % (“wazL km, 6x66?)—
(/UIHA a "vaJcacf MM (ﬁg 6 msJ—ed wan 3:: M {PNF 1)
H ¥'<e)u72 9 Lawn WM MM
((21) g C(XHQ"?C><) K 4501, ‘ CA I F] gﬁbe :1 0C“) ’r ¥I(><)L + F69) VIZ '(x/ x ( M4 R > (I
g: 3}“k x + g (aw/1 56/ we, MW‘ 0x @‘rdrIS 64ml! M brad [dad ’ deuMI/LSV (“(9) u lazy/wk) @639” geareﬁgmﬁ 1/1 {times *wmcahox WP,
but» J; M 1; {My} ﬁx”) an) «GHQ we, C(rga, Sax/ask Welr‘e way/h“? 1,41% 5 5“?“WCLCM+ ixsﬂb. any" 1C(><+M= LIZEQEE‘EJ (30d 2 {.123\f5u.o /‘H/\e;e. Jack) are [15+ RNM—Qx): o~3ﬁ:v'§m
[C acct/rods; c1419 1 thra“ 1 Thug 5‘Av7/oLneJIH— (you/cl be . 0&0 2 3.4/62“? EuoLuac— 041:] yak éxldté (oneiyck) go, +ny hm“ Fogﬂfg Cram/f a?! 1? {Emu P(x))(/+ZJ‘) I: Com/9W1 We £226:
‘ MUM)’ or I Hm *9 er I /k SMAij word“? €909" “ (Ix
(bu/mac‘de Wf' Q :14 «PD, M24176)
Z
wt m— « 23/3; at: mam
k 2
1"!) WHAHNHLL J i :0 wk) ﬁr" [4
AR '
SL(Z%+M%) ” ’245 +91 ‘0
AM k 2.
1k = 2%
5+“ +rmcadvdn, M): (QT 450/ f i ,A _ CA ’, [9? Ally Forujwy) epmr US EACL‘LJOV‘J {pror / Sarrpsn— we wonk— \j:{:(¥)/ but we, 5 MSRNL
guru/QM {Paar : 9  (j 1 "HQ errar/n m (6544', AAon ' M Q/‘Mr‘ ﬁat/J WU d“ 0L 6% Umr M 61"” ‘ﬂFLJJ‘ Cm emrlazm
MM. errat we 3a. m Maul—pk? Sufﬁx j = 1: €xac4— raw/v", (103* 1,097+; Surf»?— 9 z 5; ()2) gm 50m». 0':
f 1: Same MAJ/XﬂJ—A Mka
70!“ exffcl" OCUWIA We Jan? EM! WW)? is, we «m: Jaser (Jr/«7 x++a ~extla 1’\_ 6 , TWA Ax = >24 I: M bacth @“we. A 1143 )oluham W‘Q Did”, 9 J
1‘ A A
jalua‘wm 7?) 51m Magicu) 7"fo A/ j Muskbe a’é‘g gm 3‘ 2 ,ECX) — HAL QTPwagm 91Ach Cup/’50) :lz) {HAG 3“ka be Meade») m dLUM ways9 93%» — M age; cm” WW
m affW/Maad m/w}, , A A A (M Maﬁa, we «My 313*“ y HWX) M 34m;
I; a {IN/llﬁwlhdﬂ "' I} (MW/‘4“; m 51"de
6%? 6'; v? V5 p? (grungy W) 1’3 )c vs )2 ( backward ~<~M"> C91“ 4371 H H 7 V I a (, “ﬁg”
[’2/6 §eﬂélﬂLIinj and ~Csva10544963) /
Quadww " SUK/UX «Meal; my Mrua’r & ij 14"» a”) (Mj resale} bawdy W5. 71ml”; 34w}! TIA; Pesolr} I: MSeAm‘wa +0 nth” lmrué", (UkLl~CanJld7M) Bud” (S, i We“; Eni’u‘ﬁ‘ 6‘4) a [£036
amny m M owl—wa? 15 [49 L 1.
CM 1 dwser wj wreak? ( I'lwawhdwa) ﬁnal!“
[COAAIJ‘UA NUbe/‘f = Chﬁ’kﬁ {A watt»? ‘FelGZhl/‘e. (Mpg; M lard—l : 4h" gramme) Mr 2 g‘ﬂ
relé‘hv'e <¥urww~9 mur I {>2 x)/)< l = 33
AL A “3
bomth 6m» .. x ;< ;_x
'I’lw! Hugh/e. Ignazme .omm = '37 z retarhvne’ gr“)me 6 (aﬂcbhws ( Y‘Cbhhvw. Eﬁctu/MN
er‘f‘lr numw Q/‘f‘ah /
{In C , QT Lisa/m, LL’__._V F17— 9 0m dainH‘M \s‘ “IZEML 4v? {Profs W
dong wav‘a'ﬁokéwm [\He, Z‘CLCC" (JAM/‘0. NELSUH" 9 a U well—amaldeQ (F 14» luv 0x014) _______—.— Ca/«Lvhm When  uh. 92km» aCCdee fess/H» imj “mg n SE13}
MLﬁJ/‘lewﬂw‘ dA 9x wen‘canebhme‘) {NV/ban. (ya (Can) viaW mama/ale few/a" by 6%
05m? am uAf—JZHL m?an an a “xebL@¢Jm¢w¢ fﬁdLIQW/ or" w] S'th agahm 0A 6km I/(‘CJAJWPMW/ W (karrarsi) ,0!/\
UASd‘oJ’LL alyarNLLM am am ,ﬂ Cr/LAI'haAQ) ruum' IX : @i‘WW x 2‘ CH W1
5 L3H bu} 19‘156 2.
3, acted/Lem}, is M 01"»; MA}; *IDZL +0 l023, 303 43
Or 60:40? (0 "J'D [0 a) /X 25 ,5 q sfccm case/ as M firms; a“! Na“
(“QOX‘a % U VHFWMIIIZQ) _" ﬂa (690%? Jlle’ IS Gal/913) j
( 5& Me an? («m/t 42) 547mg :4») (gag—e  l0 Wdloakﬁ
o IX: 2*. $.N‘E x10 , m i 0,03l416 No2 (585 Cal! EC 964% Z Or (9°46 (O (USMle Page 2,)_
M Past2, M/MboS hlce<o.l),o C3350} be her/BM} COT7501_,, I v CUM/2175 714/2 [/X z 0 (Ranke5 ﬂ 4mm, M». (a whiz (X ﬁt)
'L x 2x +. 
en; J
VS . ,jCOr X a O; ,( :\ pal/"din tJf/‘ades L0 41M!)
¢ I
'9‘; (MATLAG 5 Caraw Jw
(Asdhe. 031:) I; a? +ru/xcadm7 ’
'A (+5 Vtearega af/mwmdm M bﬂge Z (0:!) ,0 ’5 lye/Meal Ur , $95443 / («Man kaJ QT Vsolw ,f , CL; ,76’ _..<;__ _.,,_ ¥ ___ gee lieu 9r mewLmI 4%. Mi “may 3mm, “gm?
EWD5 0" “CURE”: fem? ﬁmr ( 5601744 1.3.7) WK) 1 HHS) S“ 3019:, mm ms 3:5”
2 81‘ (“7) = (x+7)(\+ 0%) w = Q'W'CXWZ): (xymwnuwg) 1 W; (_\+<§9)7' = ML(I+23+ 31) t‘h \
2* Xy'LK H22) “/ $6 tack apmdnm can Maul+ m U), +0 g—Qf‘mr m «3449 raga/‘3’
F Farm/0va ermr )AJerffh‘h’“
exact} resvH K7 = a A
CoMFUQe) reguH X7 ((4—3) 2 0x
{lira/w) mar 15 am ar a+ Mm 3x7 EaCkWO") e‘wr‘ " (Ma/\e COMqu 3\ _——————— CWfUR) Soluchm/ a 15 ﬂw. ego/CA» salad2m U/Kavé
May;th lowlpcgm'? Ky 6+5) 13 M amok salt/67m an X (yCHQ 0r (><(1+S)3y or (YWMW t 74‘; am M cw,
x 7 r sfllfﬂwa ef/D
Or‘ (\(l+¥)llz)(‘/(I+S)l’1>( xm’y
Mose. (H9914 H 8% Floating points IEEE Standard unifies arithmetic model by Cleve Moler fyou look carefully at the deﬁnition of fundamental arithmetic operations like addition and multiplication, you soon encounter the mathematical abstraction known
as the real numbers. But actual computation with real numbers
is not very practical because it involves limits and infinities.
Instead, MATLAB and most other technical computing
environments use ﬂoatingpoint arithmetic, which involves a
ﬁnite set of numbers with finite precision. This leads to
phenomena like roundoff error, underﬂow, and overﬂow. Most
of the time, MATLAB can be effectively used without worrying
about these details, but every once in a while, it pays to know
something about the properties and limitations of ﬂoating—
point numbers. Twenty years ago, the situation was far more complicated
than it is today. Each computer had its own ﬂoatingpoint
number system. Some were binary; some were decimal. There
was even a Russian computer that used trinary arithmetic.
Among the binary computers, some used 2 as the base; others
used 8 or 16. And everybody had a different precision. In 1985, the IEEE Standards .Board and the American
National Standards Institute adopted the ANSI/IEEE Standard
754—1985 for Binary FloatingPoint Arithmetic. This was the
culmination of almost a decade ofwork by a 92~person
working group of mathematicians, computer scientists and
engineers from universities, computer manufacturers, and
microprocessor companies. All computers designed in the last 15 or so years use IEEE
ﬂoatingpoint arithmetic. This doesn’t mean that they all get
exactly the same results, because there is some ﬂexibility within
the standard. But it does mean that we now have a machine
independent model of how ﬂoatingpoint arithmetic behaves.
MATLAB uses the IEEE double precision format. There is also a
single precision format which saves space but isn’t much faster
on modern machines. And, there is an extended precision
format, which is optional and therefore is one of the reasons
for lack of uniformity among different machines. Most ﬂoating point numbers are normalized. This means they can be expressed as x::(i+f)2e '(leve's Corner ‘K. where f is the fraction or mantissa and e is the exponent. The A», , fraction must satisfy What is the
osf<1 output?
and must be representable in binary using at most 52 bits. In a = 4/3
other words, 252fmust be an integer in the interval b = a — 1
c = b + b + b
0 s 252f< 253
e = 1 — c The exponent must be an integer in the interval —1022 5 es 1023 The ﬁniteness offis a limitation on precision. The
ﬁniteness of e is a limitation on range. Any numbers that
don’t meet these limitations must be approximated by ones
that do. Double precision ﬂoatingnumbers can be stored in a
64—bit word, with 52 bits for f, 11 bits for e, and 1 bit for the
sign ofthe number. The sign of e is accommodated by storing
e+1023, which is between I and 211—2. The two extreme values
for the exponent ﬁeld, 0 and 2111, are reserved for exceptional ﬂoating—point numbers, which we will describe later. Illlllllllllllllllllllllllll l l l  l I 1 1/8 1 2 3 4 5 6 7 The picture’above shows the distribution of the positive
numbers in a toy ﬂoatingpoint system with only three bits
each for fand 6. Between 29 and Ze+1 the numbers are equally
spaced with an increment of 28‘}. As 2 increases, the spacing
increases. The spacing ofthe numbers between 1 and 2 in our
toy system is 23, or In the full IEEE system, this spacing is
252. MATLAB calls this quantity eps, which is short for machine epsilon. eps = 2152) MATLAB News 8 Notes Fall 1996 11 I 1 2 Fall, 1996 (Ieve’s Corner (continued) Before the IEEE standard, different machines had different
values of eps. The approximate decimal value of eps is 2.2204  10'16.
Either eps/2 or eps can be called the roundofflevel. The
maximum relative error incurred when the result of a single
arithmetic operation is rounded to the nearest ﬂoatingpoint
number is eps/ 2. The maximum relative spacing between
numbers is eps. In either case, you can say that the roundoff
level is about 16 decimal digits. A very important example occurs with the simple MATLAB statement
t = O . 1 The value stored in t is not exactly 0.1 because expressing
. . l . . . . . .
the decrmal fraction A0 1n binary requires an inﬁnite serles. In fact,
1A0=%++%5+%6+%7+%8+%9+%l°+%“+%12+... After the ﬁrst term, the sequence of coefﬁcients 1, 0, 0, 1 is
repeated inﬁnitely often. The ﬂoating—point number nearest
0.1 is obtained by rounding this series to 53 terms, including
rounding the last four coefﬁcients to binary 1010. Grouping
the resulting terms together four at a time expresses the
approximation as a base 16, or hexadecimal, series. So the resulting value of t is actually t : (I +9A6+%62+9A63+ +%612+ 1%613) 2'4 The MATLAB command format hex causes t to be printed as 3fb9999999999998 The ﬁrst three characters, 3fb, give the hexadecimal
representation of the biased exponent, e+ 1023, when e is 4.
The other 13 characters are the hex representation of the
fraction f. 50, the value stored in t is very close to, but not exactly
equal to, 0.1. The distinction is occasionally important. For example, the quantity 0.3/0.1 is not exactly equal to 3 because the actual numerator is a
little less than 0.3 and the actual denominator is a little greater
than 0.]. Ten steps oflength t are not precisely the same as one step oflength 1. MATLAB is careful to arrange that the last element MATLAB News & Notes ofthe vector
0:0 .1 :1 is exactly equal to 1, but if you form this vector yourself by
repeated additions of 0.1, you will miss hitting the ﬁnal 1
exactly. Another example is provided by the MATLAB code
segment in the margin on the previous page. With exact
computation, e would be 0. But in ﬂoatingpoint, the
computed e is not 0. It turns out that the only roundoff error
occurs in the ﬁrst statement. The value stored in 3 cannot be
exactly %, except on that Russian trinary computer. The
value stored in b is close to 1/3, but its last bit is O. The value
stored in c is not exactly equal to 1 because the additions are
done without any error. So the value stored in e is not 0. In
fact, e is equal to eps. Before the IEEE standard, this code was
used as a quick way to estimate the roundoff level on various
computers. The roundofflevel eps is sometimes called “ﬂoatingpoint
zero,” but that’s a misnomer. There are many ﬂoating—point
numbers much smaller than eps. The smallest positive
normalized ﬂoating—point number has f: 0 and e = —1022.
The largest ﬂoatingpoint number has fa little less than 1 and
e = 1023. MATLAB calls these numbers realmin and r‘ealmax.
Together with eps, they characterize the standard system. Name Binary Decimal eps 2”(52) 2.2204e—16
realmin 2“ ( 1022) 2.2251 e308
r‘ealmax (2 eps) *2‘1023 1 .7977e+308 When any computation tries to produce a value larger
than realmax, it is said to overﬂow. The result is an
exceptional ﬂoating—point value called Inf, or inﬁnity. It is
represented by taking f: 0 and e = 1024‘ and satisﬁes relations
like 1/Inf = Oand Inf+Inf = Inf. When any computation tries to produce a value smaller
than realmin, it is said to underﬂaw. This involves one of the
optional, and controversial, aspects of the IEEE standard.
Many, but not all, machines allow exceptional denormal or
subnormal ﬂoating—point numbers in the interval between
r‘ealmin and eps*realmin. The smallest positive subnormal
number is about 04946—323. Any results smaller than this are
set to zero. On machines without subnormals, any result less
than realmin is set to zero. The subnormal numbers ﬁll in
the gap you can see in our toy system between zero and the
smallest positive number. They do provide an elegant model for handling underllow, but their practical importance for MATLAB style computation is very rare. When any computation tries to produce a value that is
undeﬁned even in the real number system, the result is an
exceptional value known as NotaNumber, or NaN. Examples
include 0/0 and InfInf. MATLAB uses the ﬂoatingpoint system to handle integers.
Mathematically, the numbers 3 and 3.0 are the same, but
many programming languages would use different
representations for the two. MATLAB does not distinguish
between them. We like to use the term ﬂint to describe a
ﬂoating—point number whose value is an integer. Floating
point operations on ﬂints do not introduce any roundoff
error, as long as the results are not too large. Addition,
subtraction and multiplication of ﬂints produce the exact ﬂint
result, if it is not larger than 2‘53. Division and square root
involving ﬂints also produce a ﬂint when the result is an
integer. For example, sqr‘t(363/3) produces 11, with no
roundoff error. As an example of how roundoff error effects matrix computations, consider the two—by—two set of linear equations 11
3.3 10x1 + X2
3x, + 0.3x2 II The obvious solution is x1: 1 , X2: 1. But the MATLAB statements
A = [10 1; 3 0.3]
b = [11 3.31'
x = A\b
produce
x =
—0.5000
16.0000 Why? Well, the equations are singular. The second
equation is just 0.3 times the ﬁrst. But the ﬂoating—point
representation of the matrix A is not exactly singular because
A(2,2) is not exactly 0.3. Gaussian elimination transforms the equations to the upper triangular system U‘x = c
where
U(2,2)= 0.3  3*(o.1)
= 5.5551e17
and 0(2) = 3.3  33*(O.1)
4.4409e—16 MATLAB notices the tiny value ofU(2,2) and prints a
message warning that the matrix is close to singular. It then computes the ratio of two roundoff errors X(2) c(2)/U(2,2) 16 II This value is substituted back into the ﬁrst equation to give x(1) (11  x(2))/10 0.5 II The singular equations are consistent. There are an inﬁnite
number of solutions. The details of the roundoff error determine which particular solution happens to be computed. . 1 n . .
0.99 0.995 1 1.005 1.01 Our ﬁnal example plots a seventh degree polynomial. X = 0.988: .0001 :1 .012; y = x.‘7—7*x."6+21*x."535*x.“4+35*x.“3...
21*x.‘2+7*x1;
plOt(X,y) But the resulting plot doesn’t look anything like a polynomial.
It isn’t smooth. You are seeing roundoff error in action. The
y—axis scale factor is tiny, 10‘”. The tiny values ofy are being
computed by taking sums and differences of numbers as large
as 35  1.0124. There is severe subtractive cancellation. The
example was contrived by using the Symbolic Toolbox to
expand (x — 1)7 and carefully choosing the range for the xaxis to be near x = l. Ifthe values ofy are computed instead by
Y : (X'l ) 37; then a smooth (but very ﬂat) plot results. I MATLAB News 8; Notes Cleve Moler is chain
and co—founder of
The MathWorks.
His e—mail address i: moler@mathworks.c< Fal,1996 13 Mon Aug 25 14:09:42 2003 fe.m Wed Oct 01 11:33:08 2003 1 function [s,f,e] = fe (x)
% % get the IEEE double precision mantissa f and exponent e
so that x = s * (1+f) * 2Ae
[fl,el] = 1092 (X) % get the sign if (fl < 0)
S=—l;
fl = —fl ; else
5:1; and % get the mantissa
f = 2*fl — l ; % get the exponent
e = el+l ; ...
View Full
Document
 Fall '08
 Davis

Click to edit the document details