Bisection


    Bisection is one of the method to solving Nonlinear equation problem or to Finding root.
The bisection method is a bracketing technique used to find the root of a function within an initial guess (a and b). The desired root (c) is located between the left point (a) and the right point (b). During the process, the interval [a,b] is repeatedly halved, reducing its width until the specified tolerance is met, resulting in the identification of the root.

Bisection Formula :

\[c_i=\frac{a_i+b_i}{2}\] for i=0,1,2,3,....,n

where :
  - ci is center point(position of intersection).
  - ai is left point.
  - bi is right point.


Bisecton Method:
To approximate a root of the equation f(x)=0 in the interval [a,b].
Proceed with the method only if f(x) is continuous and f(a) and f(b) have opposite signs.

Input :
-f(x) as the function.
-[a,b] as the interval.
-delta as the tolerance.

Output :
-Root or c.
-Error or accuracy.
-Residual f(c).

Algorithm :

ya=eval f(a);
yb=eval f(b);
if (ya*yb) > 0  break,end
max1=1+round((log(b-a)-log(delta))/log(2));
for i=1 to max1
  c=(a+b)/2
  yc=eval f(c);
  if (yc=0)
   a=c;
   b=c;
  else if (yb*yc)>0
   b=c;
   yb=yc;
  else
   a=c;
   ya=yc;
  end;
  if (b-a) < delta   break,end
endfor
c=(a+b)/2;
err=abs(b-a);
yc=eval f(c);

For demo, just click Run.

Input :

Y = F(x)=

a =

b =

delta =

Graph :

domain x from: x1 =  to  x2 =


Iteration :

Here is an explanation of iteration :