- Assignment 1 is due Mon, Sept. 20. For
the m-files
num2bin.m and num2bin.m see "IEEE 754 double precision machine numbers in
Matlab"
Hints:
- problem 3(a): f(c) = (-b - sqrt(b2 - 4c)/2. Find a
formula for cf=c f'(c)/f(c). Evaluate this formula in
Matlab for b = -y1-y2, c = y1*y2 where y1,y2 are the values in
(i),(ii),(iii).
problem 3(b): The file qeq1.m should look
like this:
function [y1,y2] = qeq1(b,c)
y1 = ... ;
y2 = ... ;
To find the errors of your computed solution use
y1 = ... ; y2 = ... ;
b = -y1-y2; c = y1*y2;
[y1hat, y2hat] = qeq1(b,c)
and then compute the relative errors of y1hat,
y2hat compared to y1, y2.
- problem 4(b):To find the relative error of
ytilde:=y1hat-xhat use
|
ahat-bhat| <=
|a/(a-b)| |
ahat | +
|b/(a-b)| |
bhat |.
problem 4(c): Use the remainder term to get an upper
bound for |f(x)-f4(x)|/|f(x)|.
problem 4(d): linspace(a,b,n) gives n equidistant
numbers in the interval [a,b] (including the endpoints).