Clear["Global`*"]

Stephanie’s code:

f[x_]:=(x/12)*87750/(1-(1+x/12)^(-180))-980.96
a=.1025;
b=.14;
fa=f[a];
fb=f[b];
c=a+.05*(b-a);
While[a<c<b, (* Note: this works in Mathematica! *)
Do[fc=f[c];
If[Sign[fc]==Sign[fa],a=c;fa=fc,b=c;fb=fc]];
c=a+.5*(b-a);]
c

Now let’s try that other function:

f[x_] :=x * Exp[-x] -0.16064
a = 0;
b = .3;
fa=f[a];
fb=f[b];
c=a+.05*(b-a);
While[a<c<b, 
Do[fc=f[c];
If[Sign[fc]==Sign[fa],a=c;fa=fc,b=c;fb=fc]];
c=a+.5*(b-a);]
c