Re: A missing (?) function: exponentfp(x)
Loïc Grenié <[email protected]> Thu, 19 Sep 2024 10:39:51 +0200
| Newsgroups | gmane.comp.mathematics.pari.devel |
|---|---|
| Message-ID | <CAMLkfFRCHnAuri6KMN_hZZxL-j6f2nONFAqwcAHwYLEVvH2x+g@mail.gmail.com> |
On Thu, 19 Sep, 2024, at 10:30, Ilya Zakharevich wrote:
> On Thu, Sep 19, 2024 at 09:39:15AM +0200, Aurel Page wrote:
> > On 19/09/2024 06:30, Ilya Zakharevich wrote:
> > > On Wed, Sep 18, 2024 at 10:38:09AM +0200, Aurel Page wrote:
> > > > ? install("exponentfp","G");
> > > > ? exponentfp(2^30-1)
> > > > %2 = 29.999999998656385002
> > > > ? exponentfp(Pi)
> > > > %3 = 1.6514961294723207175
> > > > ? z = Pi*2^20
> > > > %4 = 3294198.6583305710348142047482656880163
> > > > ? for(i=1,10^6,exponent(z))
> > > > cpu time = 276 ms, real time = 276 ms.
> > > > ? for(i=1,10^6,exponentfp(z))
> > > > cpu time = 312 ms, real time = 312 ms.
>
> Unfortunately, thinking of this more: no go. You cannot pass through
> a double without a correction of large exponents…
>
The proposed patch of Aurel passes only the first word of the mantissa
to log2.
Loïc