You are on page 1of 5

I

(22/11/08) - 2

realmin, realmax, eps , ... ( IEEE MATLAB ).


( ) 1) 6 6b 2-5) 16.
1. :
) ,
Mflop/s.
. :
Mflop/s , ... j , j
... (j = 1, 2)
Mflop/s Pj ,

P1 =

1
2
, P2 =
1 ari + 1 met
2 ari + 2 met

. P1 > P2

2
1
>
2
1
2
2
,
1 > 1 , 1 (. P1 > P2 )
...

) realmin 2, [0, realmin].


. : realmin ... (1.0 0)2 2emin , emin
. IEEE realmin/2
(0.10 0)2 2emin [0, realmin].
) ... eps + realmin eps (eps
.)
. : realmin ... (1.0 0)2 2emin
eps = (1.0 0)2 21t
1 realmin . bits
emin + (1 t), t 1 (.. ,
emin = 126, t = 24 126 23 = 103 > 23), realmin
. ( , , emin = 126, t = 24 126 23 = 103 >
23.) : eps + realmin =
realmin
eps (1.0 + realmin
< eps/2
eps ). , ,
eps

fl(1 + eps/2) = 1.
) , ,
.
. : , ,

.
) ... ,
.
. : ( 1 ...)
.

)
n n , min O(n2 )
... .
. : min O(n)
. , y = y + Ax, min = n2 + 3n.

load x;
for i=1:n, load y(i);
for j = 1:n, load a(i,j); y(i)=y(i)+a(i,j)*x(j); end;
store y(i);
end
= n +

Pn

i=1 (2

Pn

j=1

1) = 3n + n2 , . min .

2. f (x) := 1+x1

x
limx0 f (x) = 1/2. . ) cond(f ; x)
limx0 cond(f ; x). ) (
(1 + )) f x
0 ( eps.) )
x .
. ) cond(f ; x) f : R R

cond(f ; x) =

|f 0 (x)x|
|f (x)|

f (x) =

1
x 21+x
( 1 + x 1)
x2

cond(f ; x) = |

1
x 21+x
( 1 + x 1)
x2

x
x
|
1+x1

1
x 21+x
( 1 + x 1)

= |
|
1+x1

1+x+1
1
1

=
1= +
2 2 1+x
2 1+x

lim cond(f ; x) = 0.

x0

) f (),
.

, . 1 + x
1 .
1, x (
) .
2

1 : ,
>> zd = 0.0001; sd = 1 + zd; sd = sqrt(sd); sd = sd 1; sd = sd/zd;
>> z = single(0.0001); s = 1 + z; s = sqrt(s); s = s 1; s = s/z;
>> [sd, s]

ans = 0.4999875 0.4994869


>> abs((double(s) sd)/sd)
ans = 0.001001179840632

( , z = 1e 8, eps(0 single0 ):

sd

abs((double(s) sd)/sd)

0.00000001
0.000001
0.0001
0.1

0.499999996961265
0.499999875058776
0.4999875
0.488088481701516

0
0.4768372
0.4994869
0.4880881

1
0.0463
0.001
7.186-07

4 ...,
z 4u 4 107 .
) (),

1 + x + 1.

1
f (x) =
1+x+1
, ,
.
x 0, .
3. )
, t = 4 (.
1. ).
;
. ,
.
. ,
0.0001 (. 24 ) 1. 0.001 (. 23 )
1. . :
.
!
) , ,
f , 1 < f 2 2 < f 3;
. 4 1. 1 < f 2: 54 = (1.01)2
20 , 64 = (1.10)2 20 , 47 = (1.11)2 20 , 2 = (1.00)2 21 . 2 1.
2 < f 3: 94 = (1.01)2 21 , 3 = (1.10)2 21 .
: .
[1, 2), [3, 4), [4, 5), (4, 5].
( ) ...
0.
1

!!!
(.. 23 24 )2 , (
1) , 214 .
4. X(1 : AM), Y(1 : AM),
.. .
+ 3,
.. 3.
:
.
. =1997. = rem(7, 3) = 1 + 3 = 4.
rem(1997, 4) = 1. , :

forj = 1 : 1, s = X(1) Y(1), end


forj = 2 : 4 : 1997
s = s + X(j) Y(j) + X(j + 1) Y(j + 1) + X(j + 2) Y(j + 2) + X(j + 3) Y(j + 3)
end
:
.

s = s + X(j)> Y(j) + X(j + 1)> Y(j + 1) + ....,


. , ,

, ,
.
5. ... x 8,
, . s = (((1 + 2 ) + (3 + 4 )) +
((5 + 6 ) + (7 + 8 ))).
.
. x = [1 , ..., 8 ], :

fl(s) = (((1 + 2 )(1 + 1 ) + (3 + 4 )(1 + 2 ))(1 + 3 ) +


((5 + 6 )(1 + 4 ) + (7 + 8 )(1 + 5 ))(1 + 6 ))(1 + 7 )
|j | u.
(1)

(2)

fl(s) = (1 + 2 )(1 + 3 ) + (3 + 4 )(1 + 3 ) +


(3)

(4)

(5 + 6 )(1 + 3 ) + (7 + 8 )(1 + 3 )
(j)

|3 | 3 = 3u/(13u). s, . fl(s) (
fprog (x))
(1)
(4)
1 = 1 (1 + 3 ), ..., 8 = x8 (1 + 3 ).
, xprog [1 , ..., 8 ]

kxprog xk
kxk

3 = 3
kxk
kxk
2

http://el.wikipedia.org/wiki/__)

(.

.
:
|fl(s)s|

, ,
( |s|
, , .) :
( - - 3 < 3 , ,
, 3 = 10000!!!!).

You might also like