1. The function sin(x) can be approximated by summing the first n terms of the infinite...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. The function sin(x) can be approximated by summing the first n terms of the infinite series sin(x)=x-x/3! + x/5! - x/7! + ... where x is expressed in radians (Note: radians = 180). Write a C program that can be used to answer the following questions during the lab: a) For a value of x = 0.1, how many terms do you need in the power series so that the result from the series equals the result from the sin(x) library function up to the 6 decimal place. b) For a value of x = 1.3, how many terms do you need for achieving the same accuracy as in (a)? Assume that there exists a function double fact(int n) that returns the factorial value of an integer as a double. This function will be given to you. There is a standard C function double pow(double x, double y) that returns the result of x to the power y as a double type. You will need to include math.h to use this function (#include ). 1. The function sin(x) can be approximated by summing the first n terms of the infinite series sin(x)=x-x/3! + x/5! - x/7! + ... where x is expressed in radians (Note: radians = 180). Write a C program that can be used to answer the following questions during the lab: a) For a value of x = 0.1, how many terms do you need in the power series so that the result from the series equals the result from the sin(x) library function up to the 6 decimal place. b) For a value of x = 1.3, how many terms do you need for achieving the same accuracy as in (a)? Assume that there exists a function double fact(int n) that returns the factorial value of an integer as a double. This function will be given to you. There is a standard C function double pow(double x, double y) that returns the result of x to the power y as a double type. You will need to include math.h to use this function (#include ).
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
Show the parse trees for the two parses that the grammar assigns for sentence S1. S1: the train station bus rumbles [3 marks] (b) Give an algorithm for a bottom-up passive chart parser without...
-
1. Enis falsely accuses Monalisa of stealing from Island Tours, Inc., their employer. Enis's statement is defamatory only if a. a third party hears it. b. Monalisa has not been caught. c. the...
-
Hans & Co. LLP is auditing CCC Inc.'s 2014 financial statements. The firm previously audited the company's 2012 and 2013 financial statements. The 2012 audit resulted in a qualified opinion because...
-
A Bipartisan Policy Center article indicated that 57.5% of the voting-age voters cast ballots in the 2012 presidential election. It also indicated that 70% of registered voters voted in the election....
-
How can new methods of promotion through the internet assist the sales process?
-
Victor sells to Bonnie a refrigerator for $600 payable in monthly installments of $30 for twenty months. Bonnie signs a security agreement granting Victor a security interest in the refrigerator. The...
-
A cyber security consultant is examining security control classes for an Infrastructure as a Service (IaaS) provider. The classes measure how effectively assets are protected. What security control...
-
It is desired to chill 3m of water per hour by means of horizontal coils in which ammonia is evaporated. The steel coils are 2.13cm outside diameter and 1.71cm inside diameter and the water is pumped...
-
What are the three forms of property seizure that nations might pursue?
-
Mark and Patricia report adjusted gross income of $380,500 and itemized deductions of $64,000 for the interest on their home acquisition mortgage (principal amount of $890,000), taxes, and charitable...
-
What dangers does conflict abroad present to companies?
-
During 2017, Raymond, a single individual, earned a salary of $196,000. He also had the following items of investment income: $40,000 net short-term capital gain on sale of stock, $7,000 dividend...
-
Imagine that you are the new director of a major international lending institution that gets its funding from member countries. You are evaluating your organizations lending policies and priorities....
-
Find an annual report for a company of interest (perhaps your employer). Publicly held company annual reports (10K) can be located via Edgar Archives on the Security and Exchange website. To perform...
-
Explain the term "Equivalent Units". Why are they calculated in process costing? [4 Marks] [minimum 350 words]
-
Maximum Revenue The total revenue R earned per day (in dollars) from a pet-sitting service is given by R(p) = 12p2 + 150p, where p is the price charged per pet (in dollars). (a) Find the revenues...
-
To expand its clothing line, a small corporation borrowed $775,000 from three different lenders. The money was borrowed at 8%, 9%, and 10% simple interest. How much was borrowed at each rate when the...
-
Determine whether the function has an inverse function. If it does, find the inverse function. 1. f (x) = x2 + 8 2. f (x) = |x2 - 3| + 6 3. f (x) = 3x x
-
The properties of water and steam become identical at (a) 0.1 bar (b) 1 bar (c) \(100 \mathrm{bar}\) (d) 212.2 bar.
-
Steam from an engine exhaust at 1.25 bar flows steadily through an electric calorimeter and comes out at \(1 \mathrm{bar}, 130^{\circ} \mathrm{C}\). The calorimeter has two \(\mathrm{kW}\) heaters...
-
In thermodynamic analysis, a pure substance is that which (a) Consists of only a single chemical species (b) has no dissolved impurities (c) may have a number of chemical species but the composition...
Study smarter with the SolutionInn App