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.
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
[2024-5-10. : 8:46 pm]
NudeRaider -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
https://armoha.github.io/eud-book/
[2024-5-10. : 8:36 am]
Brusilov -- Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
[2024-5-09. : 11:31 pm]
Vrael -- :wob:
[2024-5-09. : 8:42 pm]
Ultraviolet -- :wob:
[2024-5-08. : 10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[2024-5-08. : 10:01 pm]
Vrael -- Alright fucks its time for cake and violence
[2024-5-07. : 7:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
Please log in to shout.


Members Online: Roy, RIVE