It is common that I search numerically for all zeros (roots) of a function in a given range. I have written two simple minded functions that perform this task, and I know of similar functions on this site (e.g. thisthis, thisthis, and thisthis).
I think this community will benefit if we could compile a list of functions that do so, with some explanations about efficiency considerations, in what context should we use which approach, etc.
The problem definition: given a function
f
and a range{x1,x2}
, write a function that finds all (or most) roots off
in the given range.