I want to use bisection method to find all roots of an equation within a given domain. my algorithm logic is very simple , divide the given domain into sub domains such that for any given sub-domain only one root exists at most. check if f(a)*f(b)<0 if no then skip to next interval else find root(bisection). my problem however how do I decide the appropriate sub domain size? for a stable function that doesn't change direction often having a small interval would be a waste of time wheres for a fast "unstable" function using a big interval might risk having more than one root in an interval.
is there anyway that using the first two derivatives that I can tell me about the behavior of a function to come up with an appropriate interval accordingly?