I would like to qualify what John says: "Methods like the secant method are rarely very good choices anyway."
This is arguably true if the Secant Method is used alone. However, it is very useful when used in a "poly-algorithm" such as Matlab's fzero, which as they say is over 40 years old:
Use type fzero to see the code for fzero
Here is the part of fzero pertinent to your question:
if (abs(e) < toler) || (abs(fa) <= abs(fb))
d = m; e = m;
s = fb/fa;
if (a == c)
p = 2.0*m*s;
q = 1.0 - s;
q = fa/fc;
r = fb/fc;
p = s*(2.0*m*q*(q - r) - (b - a)*(r - 1.0));
q = (q - 1.0)*(r - 1.0)*(s - 1.0);
if p > 0, q = -q; else p = -p; end;
if (2.0*p < 3.0*m*q - abs(toler*q)) && (p < abs(0.5*e*q))
e = d; d = p/q;
d = m; e = m;
The Linear Interpolation above is the (2-point) Secant Method. The Inverse Quadratic may be thought of as an Inverse 3-point Secant Method, which is a very clever idea that should be studied carefully.
As you can see, deciding which method to use at any point in the computation is a very delicate business. Take a look at Forsythe, Malcolm, and Moler, which is an old but excellent book. Dahlquist & Bjorck, Numerical Methods in Scientific Computing, Vol 1, 2008, Sec 6.2.4, has a brief explanation of what they call "hybrid methods".
Writing code for such a method is not for the faint-hearted or the amateur: Richard Brent has been, among other things, one of the best numerical analysts in the past 40 years, and still publishes great papers and software.
None-the-less, trying to write such code is a good exercise that should help you appreciate how difficult it is to write robust and efficient numerical software. This, I presume, is the reason your professor set you this exercise.