Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

B) Encoding of float numbers In this problem, we focus on the problem of encoding float numbers on a computer. We recall some useful formulas:

image text in transcribed
B) Encoding of float numbers In this problem, we focus on the problem of encoding float numbers on a computer. We recall some useful formulas: - Scientific format in base 2: where (significand) and is an integer (exponent) - The exponent can be computed as: - The significand can be computed as for this exercise, we assume that we use single precision. In Matlab, you can define a number in single a) Pick a random number between 1,000,000,000 and 2,000,000,000. Find the exponent of the number you chose, as well as the significand b) Convert the significand in base 2 c) Input your number on https://www.h-schmidt. net/FloatConverter/IEEE754.html and check that the significand and exponents are what you have found in a) and b) d) Compute the machine epsilon for the IEEE 754 format (single precision). Use this to predict the maximal error on the number due to encoding, and check that the actual encoding error is less than this upper bound. Hint: the maximum error when encoding a number is e) Now, define the number (Matlab: pi) in two variables x and why, where x is a single precision variable, and y is a double precision variable (default in Matlab): x= single(pi) y= double(pi) Type the command "format long" to display all the digits of the numbers x and y. How many significant digits should x and y have (based on their corresponding epsilon)

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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

Write formal and informal proposals.

Answered: 1 week ago

Question

Describe the components of a formal report.

Answered: 1 week ago

Question

Write formal and informal reports.

Answered: 1 week ago