Mth510Asgt1Solutions_W05

Mth510Asgt1Solutions_W05 - Mathematics 510 Winter 2005...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Mathematics 510 Winter 2005 Problem Set 1 Solutions Problems 1. (a) Write and execute a program to determine your computers machine epsilon and display the result. Check this with the built-in routine if one exists with your software (eps in Matlab). Here is a program to do both and realmin in one go. #include<math.h> #include<iostream.h> int main() { double temp = 1.5, factor = 0.5; int N = 0; while( temp > 1 ) //Find Machine Epsilon { factor *= 0.5; temp = 1+factor; N++; } cout << N << endl; // Then eps = 2- N . while(factor > 0) //Find smallest floating point number { factor *= 0.5; N++; } cout << N << endl; // Then min = 2- N . return 0; } On my machine, eps= 2- 52 and min = 2- 1074 . If you used Maple to do this, you may have gotten completely differnt results. This is due to the symbolic nature of Maple. (b) Graph the two functions f 1 ( x ) = (1 + x )- 1 and f 2 ( x ) = x vs. x on the same plot for x ranging from 0 to about 10 times the machine epsilon. If the two plots are not the sameranging from 0 to about 10 times the machine epsilon....
View Full Document

This note was uploaded on 05/23/2010 for the course MATH MTH510 taught by Professor Kolasa during the Winter '05 term at Ryerson.

Page1 / 3

Mth510Asgt1Solutions_W05 - Mathematics 510 Winter 2005...

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

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