Bill Allombert on Tue, 06 Jan 2015 15:24:20 +0100


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

Re: Problems in 'make bench' under Cygwin/64 with testing elliptic


On Tue, Jan 06, 2015 at 12:16:55PM +0100, Bill Allombert wrote:
> Both are wrong, the correct result is 66.
> I assume you get the same result with
> ellap(ellinit([0,0,1,-1,0]),10007)
> 
> This is a progress from the state where isprime(131) was wrong.
> 
> The problem is probably in the function "Fp_ellcard_Shanks" in
> src/basemath/FpE.c.

I meant Fl_ellcard_Shanks().

> I will investigate.

I found the bug, the attached patch fixes it (a single line to change).
All tests passes now.
I will include the patch in PARI 2.7.3.

Thanks again for experimenting with cygwin/64!

Cheers,
Bill.
diff --git a/src/basemath/FpE.c b/src/basemath/FpE.c
index 59c6ed2..8d6cb56 100644
--- a/src/basemath/FpE.c
+++ b/src/basemath/FpE.c
@@ -904,7 +904,7 @@ Fl_ellcard_Shanks(ulong c4, ulong c6, ulong p)
   p2p = p1p << 1;
   x = 0; u = c6; KRO = krouu(u, p); KROold = -KRO;
 
-  switch(Flx_nbroots(mkvecsmalln(5,0, c6,c4,0,1), p))
+  switch(Flx_nbroots(mkvecsmalln(5,0L,c6,c4,0L,1L), p))
   {
     case 3:  A = 0; B = 4; break;
     case 1:  A = 0; B = 2; break;