subject

Suppose in the year 2102 that evaluating x<0.72 for an input parameter x becomes an important operation to do quickly. As such, CPU manufacturers want to evaluate this operation approximately in hardware as a single x86 operation, f_p72. As a computer engineer, you are tasked with creating the necessary components to execute the f_p72 instruction. Suppose that the function f_hat(x) carries out the f_p72 instruction for a given floating point input x. That is, f_hat(x) evaluates the approximation of x0.72. Write a short program to evaluate the magnitude of the relative error in evaluating 20.72 using f_hat for the input x. f_hat(x) is a function that evaluates an approximation to x0.72 for a given floating point input x. x is a floating point number. Store the magnitude of the relative error in using the approximation f_hat in relative_error.
The setup code gives the following variables:
Name Type Description
f_hat function a function which has the same effect as the fp72 instruction
x a floating point number floating point number
Your code snippet should define the following variables:
Name Type Description
relative_error floating point numbe r the relative error in evaluating x0.72 using f_hat

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, gracie2492
What result from the passage of this amendment
Answers: 1
image
Computers and Technology, 22.06.2019 19:50, rosyposy43
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called. write a constructor for the above class that initialized both variables to zero. write a tostring to display both the tank and speed when the car is printed. modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter. write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, jadaroyval
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
image
Computers and Technology, 24.06.2019 19:00, cxttiemsp021
Luis is cloud-based( microsoft bot framework). true false
Answers: 1
You know the right answer?
Suppose in the year 2102 that evaluating x<0.72 for an input parameter x becomes an important ope...

Questions in other subjects:

Konu
World Languages, 20.11.2020 08:00
Konu
English, 20.11.2020 08:00