5903 Intro Scientific Prog:
CORDIC: Specification

  1. The program should compute sin(x) for a given list of input floats in three different ways.
  2. You should create two procedures in seperate input files.  One computes the sine using the CORDIC algorithm (see for example the Wikipedia discussion) with 32 iterations.  I put a brief write up (mainly taken from Wikipedia and an MAA article) on the web at CORDIC.html . The second computes the sine using a truncated Maclaurin polynomial of order 6 in nested or Horner form. You should use the float to fixed point procedure FloatToFixed.c and provided.  It is tested using a FixedToFloat.c procedure, a test file ListOfReals.txt and a FloatTest.c program in the same readable directory. 
  3. Each line of the output should be the xvalue followed by the CORDIC, then Maclaurin, then C-library values of sine.  The values should be seperated by two spaces.  
  4. Test your code on the the test file.
  5. By commenting out portions of the code and creating a large test file estimate the speed of each sine computation. Include a discussion of the speed and accuracy in the README file.