View Single Post
Old 2020-05-20, 22:37   #3
mathwiz
 
Mar 2019

2·3·11 Posts
Default

Quote:
Originally Posted by Prime95 View Post
I believe the bug is in Fgw.c

The lines:
Code:
  mpz_init2 (gw_x, (gw_n+1)*gw_log_2(gw_b)+64);
  mpz_init2 (gw_z, (gw_n+1)*gw_log_2(gw_b)+64);
are not allocating enough space.

This is an overkill solution:

Code:
  mpz_init2 (gw_x, (gw_n+1)*(gw_log_2(gw_b)+1)+64);
  mpz_init2 (gw_z, (gw_n+1)*(gw_log_2(gw_b)+1)+64);
A proper solution would use floats to calculate gw_log_2
Wow! Amazing how quickly you tracked that down. Thanks for your help.

The fix does seem to be working locally. I don't know if the GMP-ECM developers monitor this forum; perhaps they should be made aware of the proposed fix?
mathwiz is offline   Reply With Quote