Zhaohu Fan
Math 502 Mini project 1
Q: Compute the machine precision in Matlab Matlab version: Version 7.3.0.267( R2006) License Number: 25441 Theorem 3.6
| fl ( x ) x| | x|
Can be written in the form fl ( x ) = x(1 + ) , | | Matlab function > [N, EPS]=eps
Warm-up Homework: Vectorization in Matlab Generate the vector y = sin(x2 ) for x [0, ] in three ways: a) sequential, using a forloop, for example: h = pi/n; f or i = 0 : n, y (i) = sin(i h)2 ); end b) the same as in a) preceded by the initialization of y,
Homework Let f (t) = sin(t). Define finite difference Dh (a) = f (a + h) - f (a) . h
Let a = 1. Compute experimentally the total error eh (a) = |Dh (a) - f (a)| for hi = 10-i , i = 1, ., 16. Tabulate and plot these values. Note that this total error is a