On 10/14/07, Jonathan Bober <[EMAIL PROTECTED]> wrote: > On Sun, 2007-10-14 at 15:13 -0700, William Stein wrote: > > On 10/14/07, Jonathan Bober <[EMAIL PROTECTED]> wrote: > > > > > > I'm not sure right now, but I'm thinking about it. > > > > OK, your new code on x86_64 gets essentially every single > > number_of_partitions(n) wrong for 242 <= n <= 2833, and > > seems right for everything else. > > > > I think that the fix (for x86_64) should be to add the following code > around line 462, right at the beginning of the function > compute_current_precision(). > > // n = the number for which we are computing p(n) > // N = the number of terms that have been computed so far > > // if N is 0, then we can't use the above formula (because we would be > // dividing by 0). > if(N == 0) return compute_initial_precision(n) + extra; > > It is actually odd that I am getting the correct answer on my (x86_32) > laptop.
This completely fixes things on x86_64. It does not fix things on ppc. However, your suggestion to set long_double_precision = double_precision *does* work. So we may be all set now. Thanks! > This might also affect powerpc, but should only matter for small input. > For large input, disabling long doubles might help, but I'm not sure. > (The previous version of this code used long doubles as well, but the > original version did not.) > > Also, for small input this algorithm might not be the best option (and > my code certainly is not optimized for small input), so it might > actually be better to use Pari if the sage --> pari --> sage conversion > is fast enough. > > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---