I'm looking for a specialised algorithm to find positive real solutions to quartic equations with real coefficients (also know as bi-quadratic or polynomial equations of order 4). They have the form:
a4 x4 + a3 x3 +a2 x2 +a1 x + a0 = 0
with a1, a2,... being real numbers.
It's supposed to run on a microcontroller, which will need to do quite a lot of those calculations. So performance is an issue. That's why I'm looking for a specialised algorithm for positive solutions. If possible I'd like it to compute the exact solutions.
I know there is a general way to compute the solution of a quartic equation but it is rather involved in terms of computation.
Can someone point me in the right direction?
Judging from the answers: Some seem to have misunderstood me (though I was pretty clear about it). I know of the standard ways of solving quartic equations. They don't do it for me - neither they fit in the memory nor are they sufficiently fast. What I would need is a high accuracy highly efficient algorithm to find only real solutions (if that helps) to quartic equations with real coefficients. I'm not sure there is such an algorithm, but I thought you guys might know. P.S.: The downvotes didn't come from me.
This is one of those situations where it is probably easier to find all the roots using complex arithmetic than to only find the positive real roots. And since it sounds like you need to find multiple roots at once, I would recommend using the Durand-Kerner method, which is basically a refinement of the method of Weierstrass:
http://en.wikipedia.org/wiki/Durand%E2%80%93Kerner_method
Weierstrass' method is in turn a refinement of Newton's method that solves for for all the roots of the polynomial in parallel (and it has the big advantage that it is brain-dead easy to code up). It converges at about quadratic rate in general, though only linearly for multiple roots. For most quartic polynomials, you can pretty much nail the roots in just a few iterations. If you need a more general purpose solution, then you should use instead use Jenkins-Traub:
http://en.wikipedia.org/wiki/Jenkins%E2%80%93Traub_method
This is faster for higher degree polynomials, and basically works by converting the problem into finding the eigenvalues of the companion matrix:
http://en.wikipedia.org/wiki/Companion_matrix
EDIT: As a second suggestion, you could also try using the power method on the companion matrix. Since your equation has only non-negative coefficients, you may find it useful to apply the Perron-Frobenius theorem to the companion matrix. At minimal, this certifies that there exists at least one non-negative root:
http://en.wikipedia.org/wiki/Perron%E2%80%93Frobenius_theorem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With