Bill Allombert on Mon, 16 Sep 2024 19:13:43 +0200


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

Re: A missing (?) function: exponentfp(x)


On Mon, Sep 16, 2024 at 10:06:07AM -0700, Ilya Zakharevich wrote:
> On Sat, Sep 14, 2024 at 12:31:57PM +0200, Loïc Grenié wrote:
> >      In gp you can cheat
> > 
> > ? install(dbllog2,lG);
> > ? install(dbltor,L);
> > ? flog2(x)=dbltor(dbllog2(x));
> > ? my(il2=1/log(2));setrand(1);for(i=1,10^6,log(random(1.)<<4)*il2)
> > cpu time = 3,868 ms, real time = 3,868 ms.
> > ? setrand(1);for(i=1,10^6,flog2(random(1.)<<4))
> > cpu time = 655 ms, real time = 656 ms.
> 
> On my Intel x64 CPU, this gives
> 
>   ***   in function flog2: dbltor(dbllog2(x))
>   ***                      ^------------------
>   ***   attempt to change built-in dbltor.
> 
> Do not know whether it is related to the ABI problems Bill wrote
> about…

This is unrelated.  You probably did the install() after having defined
flog2(), so they were not taken into account by the bytecode compiler 
when compiling flog2

Cheers,
Bill.