home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / sci / math / numanal / 2570 < prev    next >
Encoding:
Text File  |  1992-08-27  |  2.7 KB  |  58 lines

  1. Newsgroups: sci.math.num-analysis
  2. Path: sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!jonathan
  3. From: jonathan@chpc.utexas.edu (Jonathan Thornburg)
  4. Subject: Re: Solutions to quartic and cubic eqns.
  5. Message-ID: <1992Aug27.175551.23486@chpc.utexas.edu>
  6. Summary: numerical zero-finding is probably more accurate, try ZEROIN
  7. Keywords: quartic cubic quadratic equation zero root ill-condition ZEROIN
  8. Sender: jonathan@einstein.ph.utexas.edu
  9. Organization: U of Texas at Austin / Physics Dept / Center for Relativity
  10. References: <1992Aug25.161234.13275@magnus.acs.ohio-state.edu>
  11. Date: Thu, 27 Aug 92 17:55:51 GMT
  12. Lines: 44
  13.  
  14. In article <1992Aug25.161234.13275@magnus.acs.ohio-state.edu>
  15. kiyer@magnus.acs.ohio-state.edu (Karthik A Iyer) writes:
  16. >                I am looking for a routine(s) or a place where I can find 
  17. >them (FTP sites, etc) to solve quartic and cubic eqations. I realize that 
  18. >analytic solutions exist, but my problem is that the coefficients of the 
  19. >powers vary by as much as 10-15 orders of magnitude. So, a small error is
  20. >solving the for the cubic's root leads to large errors when that root is
  21. >used to solve for the four roots of the quartic. Any help or leads  would be
  22. >appreciated. I would prefer to get my hands on a FORTRAN double precision 
  23. >routine. Thanks in advance,
  24.  
  25. Unfortunately, the "classical" closed-form analytical solutions
  26. tend to be quite ill-conditioned, *especially* when the coefficients
  27. are widely varying in magnitude.
  28.  
  29. I suspect you would get much more accurate results if you simply
  30. used a good numerical zero-finding code to numerically locate the
  31. (a) zero of your quartic/cubic.  (Of course, you still have to be
  32. able to *evaluate* the quartic/cubic, which is itself rather tricky
  33. when the coefficients are so disparate in magnitude.  But that's
  34. still a much easier problem than trying to find the roots directly.)
  35.  
  36. An excellent zero-finding code is ZEROIN, available from netlib
  37. via
  38.  
  39.     echo 'send zeroin from fmm' | Mail netlib@ornl.gov
  40.  
  41. This will get you a Fortran subroutine with all the documentation
  42. you need to use it.  For more details, see either the (excellent,
  43. superb, ++good, highly recommended) book
  44.  
  45.         G. E. Forsythe, M. A. Malcolm, and C. B. Moler
  46.         "Computer Methods for Mathematical Computations"
  47.         Prentice-Hall, Englewood Cliffs, 1977
  48.  
  49. or section 9.3 of Numerical Recipes.  Be warned, though, that the
  50. code for ZEROIN given in Numerical Recipes (where it's called ZBRENT)
  51. has been "improved", and is of somewhat lower quality than the
  52. original one you'll get from netlib.
  53.  
  54. - Jonathan Thornburg
  55.   <jonathan@einstein.ph.utexas.edu> or <jonathan@hermes.chpc.utexas.edu>
  56.   University of Texas at Austin / Physics Dept / Center for Relativity
  57.   and (for a few more months) U of British Columbia / {Astronomy,Physics}
  58.