Article ID: 122265
Article Last Modified on 7/5/2005
/* Compile options needed: /G5 /Og
*/
#include <stdio.h>
//#pragma optimize("g", off) //uncomment to fix the problem
void main()
{
double polylgd[5] = {0.0, 0.0, 0.0, 1.0, 1.0};
double valpol,an,an1,temp,dtemp;
double *polyptr;
int i;
polyptr = &polylgd[4];
an = *polyptr--;
an1 = *polyptr--;
for (i = 4; i >= 2; i--)
{
dtemp = (double) (i - 1.0) / (double) i ;
temp = dtemp * an;
temp = *polyptr - temp;
*polyptr--;
an = an1 + (dtemp + 1.0) * (-0.5) * an;
an1 = temp;
}
valpol = an1 + (-0.5) * an;
printf("value should be: 0.14843750\n");
printf("value this run is %.8lf\n", valpol);
}
Additional query words: 8.00 9.00 1.00 2.00 2.10 buglist1.00 buglist2.00
Keywords: KB122265