On Wed, Feb 12, 2014 at 9:20 PM, Zimmermann Paul <paul.zimmerm...@inria.fr> wrote: > Dear Jori, > >> And reason is of course clear, as Fredrik Johansson wrote "If you cache >> Bernoulli numbers, - -". > > in fact there is another reason: the MPFR code computes the Bernoulli numbers > exactly, as integers B(2n)*(2n+1)!, whereas Pari/GP computes a floating-point > approximation. For 1000-bit precision with input pi^2, and the parameters of > Pari/GP, this requires computing Bernoulli numbers of 3800 bits. > > We should compute floating-point approximations of the Bernoulli numbers in > MPFR too, but this will require redoing the error analysis, which is non > trivial.
You could also compute Bernoulli numbers exactly, but use a fast numerical algorithm for this. Arb computes and stores Bernoulli numbers exactly, and evaluating Gamma(x) the first time (which includes the time to generate Bernoulli numbers) is about as fast time as evaluating it repeatedly in Pari (i.e. with Bernoulli numbers cached). Fredrik -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.