Project 2 Solutions

Project 2 Solutions - Project 2 1. > x=2; c=1; while x ~=...

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

View Full Document Right Arrow Icon
Project 2 1. >> x=2; c=1; while x ~= Inf & c >> 2^c ans = Inf >> 2^(c-1) ans = 8.9885e+307 >> x=1/2; c=-1; while x ~= 0 & -1500 < c, x=x/2; c=c-1;end >> 2^c ans = 0 >> 2^(c+1) ans = 4.9407e-324 __________________________________________________________________________________________________ 2. come back later __________________________________________________________________________________________________ 3. (1) (2) >> x=1; fy=[]; while x <= 30, fy = [fy f(1/(2^x))]; x=x+1; end >> fy fy = Columns 1 through 7 0.4721 0.4924 0.4981 0.4995 0.4999 0.5000 0.5000 Columns 8 through 14 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 15 through 21 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 22 through 28 0.5000 0.5000 0.5000 0.5000 0 0 0
Background image of page 1

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

View Full DocumentRight Arrow Icon
0 0 (3) >> x=1; gy=[]; while x <= 30, gy = [gy g(1/(2^x))]; x=x+1; end >> gy gy = Columns 1 through 7 0.4721 0.4924 0.4981 0.4995 0.4999 0.5000 0.5000 Columns 8 through 14 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 15 through 21 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 22 through 28 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 29 through 30 0.5000 0.5000 (4) Method Number 2 is more stable for computing this limit. (5) >> ulp=2^-53 ulp = 1.1102e-016 >> r=sqrt(ulp) r = 1.0537e-008 >> fy=f(r) fy = 0 >> gy=g(r) gy = 0.5000 __________________________________________________________________________________________________ 4. >> n=7
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/10/2008 for the course MAD 4401 taught by Professor Martcheva during the Spring '08 term at University of Florida.

Page1 / 11

Project 2 Solutions - Project 2 1. > x=2; c=1; while x ~=...

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

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