bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] Bug in polynomial root finder


From: Munagala Ramanath
Subject: [Bug-gsl] Bug in polynomial root finder
Date: Sat, 29 Oct 2011 08:22:53 -0700 (PDT)

Hi,

I'm using GSL via Ruby and just found a polynomial for which it fails to find 
roots. However,
I can plug this polynomial into some of the root finders on the web and they 
find roots with
no problems. Here is the code (coefficient array is in reverse order):
----------------------------------------------
#!/usr/bin/ruby

require 'gsl'

# shows bug in GSL polynomial root finder
p = [1, -4, 2, 10, -17, 10, 6, -16, 12, -16, 16, -8, 28, -8, -48, 32]
roots = GSL::Poly[ p.reverse ].solve

puts roots
----------------------------------------------
The output when I run it is:

ruby gsl_bug.rb
gsl_bug.rb:7:in `complex_solve': Ruby/GSL error code 5, root solving qr method 
failed to converge (file zsolve.c, line 78), generic failure 
(GSL::ERROR::EFAILED)
from gsl_bug.rb:7:in `<main>'

Thanks for any help.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]