[Gmp-commit] /home/hgfiles/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Wed Dec 30 22:48:55 CET 2009


details:   /home/hgfiles/gmp/rev/838a6b45922e
changeset: 13271:838a6b45922e
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Dec 30 22:47:10 2009 +0100
description:
Increase operands size again.

details:   /home/hgfiles/gmp/rev/2bb813ced168
changeset: 13272:2bb813ced168
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Dec 30 22:48:49 2009 +0100
description:
Get cleverer condition right.

diffstat:

 ChangeLog             |  2 ++
 mpn/generic/tdiv_qr.c |  8 ++++----
 tests/mpz/t-tdiv.c    |  2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 2b2ecb23f32a -r 2bb813ced168 ChangeLog
--- a/ChangeLog	Wed Dec 30 19:21:47 2009 +0100
+++ b/ChangeLog	Wed Dec 30 22:48:49 2009 +0100
@@ -1,5 +1,7 @@
 2009-12-30  Torbjorn Granlund  <tege at gmplib.org>
 
+	* tests/mpz/t-tdiv.c: Increase operands size again.
+
 	* mpn/generic/tdiv_qr.c: Attempt to choose between DC and MU cleverer.
 
 	* mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
diff -r 2b2ecb23f32a -r 2bb813ced168 mpn/generic/tdiv_qr.c
--- a/mpn/generic/tdiv_qr.c	Wed Dec 30 19:21:47 2009 +0100
+++ b/mpn/generic/tdiv_qr.c	Wed Dec 30 22:48:49 2009 +0100
@@ -134,10 +134,10 @@
 	    invert_pi1 (dinv, d2p[dn - 1], d2p[dn - 2]);
 	    if (BELOW_THRESHOLD (dn, DC_DIV_QR_THRESHOLD))
 	      mpn_sbpi1_div_qr (qp, n2p, nn, d2p, dn, dinv.inv32);
-	    else if (BELOW_THRESHOLD (dn, MUPI_DIV_QR_THRESHOLD) ||
-		     BELOW_THRESHOLD (nn, MU_DIV_QR_THRESHOLD) ||
-		     (double) MUPI_DIV_QR_THRESHOLD * (nn-dn) +
-		     (double) MU_DIV_QR_THRESHOLD * dn > (double) dn * nn)
+	    else if (BELOW_THRESHOLD (dn, MUPI_DIV_QR_THRESHOLD) ||   /* fast condition */
+		     BELOW_THRESHOLD (nn, 2 * MU_DIV_QR_THRESHOLD) || /* fast condition */
+		     (double) (2 * (MU_DIV_QR_THRESHOLD - MUPI_DIV_QR_THRESHOLD)) * dn /* slow... */
+		     + (double) MUPI_DIV_QR_THRESHOLD * nn > (double) dn * nn) /* ...condition */
 	      mpn_dcpi1_div_qr (qp, n2p, nn, d2p, dn, &dinv);
 	    else
 	      {
diff -r 2b2ecb23f32a -r 2bb813ced168 tests/mpz/t-tdiv.c
--- a/tests/mpz/t-tdiv.c	Wed Dec 30 19:21:47 2009 +0100
+++ b/tests/mpz/t-tdiv.c	Wed Dec 30 22:48:49 2009 +0100
@@ -61,7 +61,7 @@
   for (i = 0; i < reps; i++)
     {
       mpz_urandomb (bs, rands, 32);
-      size_range = mpz_get_ui (bs) % 17 + 2; /* 0..262144 bit operands */
+      size_range = mpz_get_ui (bs) % 18 + 2; /* 0..524288 bit operands */
 
       do
 	{


More information about the gmp-commit mailing list