简体   繁体   中英

Bisection algorithm to find multiple roots

Is there a way to find all the roots of a function using something on the lines of the bisection algorithm?

I thought of checking on both sides of the midpoint in a certain range but it still doesn't seem to guarantee how deep I would have to go to be able to know if there is a root in the newly generated range; also how would I know how many roots are there in a given range even when I know that the corresponding values on applying the function are of opposite sign?

Thanks.

The bisection algorithm can be used to find a root in a range where the function is monotonic. You can find such segments by studying the derivative function, but in the general case, no assumptions can be made as to the monotonicity of a given function over any range.

For example, the function f(x) = sin(1/x) has an infinite number of roots between -1 and 1 . To enumerate these roots, you must first determine the ranges where it is monotonic and these ranges become vanishingly small as x comes closer to 0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM