Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struggles with "simple" complex polynomials #122

Open
dpsanders opened this issue Mar 25, 2019 · 3 comments
Open

Struggles with "simple" complex polynomials #122

dpsanders opened this issue Mar 25, 2019 · 3 comments

Comments

@dpsanders
Copy link
Member

julia> roots(x->24.109999999999996 - 70.33*x + 65.33*x^2 - 15.11*x^3 - 5.0*x^4 + 1.0*x^5, Complex(-10..10, -10..10), Krawczyk)

apparently hangs

@OlivierHnt
Copy link
Member

Currently, provided that the derivative is explicitly prescribed, the code no longer hangs. However, it gives many trivial roots except for one which is claimed to be unique... but unfortunately even this root seems not correct 😨.

@Kolaru
Copy link
Collaborator

Kolaru commented Nov 29, 2024

Are you sure you got the derivative right ? I made a mistake and got trivial interval like you, but then corrected it and got it to hang (max_iteration saving me again).

julia> f(x) = 24.109999999999996 - 70.33*x + 65.33*x^2 - 15.11*x^3 - 5.0*x^4 + 1.0*x^5
f (generic function with 1 method)

julia> df(x) = -70.33 + 2*65.33*x - 3*15.11*x^2 - 4*5.0*x^3 + 5.0*x^4
df (generic function with 1 method)

julia> rts = roots(f, Complex(interval(-10, 10), interval(-10, 10)) ; contractor = Krawczyk, derivative = df, max_iteration = 10000)
1852-element Vector{Root{Complex{Interval{Float64}}}}:
 Root([6.01098, 6.01099]_com_NG + im*[-7.90672e-12, 7.90672e-12]_com_NG, :unique)
 Root([-4.01975, -4.01852]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.01853, -4.01728]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.01729, -4.01604]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.01605, -4.01478]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.01479, -4.01356]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.01357, -4.01232]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.01233, -4.01108]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.01109, -4.00982]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.00983, -4.00858]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 Root([-4.00859, -4.00732]_com + im*[-0.00132114, 0.000989419]_com, :unknown)
 

This is quite wrong regardless.

@Kolaru Kolaru added the v1.0 label Nov 29, 2024
@OlivierHnt
Copy link
Member

Oh maybe I had made a mistake. But still, there should be a safeguard, so that even if I give a wrong derivative, it should not claim that there is a root in an interval when evaluating f on the interval does not contain 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants