Write a double precision function

Assignment Help Basic Computer Science
Reference no: EM13307253

Write a double precision function (result returned in $f0) with one double precision parameter (in $f12), along with a little driver program for testing your function. Your function should use the summation formula as an approximation for the value of sin(x). If the absolute value of the next term is less than 1.0e-15, then terminate the summation. Even though the summation is valid for all values of x, there is a problem with convergence when you use values of x having absolute values greater than 30 or so. You may assume that we will test your program with values within this range.

(sample execution)

Enter a (radian) value for x (or 999 to exit): 0

Our approximation for sin(0) is 0

Enter a (radian) value for x (or 999 to exit): 1

Our approximation for sin(1) is 0.8414709848078965

Enter a (radian) value for x (or 999 to exit): -10

Our approximation for sin(-10) is 0.54402111088906224

Enter a (radian) value for x (or 999 to exit): 1.570796326794896   [?/2]

Our approximation for sin(1.5707963267948959) is 1

Enter a (radian) value for x (or 999 to exit): -.5232

Our approximation for sin(-0.5232) is -0.49965461045512305

Enter a (radian) value for x (or 999 to exit): -.5235987755982988 [-?/6]

Our approximation for sin(-0.52359877559829882) is -0.5

Enter a (radian) value for x (or 999 to exit): 999

Exit

 

Reference no: EM13307253

Questions Cloud

Competencies between nurses prepared : Write a formal paper discussing the differences in competencies between nurses prepared at the associate-degree level versus the baccalaureate-degree level in nursing.
Compute the fraction of time mary spends using her telephone : Assuming a single-server limited-capacity Bernoulli queuing process with 1-minute frames, compute the fraction of time Mary spends using her telephone.
Long cylindrical glass tube : A 10.0cm long cylindrical glass tube, sealed at one end, is filled with ethanol. The mass of ethanol needed to fill the tube is found to be 11.48g . The density of ethanol is 0.789 g/mL.
Find the gauge pressure of the water guns reservoir : A hand-pumped water gun is held level at a height of 0.84 m above the ground and fired. Find the gauge pressure of the water gun's reservoir
Write a double precision function : Write a double precision function (result returned in $f0) with one double precision parameter (in $f12), along with a little driver program for testing your function.
What is the total delay per cycle and delay per vehicle : A left-turn movement has a maximum arrival rate of 200 veh/h. The saturation flow of this movement is 1400 veh/h. For this approach, the yellow time is 4 seconds, all red time is 2 seconds and total lost time is 3 seconds.
Permanent label may be placed ob a radiograph : State three ways a permanent label may be placed ob a radiograph. For each state the procedure for doing so and a disadvantage for each method? Explain how you would determine the amount of time a film should stay in the developer solution of the man..
Especially responsive to magnetic fields : The cobalt(II) ion, Co^(2+), is especially responsive to magnetic fields, more so that Co^(1+) and Co^(3+). Why
What is the resulting ciphertext : Consider WEP for 802.11. Suppose that the data is 10101010 and the keystream is 11110111. What is the resulting ciphertext?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Picking a location for a network operation center noc

What are the three key factors that you would consider in picking a location for a Network Operation Center? (NOC)?

  The concept of global and scope of variables

Having looked at what happens to variables within functions and the concept of global and scope of variables, reflect on why Vectors are such a useful data structure. Explain your reasoning and provide examples to support it.

  Features of organization to make and use information systems

Write down the features of organizations do managers require to know about to make and use information systems successfully?

  Conduct observation used in business or organization

Conduct the observation to someone involved in procedure which is used in the business or organization. This person could be someone at university.

  Write command to determine users on active directory from xp

Write down the command to determine all users on Active Directory from XP. Write down the query to look up a user on Active Directoy and see the user's property.

  Channel along which bits transfer circuitry of computer

Within circuitry of computer, each channel along which bits transfer, called a(n) ____, permits the several devices both inside and attached to system unit to communicate with each other.

  What client-server technology

What client-server technology was used to create the webpage.

  Finding counterexample-algorithm based on greedy strategy

Determine a counterexample for following algorithm based on greedy strategy.

  Create a class to represent a triangle by storing

Create a class to represent a triangle by storing the lengths of its sides. Make the data members private and provide the typical get/set (accessor/mutator) routines associated with your data members.

  Design the static method below to count

Design the static method below to count and return the frequency of each digit in the array of strings.

  The radar gun used by a police officer

The radar gun used by a police officer outputs a radar signal and measures the speed of the cars as they pass. However, when the officer wants to ticket an individual for speeding

  Logic circuit to figure out how many of the bits

Design a logic circuit to figure out how many of the bits in a 6 bit unsigned number equal 1. Design the simplest possible circuit to accomplish this.

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