Ciao Niels, ciao Paul!

Il Lun, 17 Dicembre 2012 9:07 pm, Niels Möller ha scritto:
> Zimmermann Paul <paul.zimmerm...@loria.fr> writes:
>> frite% gcc -I$GMP/include -O2 -g e.c $GMP/lib/libgmp.a
>> frite% ./a.out
>> GMP: header 5.0.5, library 5.0.5
>> mpz_jacobi:       408ms

>> frite% gcc -I/tmp/include -O2 -g e.c /tmp/lib/libgmp.a
>> frite% ./a.out
>> GMP: header 5.1.0, library 5.1.0
>> mpz_jacobi:       536ms

>> Apparently we have a noticeable regression...

> I don't have the time to investigate carefully right now, but some
> comments:

I tested some changes and I suggest the attached patch: unconditionally
reduce modulo b.

Niels, can you check if it makes sense?
Paul, can you measure if it reduce the regression?

Best regards,
m

-- 
http://bodrato.it/papers/
diff -r 4b14ab8c899a mpz/jacobi.c
--- a/mpz/jacobi.c	Mon Dec 17 21:31:54 2012 +0100
+++ b/mpz/jacobi.c	Thu Dec 20 09:19:49 2012 +0100
@@ -155,8 +155,7 @@
       if (blow == 1)
 	return JACOBI_BIT1_TO_PN (result_bit1);
 
-      if (asize > 1)
-	JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, alow, asrcp, asize, blow);
+      JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, alow, asrcp, asize, blow);
 
       return mpn_jacobi_base (alow, blow, result_bit1);
     }
_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
http://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to