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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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