bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] Failure to converge in gsl_poly_complex_solve


From: Brian Gladman
Subject: [Bug-gsl] Failure to converge in gsl_poly_complex_solve
Date: Sat, 8 Sep 2012 23:49:49 +0100

I believe that a test case for gsl_poly_complex_solve() added fairly recently causes a failure to converge in poly\qr.c that has not yet been fixed.

Increasing the iteration limit in line 104 of qr.c to 120:

    if (iterations == 120)  /* increased from 30 to 60 */

fixes this but the test in poly\test.c then fails because the order of the roots returned does not match that used in the 'expected' array in test.c.

Once I sort the complex numbers in 'expected' and in the returned values by magnitude, the test then passes.

Clearly the expected values can be reordered so that only the returned values have to be sorted and I can supply a revised test.c file in which this has been done.

This file then sorts the returned values using gsl_heapsort() before checking the results.

But it might be better to put the sort into gsl_poly_complex_solve() so that it returns the roots found in magnitude order.

Either way I am happy to provide the files needed to do this.

---------------------------------

There is also a another convergence failure in cdf\test.c for this test:

/* Test case reported by Yan Zhou <address@hidden> */
TEST (gsl_cdf_chisq_Pinv, (0.5, 0.01), 0.99477710813146, TEST_TOL6);

But according to Mathematica the expected value of 0.99477710813146 is wrong - Mathematica gives 7.0166677652355910235 * 10^-61.

So it looks that this test has an error in it.

---------------------------------

   best regards,

      Brian Gladman




reply via email to

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