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.