solution+to+HW3 - Solution to HW3 EGM3344 FALL 2010 Problem...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Solution to HW3 EGM3344 FALL 2010 Problem 4.1 Problem 4.3 function ep = macheps % determines the machine epsilon e = 1; while (1) if e+1<=1, break, end e = e/2; end ep = 2*e; >> macheps ans = 2.2204e-016 >> eps ans = 2.2204e-016 Problem 4.4 function s = small % determines the smallest number sm = 1; while (1) s=sm/2; if s==0,break,end sm = s; end s = sm; This function can be run to give >> s=small s = 4.9407e-324 This result differs from the one obtained with the built-in realmin function, >> s=realmin
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
s = 2.2251e-308 Problem 4.7 The true value can be computed as Using 3-digits with chopping This represents a percent relative error of Problem 4.12 The true value is f (3) = 554. zero order: first order: second order:
Background image of page 2
third order: Because we are working with a third-order polynomial, the error is zero. This is due to the fact that cubics have zero fourth and higher derivatives. Problem 4.15 The first derivative of the function at x = 2 can be evaluated as The points needed to form the finite divided differences can be computed as
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

solution+to+HW3 - Solution to HW3 EGM3344 FALL 2010 Problem...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online