Notes:
* Used DJGPP 2.01 and Allegro 3.11 final
* All results while running under Windows 95, no other apps running (so timer accuracy only 0.005).
* The tear time is the time for it to run the for loops with no code in the brackets.
* The system used was a P200MMX w/32 megs of ram and win 95
Running with gcc -s -o3 -m486 -ffast-math -fomit-frame-pointer times:
Tear Time (for loop): 0.005
Minus tear time: 0.000
atan2: 1.700
Minus tear time: 1.695
fatan2: 0.885
Minus tear time: 0.880
cos: 0.420
Minus tear time: 0.415
fcos: 0.010
Minus tear time: 0.005
The test was done with a loop for(int c=0; c<1000000; c++) {temp = cos(y);} and etc.
Conclusions:
I performed this test to see if there if the setback mentioned in the allegro about fatan and fatan2 was a major one, compared to the other fixed trig functions and to the floating point libc trig. I also tried this test with sin as well, and got the same results as cos--so it seems the cos<>fcos test is representative to all of the trig functions except for arctan. fatan and fatan2 seem to take 1/2 the time of their floating counterparts, and fcos, fsin, ftan, facos, fasin seem to take a insignificant time, even with a million loops, they beat out their libc counterparts and looks like they would hardly affect the program. I also performed the test with fatan2(ftofix(y), ftofix(x)), which takes float y,x and gives a fixed angle. This took 1.7s, which is slightly slower than libc's atan2.