bisection[a_, b_, f_] := 
Module[{fa  = f[a],
fb =  f[b],
c = a + 0.5 * (b-a)},
While[a < c && c <b,
fc = f[c];
If[Sign[fc] == Sign[fa],
{a, fa} = {c, fc}, 
{b, fb} = {c, fc}];
c= a + 0.5 * (b -a);]
Print[c]]

f[x_] :=x * Exp[-x] -0.16064

a := -0.05;

b := 0.05;

bisection[a_, b_] := 
Module[{fa  = f[a],
fb =  f[b],
c = a + 0.5 * (b-a)},
While[a < c && c <b,
fc = f[c];
If[Sign[fc] == Sign[fa],
{a, fa} = {c, fc}, 
{b, fb} = {c, fc}];
c= a + 0.5 * (b -a);
Print[c]]
Print[c]]

bisection[-0.1, 0.5]