I'm trying to write a code that calculates Newton's method, not an assignment, just for myself.
I'm having trouble with the function I put together to estimate values that will bring the polynomial close to 0.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

int estimate(float fx[][2], int s)
{
int i=0;
float v1, v2=0, est1=0, est2=0;
do{
v1=0;
est1=rand()%5;
for(i=0;i<s;i++)
v1+=(fx[i][0])*(pow(est1, fx[i][1]));
}while((v1>5)(v1<0));
do{
v2=0;
est2=rand()%5;
for(i=0;i<s;i++)
v2+=(fx[i][0])*(pow(est2, fx[i][1]));
if((v2>5)&&(v2<0))
break;
}while(1);
printf("est1=%.0f v1=%.0f\nest2=%.0f v2=%.0f", est1, v1, est2, v2);
return 0;
}
 
when I step into it while debugging, it gets stuck on v1+=(fx[i][0])*(pow(est1, fx[i][1])); and sends me to the math.h library.
However, when I debug it and step OVER the entire sequence, the the code goes on as expected and delivers proper results.
If I try to run without debugging, the output window stops at the point where the function is called, not even ending, just getting stuck.
Any ideas?
Also, I'm not really sure what you'd need to know to help, so if you want to see the whole thing, I'll post it, or explain the variables or whatever:)