Write an algorithm and program to compute e

Assignment Help Computer Engineering
Reference no: EM132107367

This program is to be writen in C (just plain old C, not any other one). Full and complete answer in order to receive full credit. Please read twice what is required.

Write an algorithm and program to compute e and compute the square root (v). The calculation of the important mathematical constant e and the square root (v) will be done as the sum of an infinite series:

8 8

e = ? 1/n! & vS = ? xn+1 = 1/2(xn + S/xn)

n=0 n=0

where x0 is the initial "guess"

Output: Output will include your computed value for e, the <math.h> library expected value for e, the number of terms (iterations) it took to reach sixteen decimal-place accuracy, and the time (in milliseconds) that it takes to compute the constant.

Output will also include your computed value for the square root of a value input by the user, the number of terms (iterations) it took to reach sixteen decimal-place accuracy, and the time (in milliseconds) that it takes to compute the square root.

Each set of results above should be displayed so as to allow easy comparison of the computed and expected values. Labels should be included, where appropriate.

Input: Accept user input for the value for which the square root is sought. This number will be a real value, and for this assignment will be limited to a real value >= zero. Prompting and validation of the input is, of course, required.

You may NOT use the math library functions sqrt() or exp() in your computations - directly or indirectly. Instead, use only the delta (difference) of your running computation to determine when to stop. No rounding is permitted.

Program must include (minimum) one function for each computation, in addition to the main program. Other functions developed (likely), as required. Test your program completely.

Reference no: EM132107367

Questions Cloud

New set of estimated coefficients : Suppose that we regress the number of races a marathon runner wins on the average time it takes the runner in a marathon in minutes and get the estimates
What is the monthly reach of people : The U.S. population of people 13 + is 252,904,000. Expressed as a percentage, what is the monthly reach of people 13 + of Facebook?
What is the projected audience : If the population of Localville is 550,000, what is the projected audience (i.e., the numerical reach)?
What is the probability that both the team a and team b : What is the probability that both the Team A and Team B will win this weekend? What is the probability that only one of the two teams will win this wee
Write an algorithm and program to compute e : Write an algorithm and program to compute e and compute the square root (v). The calculation of the important mathematical constant e and the square root.
Measures of central tendency : What is standard deviation and what does it have in common with measures of central tendency?
Create a c-sharp console application : Create a C# console application. This application has two command line arguments: A path to a folder and a name for a HTML report output file.
Probability that person has dental cavities : If one person is chosen at random, what is the probability that person has dental cavities?
Determine at least how many runners had a running : The standard deviation was 12 minutes. Using Chebysheff's theorem, determine at least how many runners had a running time between 53 minutes and 89 minutes?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Demorgans theorem

Compute by means of the truth table the validity of DeMorgan’s theorem for three variables: (ABC)’ = A’ + B’ + C’. Simplify the following expressions using Boolean algebra. AB + A(CD + CD’)

  Develop detailed object-oriented design models

You have the following two choices to develop detailed object-oriented design models. You also need to submit a proper documentation

  Define coding of binary information and error detection

define Coding of Binary Information and Error Detection.

  How does a rdbms fit into an mvc design

What is the purpose of each component in a model-view-controller design? What types of software modules are contained in each MVC component? How does a RDBMS fit into an MVC design?

  What file modes are available with sequential files

What file modes are available with sequential files? With direct files? What does the use type clause allow us to do? What occurs when an exception is raised?

  Explain the method to find cost of sorting the relation

Explain the method to find cost of sorting the relation In each case, how many combine passes are required?

  How much should a user know about computers and software

How much should a user know about computers and software in order to man-age a systems development project team?

  If packet-filtering routers and firewalls protect a

if packet-filtering routers and firewalls protect a network by only allowing some traffic through what types of

  What is the latency of the instruction

Assuming a Store Word instruction passes through this pipeline, and doesn't actually use hardware in Write Back phase, what is the latency of the instruction?

  Make the syntax for a 2d array which has four rows

Write down the syntax for a 2D array which has four rows. The first row will have 10 elements and the second row will have 5 elements. The third row will have 8 elements and the fourth row will have 12 elements.

  What is the federated database

What are instances of databases in a work enviroment that could be federated.

  Discuss the techniques used by malware developers

Discuss the techniques used by malware developers to disguise their code and prevent it from being analysed.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd