Hello, I'm working on a problem in C. I was wondering if someone could tell me what they think this statement is asking for:
"The search function should begin at x = 1.0001 and proceed in increments of dx = 2 until an interval [a,b] is found where f(a)* f(b) <= 0 or x > 50. The function should return a value of "a", so that a+2 will be the other starting point for secant."
I read it and I think it looks like to me that x = a and that it wants me to keep adding 2 to a and that b = a + 2.
I've writtin this code to apply it:
Code:
double search ( double theta_12, double theta_23 ) {
double a, b, low_a ;
a = 1.001 ;
b = a + 2 ;
while ((f(a,theta_12,theta_23) * f(b,theta_12,theta_23))> 0 && a < 50)
{
a = a+2;
b = a+2; }
return (a) ;
printf("%f",a);
}
I'm just wondering if anyone who reads the problem intreprets it any different than I have? I'm not sure about the (x = a) part, I'm kind of just assuming that.
thank you