Efficient Root Finding Algorithm for a Transcendental Equation I hope the image below captures the details of the problem in which I'm trying to find the multiple roots of $f(s)$ for $s<w$ given $w>0$. The constants $a,b,c,d$, and $w$ are all real-valued and positive with in addition $d>1$, and the plots of $f(s)$ and $g(s)$ are for the specific values indicated.

The function $g(s)$ is related to $f(s)$ according to
$$g(s)=\frac{f(s)}{\cos[P(s)]\cos[aQ(s)]}$$
so that they share the same zeroes. However, the asymptotes to $\pm \infty$ of $g(s)$ do not line up with the extrema of $f(s)$. The zeroes however, are bracketed by the asymptotes which contrary to what I had at first suspected do not correspond to either
$$P(s)=\pm (2k-1)\frac{\pi}{2}$$
or
$$aQ(s)=\pm (2k-1)\frac{\pi}{2}$$
I need suggestions for an algorithm more efficient than a linear search and bisection, that I can encode in a VBA module of an Excel spreadsheet. I need these zeroes to be able to apply the Cauchy Residue Theorem to the inversion of a Laplace transform that arises out of the solution to a transient diffusion equation.
Thanks
 A: Since the roots are bracketed, I suggest  that you use a method which combines Newton and bisection steps (bisection being used when Newton tends to take you out of the range). This is extremely efficient.
If you go here, on page $359$, you will find subroutine $\text{RTSAFE}$ (here and here) which does exactly what you want. It is very robust.
I apologize for giving you a reference to Fortran coding. If you can access the books of Numerical Recipes, you will find the equivalent in $C$ and $C$++.
A: If I create a function $h(s)$ by dividing $g(s)$ by $P(s)\tan[P(s)]$, then the asymptotes are at
$$
\bar s_k=\Biggl[\Bigl(\frac{k\pi}{b}\Bigr)^2+w\Biggr], k=1,2,\cdots
$$
so that the zeroes are now bracketed. I now work only with $f(s)$. I start with the right (higher) end of the interval and sample $f(s)$ in equal increments towards the left (lower) end until a sign change is detected. I then use the mid point between the last two sample points as an initial guess and use a Newton-Raphson procedure which should converge in a handful  of iterations to the root.
