Find all the roots of a function in an interval

I have a function of one variable, and I want to find all the roots in an interval. The roots are simple, and their derivative is different than cero. I want a function that accepts alike arguments the function and the interval; and returns a vector with the roots.

Does Julia have a function for this purpose? or Is there a macro For this purpose?

Roots.jl has what you want.

1 Like

Yes, find_zeros from Roots should work for this task. If not, the package has a more robust implementation.