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.
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[11:43 pm]
Moose -- you don't
[10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
Please log in to shout.


Members Online: Zycorax