This preview shows page 1. Sign up to view the full content.
Unformatted text preview: xs = sym(x,'f'); if nargin < 2 % Default number of digits for var prec fv = vpa( cos(xs^2)-cos(xs) ); else % Specify number of digits fv = vpa( cos(xs^2)-cos(xs), d ); end fv = double(fv); % Compute with our routine f = hw1p2(x); % Compute the relative error and return relerr = abs( (fv-f)/fv ); abserr = abs((fv-f));...
View Full Document
This note was uploaded on 03/12/2012 for the course CS 3220 taught by Professor Marschner during the Spring '09 term at Cornell University (Engineering School).
- Spring '09