I am wondering if it is possible that the following C program prints something else then 0?
double f(double x, double y) {
return x*x/x+x*x*x; // or whatever operations using *, /, +, -
}
int main(int argc, char** argv) {
double x = 4.0;
double y = 5.0;
double z = f(x,y);
x += 1e-7;
x -= 1e-7;
printf("%f\n", (f(x,y+1e-7)-z)/1e-7);
return 0;
}
Can anyone enlighten me regarding this? Cheers,