I cant get this function to recursively call itself what do i have in wrong i go through debugger and it just slides right over the recursive call
double recursive (double left, double permaRight,double permaTol, double right, double tol)
{
double leftArea, rightArea, fullArea, areaAB, finalArea=0, recursiveAreaDifference=0, midpointer;
leftArea = funcArea(F(left), F(midpoint(left,right)), midpoint(left,right),left);
rightArea = funcArea(F(right), F(midpoint(left,right)), midpoint(left,right),right);
fullArea = funcArea(F(left),F(right),(midpoint(left,right)*2),0);
areaAB = (leftArea +rightArea);
midpointer = midpoint(left,right);
finalArea += areaAB;
if(left == permaRight)//if the changing left bound = the user defined right limit
{
return finalArea; //progressive addition of the area
}
if((areaAB) <= ((fullArea + tol)||(fullArea -tol)))
{
permaTol -( fabs(areaAB - fullArea));
recursiveAreaDifference += fabs((areaAB - fullArea));
left = right;
right = permaRight;
return (recursive(left,permaRight,permaTol, right, tol));
}
else
{
return recursive(left,permaRight, permaTol, midpoint(left,right), tol/2);
}