logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

goal of this assignment is to introduce Floating Point operations in MIPS

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Goal

The goal of this assignment is to introduce Floating Point operations in MIPS.

Background

Newton devised a method to aproximate a root of an equation by repeatedly apply the formula until the error was sufficiently small. This formula, also known as the Newton–Raphson method, is defined as:

 

𝑥𝑛+1 = 𝑥𝑛 − (𝐹(𝑥𝑛)/𝐹′(𝑥𝑛))

Consider a continuous function F(x)=x3-4x2+1 with its derivative F’(x)=3x2-8x. Thus, by calculating successive values of x, the value of F(xn) will approach 0, and hence be a root of F.

The Assignment

Write a MIPS program which will find a value of xn such that F(xn)=0, to a tolerance of 10-6.

Prompt the user to enter an initial integer value for x, hence x1. Then calculate each new x value, using the formula above, until F(x) is sufficiently close to 0. Try the value of 2 as a test input value.

All calculations must be done as doubles. Your program should output x and the value of F(x) at each step and finally print the root (x) that you found. You should try other values for the initial value of x to test your program.

Note, your output will not be so clean since the default print of a double includes many decimal places and could be in scientific notation, don’t worry about aligning the output.

The output with an input of 2 should look like the following:

Please enter an integer: 2 x=2.0, F(x)=-7.0

x=0.25, F(x)=0.765625

x=0.6724137931034483, F(x)=-0.5045358563286728 x=0.5469975054591968, F(x)=-0.033160000071302154 x=0.5374642805088174, F(x)=-2.1525861187732254E-4 x=0.5374015797596746, F(x)=-9.386846855363729E-9 x=0.5374015797596746

 

 

 

(5/5)
Attachments:

Expert's Answer

275 Times Downloaded

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

275 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

616 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

726 Answers

Hire Me
expert
Husnain SaeedComputer science

999 Answers

Hire Me
expert
Atharva PatilComputer science

900 Answers

Hire Me