Write a program that uses the Taylor series to solve the In(x) function using the formula...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that uses the Taylor series to solve the In(x) function using the formula below. Next, use the In(x) function that was created to determine log10(), In(), and custom log() for positive real numbers of x. Output the solution as a step-by-step output to the screen. 1x106 In(x) = 2 [2k+1(x+1) (x- The formula will calculate In(x) for any real number x > 0. k=0 The program must fulfil these requirements: • All real numbers used must be double variable type. • The maximum number of iteration for the formula is set at 1e6. • Calculation must stop when the result is within 1e-7 of the actual value. • Functions log10 () and log() in math.h ARE NOT allowed to be used! Examples: Choose [1] log10 (x), [2] ln(x), [3] custom log(x): 1 Enter value of x: 342042 log10( 342042.000000) log10 ( 100000.000000) + log10 ( 3.420420) 4.998213 +0.534079 5.532293 Choose [1] log10 (x), [2] ln(x), [3] custom Log (x): 2 Enter value of x: 217 ln( 217.000000) = ln 100.000000) + In( 2.170000) 4.605166+ 0.774727 5.379893 2k+1 Choose [1] log10 (x), [2] ln(x), [3] custom log(x): 3 Enter value of x: 7895 Enter custom log base: 7 log7( 7895.000000) = log7( 1000.000000) + log7( 7.895000) 3.549861+ 1.061832 = 4.611693 Write a program that uses the Taylor series to solve the In(x) function using the formula below. Next, use the In(x) function that was created to determine log10(), In(), and custom log() for positive real numbers of x. Output the solution as a step-by-step output to the screen. 1x106 In(x) = 2 [2k+1(x+1) (x- The formula will calculate In(x) for any real number x > 0. k=0 The program must fulfil these requirements: • All real numbers used must be double variable type. • The maximum number of iteration for the formula is set at 1e6. • Calculation must stop when the result is within 1e-7 of the actual value. • Functions log10 () and log() in math.h ARE NOT allowed to be used! Examples: Choose [1] log10 (x), [2] ln(x), [3] custom log(x): 1 Enter value of x: 342042 log10( 342042.000000) log10 ( 100000.000000) + log10 ( 3.420420) 4.998213 +0.534079 5.532293 Choose [1] log10 (x), [2] ln(x), [3] custom Log (x): 2 Enter value of x: 217 ln( 217.000000) = ln 100.000000) + In( 2.170000) 4.605166+ 0.774727 5.379893 2k+1 Choose [1] log10 (x), [2] ln(x), [3] custom log(x): 3 Enter value of x: 7895 Enter custom log base: 7 log7( 7895.000000) = log7( 1000.000000) + log7( 7.895000) 3.549861+ 1.061832 = 4.611693
Expert Answer:
Answer rating: 100% (QA)
Source code include include include using namespace ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Participants in a cafeteria plan must be permitted to choose from at least how many taxable benefits (such as cash) and at least one qualified benefit?
-
A company that follows an overall cost leadership strategy Multiple Choice strives to reduce the cost of products in its industry. focuses on becoming the lowest cost producer in an industry. does...
-
Ivanhoe Company incurred research and development costs of $ 9 0 0 0 0 to develop a patent, and legal fees of $ 3 0 0 0 0 to register the patent. The patent has a legal life of 2 0 years and a useful...
-
Matheny Inc. went public 3 years ago. The board of directors will be meeting shortly after the end of the year to decide on a dividend policy. In the past, growth has been financed primarily through...
-
A management consultant advised a small business owner to fully analyze all transaction costs, delineate the boundaries of the business, and develop an equation to calculate exactly economies of...
-
Let f(x) = 34x / (3x2 - 10)2. Approximate f'(2) (a) By using the numerical derivative feature of a graphing calculator, and (b) By evaluating f(2 + h) - f(2)/h with h = 0.00001.
-
Mass transfer models include transfer in only the packed region. Mass transfer also occurs in the column ends where liquid and vapor are separated. Discuss how these end effects affect a design. How...
-
The variable manufacturing costs per unit of Crystal Clear Corporation are as follows: 1. Prepare income statements for Crystal Clear in January, February, and March 2014 under throughput costing. 2....
-
What is the formula for calculating the cost performance index? earned value divided by the actual cost (EV/AC) actual cost divided by the earned value (AC/EV) Estimate at Completion/2 (EAC/2)...
-
Consider the ratio control scheme shown in Fig. 15.6. Each flow rate is measured using an orifice plate and a differential pressure (D/P) transmitter. The pneumatic output signals from the D/P...
-
As a newly qualified junior Mechanical Engineer working for a consultancy company offering research and expertise on green powered vehicles. You have been asked to analyse several scenarios relating...
-
Indicate whether you think the following third-party groups would normally represent a (1) primary beneficiary, (2) foreseen party, or (3) foreseeable party. Give reasons for your answers. a. A...
-
Use and Dispose Company was organized to manufacture and sell inexpensive golf clubs that can be used during the golf round and then thrown away at the end of the round. In order to keep the business...
-
Which of the following phrases is not a part of the definition of materiality? a. The magnitude of an omission or misstatement of accounting information that, b. in light of surrounding...
-
Which of the following is not an assurance that the auditors give to parties that rely on financial statements? a. Auditors know how the amounts and disclosures in the financial statements were...
-
The auditor examined a sample of invoices supporting expenditures charged to repairs expense. No misclassification of any expenditure was found. Later, a material amount of expenditures was...
-
Assume Carlton enters into a three-year fixed-for-fixed swap agreement to receive Swiss Franc and pay U.S. dollar annually, on a notional amount of $2,000,000. The spot exchange rate at the time of...
-
Find the volume of the described solid S. A frustum of a right circular cone with height h, lower base radius R, and top radius r -r- --R
-
For the function y = 2 sin x + cos2x/sin2x, calculate the value of y for the following values of x using element-by-element operations: 20, 30, 40, 50, 60, 70.
-
Create three row vectors: a = [3 -1 5 11 -4 2] b = [7 -9 2 13 1 -2] c = [-2 4 -7 8 0 9] (a) Use the three vectors in a MATLAB command to create a 3 6 matrix in which the rows are the vectors a, b,...
-
Evaluate the following expressions without using MATLAB. Check the answers with MATLAB. (a) -3&3 (b) 5 <4&0>-3 (c) -2&2>318/3 (d) -3
-
The Apollo Company is a catalogue-based retailer. The following describes Apollos operations in its first two years of business: Required 1. Prepare an income statement for each year assuming that...
-
At the beginning of 2016, John Cornell decided to quit his job as a construction company ey supervisor and formed his own residential housing construction company. When he resigned, he had a contract...
-
The Miller Company won a contract to build a shopping center at a price of \($240\) million. The following schedule details the estimated and actual costs of construction and the actual cash...
Study smarter with the SolutionInn App