07-06-2022, 07:07 AM
@Kernelpanic:
Your program only solves quadratic equations with real solutions (roots).
If you try to solve a quadratic equation with complex roots, you will get an error.
example:
x^4 - 4 x +7 = 0
This equation has two complex roots:
x_1 = 2 - sqr(3i)
x_2 = 2 + sqr(3i)
I have attached a program, which solves the roots of a polynomial up to degree 10.
It gives in the most cases all roots of a polynomial and uses the Lin-Bairstow-Method.
Your program only solves quadratic equations with real solutions (roots).
If you try to solve a quadratic equation with complex roots, you will get an error.
example:
x^4 - 4 x +7 = 0
This equation has two complex roots:
x_1 = 2 - sqr(3i)
x_2 = 2 + sqr(3i)
I have attached a program, which solves the roots of a polynomial up to degree 10.
It gives in the most cases all roots of a polynomial and uses the Lin-Bairstow-Method.