float f (double x);
float f(double x)
This question is solved by using the Bisection Method. In this question we have lower point and upper point. So xl is representing the lower limit and xu is representing upper limit. When we put xl in the function then result will be negative and when we put xu in function the result will be positive.
This can be checked by ensuring that f(xl)(xu)<0.
An estimate of the root xr is determined by xr=(xl+xu)/2.
In this program we use xrold and xrnew. xrold will be replaced by xrnew when a new point replaced the xl or xu. xr representing the mid point of xl and xu. If the xr<0 then the value of xl is replaced by xr and if the xr>0 then the value of xu will be replaced by xr.
Thee f function is returning the result of x(square)-sin(x)-0.5.