I'm trying to find a roo开发者_如何学JAVAt of a function that may be immediately before it begins having only imaginary values. (Specifically, it's the intersection of a line and a half-circle.) Obviously neither Brent's nor the bisection method will work; neither will Newton's method. Is there a less-obvious one that will?
Rather than trying to solve the equation
f(x) == 0
you could instead try to solve
abs(f(x)) == 0.
For example you could use bisection to find minima. In cases like the one you mention it may even be beneficial to solve
abs(f(x))**2 == 0,
because this way you void some square roots.
is it polynomial function? maybe you can use laguerre method, http://mathworld.wolfram.com/LaguerresMethod.html
精彩评论