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
-
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...
-
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...
-
Determine the equivalent resultant force and couple moment at point O. Units Used: kN = 103 N Given: a = 3 m wO = 3kN/m w(x) = wO(x/a)2 wo w = wo (xlay
-
Seventy percent of the registered voters in a large community are Democrats. The mayor will be selecting a simple random sample of 20 registered voters to serve on an advisory panel that helps...
-
Pick an industry and a product or service. Engage in a creative-thinking process, as outlined in Chapter 11, to generate an improved offering. Do the same to create an entirely new offering that uses...
-
In 2010, Bailey Corporation discovered that equipment purchased on January 1, 2008, for $50,000 was expensed at that time. The equipment should have been depreciated over 5 years, with no salvage...
-
Scenario 1: Joey is a 15 year old who is ready to work, but his parents want him to have more responsibility with money first. His parents have already set up checking and savings accounts for him at...
-
A four-bit binary number is represented as A3A2A1A0, where A3, A2, A1, and A0 represent the individual bits and A0 is equal to the LSB. Design a logic circuit that will produce a HIGH output whenever...
-
_____________________ Measures the difference between the actual fixed MOH costs incurred and the budgeted fixed MOH costs.
-
Two 39.5-cm metal rods, one made of copper and one made of aluminum, are placed end to end, touching each other. One end is fixed, so that it cannot move. The rods are heated from 0.0C to 165.0C. How...
-
A pacemaker applies 7 5 stimulating square - pulses per minute to the heart. The pulse length is 0 . 5 ms, and the amplitude is 5 V. Two electrodes convey the pulses from the pulse generator to the...
-
GOLD Corporation presently sells product SILVER with the following related data: P40 Unit contribution margin Variable cost ratio Total fixed costs Required: What would be the sales in pesos and in...
-
How do additional distinguishing attributes contribute to the intricacies of Organizational Behavior (OB)?
-
A company manufactures a part that is used to manufacture its final products, and the accounts department has determined the cost of manufacturing this part as follows: Total production costs are...
-
Gross profit for 20X7 can be calculated from: A Purchases for 20X7, plus inventory at 31 December 20X7, less inventory at 1 January 20X7 B Purchases for 20X7, less inventory at 31 December 20X7,...
-
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
-
For the three-room house shown in Figure 7.35, all rooms are perfect squares and have the same dimensions. An air conditioner produces an equal amount of heat flow \(q_{\mathrm{ho}}\) out of each...
-
Figure 7.18 shows a liquid-level system in which two tanks have cross-sectional areas \(A_{1}\) and \(A_{2}\), respectively. The volume flow rate into tank 1 is \(q_{\mathrm{i}}\). A pump is...
-
Consider the single-tank liquid-level system shown in Figure 7.19, where the volume flow rate into the tank through a pipe is \(q_{\mathrm{i}}\). The liquid leaves the tank through an orifice of area...
Study smarter with the SolutionInn App