Staredit Network > Forums > Technology & Computers > Topic: Programming problem
Programming problem
Feb 27 2008, 3:12 am
By: MillenniumArmy  

Feb 27 2008, 3:12 am MillenniumArmy Post #1



Determine the number of terms necessary to approximate cos x to 8 significant figures using the Maclaurin series approximation

cosx=1-x^2/2!+x^4/4!-x^6/6!+x^8/8!....

Calculate the approximation using a value of x=0.3pi. For each iteration, calculate the approximation of cosx, the true percent relative error and the approximate percent relative error. Write the results to an output file (this last part I can do so don't worry about it.)


*note
True percent relative error = (True Value – Calculated Value)/True Value
Approximate percent relative error = (Current Value – Previous Value)/(Current Value)
To calculate a value correct to ‘n’ significant digits, we were told to use something like: ABS(True Relative Error)<=0.5*10^-n

As unfortunate as it is, our class uses Fortran. So if you guys could, could you give me your answer either in Fortran, pseudocode, or if all else fails, C++.

Any help appreciated ASAP.



None.

Feb 27 2008, 3:53 am Test Post #2



Your current code would be nice.



None.

Feb 27 2008, 6:13 am MillenniumArmy Post #3



nvm I got it.



None.

Feb 27 2008, 6:15 am DT_Battlekruser Post #4



Mathematicians just use the Lagrange Error Bound. :P



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[08:05 pm]
Symmetry -- 50% of strings in starcraft are references
[2026-6-07. : 1:59 am]
RIVE -- Lots of fun little nods to different works of others in the cheats too.
[2026-6-06. : 5:17 pm]
Oh_Man -- so i was today years old wen i learned rebel yell starcraft mission is named after a billy idol song. makes me wonder wat other missions are named after songs
[2026-6-04. : 3:42 am]
RIVE -- Hellooooo, Nurse
[2026-6-03. : 4:19 pm]
NudeRaider -- Hello World!
[2026-6-01. : 4:03 pm]
IskatuMesk -- no Hello World? No Hello . jpeg? Not even ddosing some government website? smh my head
[2026-5-31. : 10:02 pm]
Symmetry -- I was really just figuring out how to compile
[2026-5-31. : 10:02 pm]
Symmetry -- I didn't make it do anything
[2026-5-31. : 9:17 pm]
Ultraviolet -- hell yeah. did you have trouble making the button functional, or just haven't gotten there yet?
[2026-5-31. : 8:29 pm]
Symmetry -- I made the marine shoot lasers and gave the medic a nonfunctional button
Please log in to shout.


Members Online: RIVE