Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A) Write a MATLAB function that computes precision for a given reference value. A prototype of the function is given here: function [precision] = PrecisionVersusBase(

A) Write a MATLAB function that computes precision for a given reference value.

A prototype of the function is given here:

function [precision] = PrecisionVersusBase( base ) % returns precision

The algorithm for computing the precision is given in the pseudo code below

precision = base

WHILE( base + precision > base )

precision = precision / 2

precision = precision * 2

B)

Using the function from part A, compute precision for a reference value equal to 1.0 to 1e-30, reducing it by a factor of 10 each step. ( base = base/10.0; ) Write out the results of each case to a Comma Separated Values (CSV) file*. Write out the precision, and the base, along with the ratio of precision and base, in other words writeout base, precision and precision/base. Document these results in your report.

First, plot the base versus precision and then plot base versus the ratio. Due to the geometricnature in the progression of base, base/10 at each step, a log scale might be helpful.The MATLAB function loglog is the same as plot, except each axis (x and y) will use a log scale.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

Explain in detail how the Mughal Empire was established in India

Answered: 1 week ago

Question

Problem: Evaluate the integral: I - -[ze dx

Answered: 1 week ago