Karim Belabas on Mon, 22 Oct 2012 22:31:44 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: exp is faster the second time round


* Dirk Laurie [2012-10-22 22:19]:
> With \p 1000000, it takes about a minute to compute exp
> on my laptop.  Immediate afterwards, it takes about 30 seconds.
> 
> Obviously some constants are being memoized.  Which
> constants are these?

log(2)     

Since exp(x - k log(2)) = x / 2^k, argument reduction allows us to
assume that |x| <= log(2)/2

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`