From woltman at alum.mit.edu Thu May 21 02:02:23 2020
From: woltman at alum.mit.edu (George Woltman)
Date: Wed, 20 May 2020 20:02:23 -0400
Subject: [Ecm-discuss] Bug report
Message-ID:
Bug in FGW.c
See: https://mersenneforum.org/showthread.php?t=25559
-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL:
From Paul.Zimmermann at inria.fr Thu May 21 08:43:00 2020
From: Paul.Zimmermann at inria.fr (Paul Zimmermann)
Date: Thu, 21 May 2020 08:43:00 +0200
Subject: [Ecm-discuss] Bug report
In-Reply-To:
(message from George Woltman on Wed, 20 May 2020 20:02:23 -0400)
References:
Message-ID:
Dear George,
> Bug in FGW.c
>
> See: https://mersenneforum.org/showthread.php?t=25559
thank you for reporting this. In fact the gw_log_2 function was plain wrong.
I have fixed it in revision 3084:
-/* this method doesn't care if v is 32 or 64 bits... */
+/* return ceil(log(v)/log(2)) */
unsigned long gw_log_2(unsigned long v)
{
- unsigned long r = 0; /* r will be lg(v) */
+ unsigned long r = 0;
- while (v >>= 1)
+ while (v > 1)
{
r++;
+ v = (v + 1) / 2;
}
Please could you say in the mersenneforum thread that the problem is fixed
in revision 3084? (I have no mersenneforum account.)
By the way, in INSTALL-ecm we have this note:
Note: Jonathan Crombie reported an error (Segmentation fault) with GWNUM
29.6 with some inputs. George Woltman says the error lies in the giants
half-GCD code. This will be fixed in a later GWNUM release. In the meantime,
a fix is to use a GMP-based modular inversion.
Is this fixed in p95v298b7.source.zip?
Best regards,
Paul
From woltman at alum.mit.edu Thu May 21 11:56:04 2020
From: woltman at alum.mit.edu (George Woltman)
Date: Thu, 21 May 2020 05:56:04 -0400
Subject: [Ecm-discuss] Bug report
In-Reply-To:
References:
Message-ID:
Hi Paul,
Thanks for the quick fix!
The half GCD problem is indeed fixed in p95v298b7.zip
Stay safe,
George
On Thu, May 21, 2020 at 2:43 AM Paul Zimmermann
wrote:
> Dear George,
>
> > Bug in FGW.c
> >
> > See: https://mersenneforum.org/showthread.php?t=25559
>
> thank you for reporting this. In fact the gw_log_2 function was plain
> wrong.
> I have fixed it in revision 3084:
>
> -/* this method doesn't care if v is 32 or 64 bits... */
> +/* return ceil(log(v)/log(2)) */
> unsigned long gw_log_2(unsigned long v)
> {
> - unsigned long r = 0; /* r will be lg(v) */
> + unsigned long r = 0;
>
> - while (v >>= 1)
> + while (v > 1)
> {
> r++;
> + v = (v + 1) / 2;
> }
>
> Please could you say in the mersenneforum thread that the problem is fixed
> in revision 3084? (I have no mersenneforum account.)
>
> By the way, in INSTALL-ecm we have this note:
>
> Note: Jonathan Crombie reported an error (Segmentation fault) with GWNUM
> 29.6 with some inputs. George Woltman says the error lies in the giants
> half-GCD code. This will be fixed in a later GWNUM release. In the
> meantime,
> a fix is to use a GMP-based modular inversion.
>
> Is this fixed in p95v298b7.source.zip?
>
> Best regards,
> Paul
>
-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: