From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10648 invoked by alias); 28 Apr 2009 16:31:42 -0000 Received: (qmail 10603 invoked by uid 22791); 28 Apr 2009 16:31:39 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f163.google.com (HELO mail-ew0-f163.google.com) (209.85.219.163) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Apr 2009 16:31:28 +0000 Received: by ewy7 with SMTP id 7so717957ewy.24 for ; Tue, 28 Apr 2009 09:31:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.105.11 with SMTP id d11mr868100ebc.96.1240936284983; Tue, 28 Apr 2009 09:31:24 -0700 (PDT) In-Reply-To: <254EE974-5E07-4EE0-87F2-B2A4FAF11472@cern.ch> References: <254EE974-5E07-4EE0-87F2-B2A4FAF11472@cern.ch> Date: Tue, 28 Apr 2009 16:31:00 -0000 Message-ID: <63c059b10904280931o6600dacg80f040ff32a1ac71@mail.gmail.com> Subject: Re: [Bug-gsl] problem in cubic solver From: "Andrew W. Steiner" To: Lorenzo Moneta , GSL Discuss Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00001.txt.bz2 On the topic of cubics, have you tried translating CERNLIB's rrteq3 into C for root? I have found it to give better results in general than GSL's cubic routine, and thus it might be worth adding a translation of the CERNLIB code to GSL. My attempt at this translation is given at line 517 of http://o2scl.svn.sourceforge.net/viewvc/o2scl/trunk/src/other/poly.cpp?revi= sion=3D35&view=3Dmarkup Take care, Andrew On Tue, Apr 28, 2009 at 11:11 AM, Lorenzo Moneta w= rote: > > Hello, > > =A0I have found a problem with solver for cubic equation (both complex an= d real one) > =A0In some particular case a NaN is returned, as shown in the attached te= xt example. > The problem is observed mainly on 64 bit architectures (for example Linux= 64-bit =A0with gcc 4.3) =A0and not on 32 bit architectures. > > This is due to a problem in a sqrt. A patch is attached fixing the proble= m for the complex routine (gsl_poly_complex_solve_cubic ). > A similar patch can be probably done also for the real routine > > =A0This patch fails the current test for polynomial in gsl, however in my= opinion, this is acceptable, because the test condition is too strict. Wit= h a slight change of the test coefficient, you will have a similar failure = also with the current version. > > =A0Best Regards > > =A0Lorenzo Moneta > =A0ROOT project =A0(http://root.cern.ch ) > =A0CERN > > > > > > > _______________________________________________ > Bug-gsl mailing list > Bug-gsl@gnu.org > http://lists.gnu.org/mailman/listinfo/bug-gsl >