Question

The following lines of MATLAB code evaluate the function 1.5 1016 in four different ways (a) x=1.5e-16; f=0.5*((exp (x)-exp (We are the four computed values of f, IEEE floating point arithmetic is used? You can assume that exp(x) and exp(-x) are calculated exactly and rounded to the nearest floating point number

0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;
clear all;close all;

x=1.5*10^-16;

f1=0.5*((exp(x)-exp(-x))/x)

f2=0.5*((exp(x)-exp(-x))/((x+1)-1))

f3=0.5*(exp(x)-exp(-x))/((x-1)+1)

f4=(exp(x)-exp(-x))/((x-1)+(x+1))

New to MATLAB? See resources for Getting Started 1c: clear all:close all: 2 3 4 1.1102 fl-0.5* ((exp (x)-exp (-x))/x) £2-0.5*Note all four values are different

Add a comment
Know the answer?
Add Answer to:
We are the four computed values of f, IEEE floating point arithmetic is used? You can assume that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider a 9-bit floating-point representation based on the IEEE floating-point format, with one sign bit, four...

    Consider a 9-bit floating-point representation based on the IEEE floating-point format, with one sign bit, four exponent bits (k = 4), and four fraction bits (n = 4). The exponent bias is 24-1-1-7. The table that follows enumerates some of the values for this 9-bit floating-point representation. Fill in the blank table entries using the following directions: e : The value represented by considering the exponent field to be an unsigned integer (as a decimal value) E: The value of...

  • Using MATLAB or FreeMat ---------------------------- Bisection Method and Accuracy of Rootfinding Consider the function f(0) =...

    Using MATLAB or FreeMat ---------------------------- Bisection Method and Accuracy of Rootfinding Consider the function f(0) = 3 cos 2r cos 4-2 cos Garcos 3r - 6 cos 2r sin 2r-5.03r +5/2. This function has exactly one root in the interval <I<1. Your assignment is to find this root accurately to 10 decimal places, if possible. Use MATLAB, which does all calculations in double precision, equivalent to about 16 decimal digits. You should use the Bisection Method as described below to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT