When you use the bisection method to find the roots of a function $f(x)$, you have to start with values $a$ and $b$ such that $f(a)$ and $f(b)$ have different signs- so (by the intermediate value theorem) you can find a root between $a$ and $b$. Only thing is... I'm automating the process with some code, and the code is supposed to be very general- so any combinations of regular algebraic arithmetic, trigonometry, logarithms, and hyperbolic functions.
This makes it pretty hard to estimate $a$ and $b$ on the spot such that they have opposite signs. Is there any way I can do this (without randomizing $a$ and $b$ and then running values through the same function to hone them down until they have separate signs)?
Thanks
Edit: I'm using an algorithm called Lehmer-Schur which is generalized to complex values using disks rather than a specific interval. I realize that it would be a lot simpler to pick really big bounds or try using some kind of randomizer, but this seems really crude and I was hoping there'd be a better solution. This is a big ask since (within the restrictions on composition mentioned above) there are no limits on the complexity of the function- so I understand that this may not be possible at all. I'm just keen to know what other people are doing or if there are any smart solutions.