Date: Tue, 22 Feb 94 14:27:55 EST From: Mihaly Mezei Subject: Coprocessor emu problem To: djgpp list ======================================================================== 100 Greetings, In using the djgpp C compiler I found out that the EMU387 math coprocessor emulator is not calculating properly the function acos when the argunent is close to zero. Below is a small program and its output demonstrating the problem. After hanig installed an Intel coprocessor, the problem disappeared. Mihaly Mezei Department of Physiology and Biophysics Mount Sinai School of Medicine, CUNY New York, NY 10029 (212) 241-2186 memms AT cunyvm DOT cuny DOT edu #include #include FILE *fopen(), *fpin; main () {float ca,ac,cca,d; int i; fpin=fopen("ACOST.OUT","w"); for (i=0; i<=20; i++) {ca=((float) i)/20.0; ac=acos(ca); cca=cos(ac); d=cca-ca; ac=ac*180.0/PI; fprintf(fpin,"i=%3d cos(alpha)=%8.5f alpha=%11.5f dev=%f\n", i,ca,ac,d);} } =============================================================== i= 0 cos(alpha)= 0.00000 alpha= 87.61678 dev=0.0415831 i= 1 cos(alpha)= 0.05000 alpha= 86.41930 dev=0.0124544 i= 2 cos(alpha)= 0.10000 alpha= 84.04831 dev=0.0036898 i= 3 cos(alpha)= 0.15000 alpha= 81.31081 dev=0.0010743 i= 4 cos(alpha)= 0.20000 alpha= 78.44518 dev=0.0003053 i= 5 cos(alpha)= 0.25000 alpha= 75.51751 dev=0.0000840 i= 6 cos(alpha)= 0.30000 alpha= 72.54106 dev=0.0000222 i= 7 cos(alpha)= 0.35000 alpha= 69.51234 dev=0.0000057 i= 8 cos(alpha)= 0.40000 alpha= 66.42174 dev=0.0000013 i= 9 cos(alpha)= 0.45000 alpha= 63.25629 dev=0.0000003 i= 10 cos(alpha)= 0.50000 alpha= 59.99999 dev=0.0000001 i= 11 cos(alpha)= 0.55000 alpha= 56.63299 dev=0.0000000 i= 12 cos(alpha)= 0.60000 alpha= 53.13010 dev=0.0000000 i= 13 cos(alpha)= 0.65000 alpha= 49.45840 dev=0.0000000 i= 14 cos(alpha)= 0.70000 alpha= 45.57299 dev=0.0000000 i= 15 cos(alpha)= 0.75000 alpha= 41.40962 dev=0.0000000 i= 16 cos(alpha)= 0.80000 alpha= 36.86990 dev=0.0000000 i= 17 cos(alpha)= 0.85000 alpha= 31.78833 dev=0.0000000 i= 18 cos(alpha)= 0.90000 alpha= 25.84193 dev=0.0000000 i= 19 cos(alpha)= 0.95000 alpha= 18.19487 dev=0.0000000 i= 20 cos(alpha)= 1.00000 alpha= 0.00000 dev=0.0000000 ================================================================