Karim Belabas on Fri, 26 Apr 2013 18:39:41 +0200


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

Re: thue: negative nmax in gboundcf in thue(thueinit(x^3-1493,1),3)


* Georgi Guninski [2013-04-26 13:29]:
> In 2.5.3 on linux:
> 
> ? thue(thueinit(x^3-1493,1),3)
>   ***   at top-level: thue(thueinit(x^3-14
>   ***                 ^--------------------
>   *** thue: negative nmax in gboundcf.
>   ***   Break loop: type 'break' to go back to GP
> 
> thueinint(,0) returns no solutions.  

Fixed in 'master' and 'pari-2.5' branches (patch below)

Thanks for your report !

    K.B.

diff --git a/src/modules/thue.c b/src/modules/thue.c
index 37f98ec..46176c9 100644
--- a/src/modules/thue.c
+++ b/src/modules/thue.c
@@ -479,9 +479,12 @@ GuessQi(GEN b, GEN c, GEN *eps)
 static GEN
 MiddleSols(GEN *pS, GEN bound, GEN roo, GEN poly, GEN rhs, long s, GEN c1)
 {
-  long j, k, nmax, d = degpol(poly);
-  GEN bndcf = sqrtnr(shiftr(c1,1), d - 2);
+  long j, k, nmax, d;
+  GEN bndcf;
 
+  if (expo(bound) < 0) return bound;
+  d = degpol(poly);
+  bndcf = sqrtnr(shiftr(c1,1), d - 2);
   if (cmprr(bound, bndcf) < 0) return bound;
   /* divide by log((1+sqrt(5))/2)
    * 1 + ==> ceil

--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`