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

  Write a program to produce a double table

Using the ROL instruction to perform multiplication, write a program to produce a double table. This table should be built from a single int32 value provided by the user and print 3 rows beginning with the starting value. Within that row, the pattern..

  Computer will ever be developed which can think like human

Do you think a computer will ever be developed which can think like human? Write down the ethical implications of creating such a computer?

  Using one- and two-dimensional arrays with functions.

Objective using one- and two-dimensional arrays with functions.

  Explain vulnerability in the system

How would you respond if Goli came to you describing a vulnerability in your system and offering to help fix it--What would incline you to hire her? What would disincline you from doing so?

  What project management practice

how would you determine its risks? • What project management practice, tool, or technique would be the most effective in mitigating that risk? Explain.

  Write a java program to demonstrate the use of linked-lists

Once you have processed the d4.dat file and the d4.delete file, it is a simple matter of iterating over the list and writing the object data to the outputfile. The output file size will be 22,725 or 27,270 bytes depending on platform and methods u..

  Effective user-level thread implementation

What must a kernel provide for an effective user-level thread implementation? Do you have immediate help for this answer?

  Declare an arraylist named taxrates

Declare an ArrayList named taxRates of five elements of type Double and initialize the elements (starting with the first) to the values 0.10 , 0.15 , 0.21 , 0.28 , 0.31 , respectively.

  Create any required pointers needed to complete insertion

Assume that the list pointed to by startPtr is maintained in alphabetical order. (Note: you do not know what is in the list, only that it is maintained in alphabetical order.)

  Use a loop to traverse each character in the input string

Write a program in the file freq.cpp which reads a string from the user and computes the frequency of each letter that appears in the string.

  Compare and contrast their relative strengths and weaknesses

The system to be developed is intended to be operational in a small market firm or small business firm or even in home usage. Familiar examples might include an income tax preparation package by a small tax consulting firm.

  Design a plan for email content which was leaked

Suppose that you feel that your (or your boss's) email content was always leaked (e.g., some confidential information in your email was known to many others). Design a plan for this investigation.

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