Ilya Zakharevich on Mon, 16 Sep 2024 19:06:11 +0200


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

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


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…

Thanks,
Ilya