pete@hao.UUCP (Pete Reppert) (10/11/85)
*** REPLACE THIS LINE WITH YOUR MESSAGE ***
O.K. I take it there just aren`t any easy-as-pie ways
to find the roots to a cubic eqaution except synthetic
division, which doesn`t seem to work always. How do you
know when not to use synth division, and of the many
other baroque methods, which are most popular? What
indicators do you look out for, etc.?
Any replies, wisecracks, etc. welcome.
--
Pete Reppert
HAO/NCAR
PO BOX 3000
Boulder, Colorado 80307 gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (10/12/85)
> O.K. I take it there just aren`t any easy-as-pie ways > to find the roots to a cubic eqaution except synthetic > division, which doesn`t seem to work always. How do you > know when not to use synth division, and of the many > other baroque methods, which are most popular? What > indicators do you look out for, etc.? Synthetic division is useful for factoring out one of the primitive polynomials, once you have found it, thereby reducing the degree of the polynomial. However, all polynomials through quartics have exact analytical solutions, which can be found in math handbooks. Computationally, care must be taken or one gets incorrect results. E.g., exponents can overflow if you don't scale.
ashby@uiucdcsp.CS.UIUC.EDU (10/15/85)
There is an "easy" closed formula for the roots of an arbitrary
cubic (and quartic). You should be able to find it in any book
of mathematical formulae (eg, CRC). However, if you need to
compute these roots, then the formulae are not very good.
The following "algorithm" is a numerically stable way of computing
the roots of any nth degree polynomial (n not too big):
1) Set up the poly's companion matrix. (This is defined in almost
any linear algebra book.)
2) Now compute the eigenvalues of the matrix. To do this the
package EISPACK is recommended. (If you don't have this
pkg, you should get it; it is in the public domain.)
3) These egvals are the desired roots of the poly.hall@uiucdcsp.CS.UIUC.EDU (10/17/85)
A simple,reliable method for a cubic with real coefficients is to arrange for a/the real root to lie in (0,1)-by using x:=-x and x:=1/x -and then use bisection. . q - w