Bill Allombert on Sat, 14 Sep 2024 12:49:29 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: A missing (?) function: exponentfp(x)
|
- To: pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: A missing (?) function: exponentfp(x)
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sat, 14 Sep 2024 12:49:25 +0200
- Delivery-date: Sat, 14 Sep 2024 12:49:29 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1726310967; bh=SWSA7NBnba1cOsCknj9RSJCdehM5fgBvHaLGFhAnOvk=; h=Date:From:To:Subject:References:In-Reply-To:From; b=aCXrGJogPE/oYlK79eItQdDfXijCEamxDhg2JxJAL18vub60jcngBopBV9qlCqLgO 1aSpTQP9eyC7wQO/vzomR0fZYQeaM+LLF5Eel+xGgJ4LKuBEn/c6WxrJ+jeuw4XsNH Squ5AN5IZQUSswz5yk4xJylXo7Oshtrgyz6z3QuX+BoUMMiyWqMlmlSksOrcgVks4b Lxj6bnrohDltmznAR8f3gfpLOrXWMWJRET/KUWQuvZ2Hk22v/A0U2b8UE9+LR+IFhO XcQukQj5g3rcI3EYmU7hatKrp5QGsitLZzUfZegJqTppGrJvH8OamEqoQW4HfHWeGq OQGNxwEhS1HhZe+0lD1qGxzt48iMGlcYE/nkpNWjoQ3rRxlI9d/mD4EPf1+K9b6Ehs uC2qJvScxW+3UTQ14qaEsK9DaNdDjEmlbRZhAvk8oxJO/i8KvBdSc5NDnB4C9ueRyW z3v+EBNlZGTtafEMxKVSh3yGuaJ4E5kzj+IaZuCLYHXv6L0N0KiqrxXRh9SgyviLNj GN0h5W80YnzmdnLWVIKQeklLzB+vHW+ONNr5pIRmy4u53yEVXPMp98i9lbGBIpkupr +RkkYi1NLj2hDBa58GH8E3glObNHsHsBCLO0gws0uxKnRuf5fhlecSETDwJEJXUCzZ WyrijaA39cbOYWH0wm+cuKEI=
- In-reply-to: <CAMLkfFQOzvh9+dnqX4yUQeM_wU=HHiqKM3sNTUGC1wW821p6Cg@mail.gmail.com>
- Mail-followup-to: pari-dev@pari.math.u-bordeaux.fr
- References: <ZuVStcuY1kXNpxs6@debian.attlocal.net> <ZuVYiLiVUwtZQKGd@seventeen> <CAMLkfFQOzvh9+dnqX4yUQeM_wU=HHiqKM3sNTUGC1wW821p6Cg@mail.gmail.com>
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));
It is not robust because the calling convention put double in different
registers than long so dbltor would not find its input.
However it can work by luck if the value stay in the floating point registers:
? a=dbllog2(Pi); dbltor(a)
%13 = 0.E-307
? dbltor(dbllog2(Pi))
%14 = 1.6514961294723207175
But then you can as well do:
install(dbllog2,vG);
install(dbltor,"");
flog2(x)=dbllog2(x);dbltor();
flog2(Pi)
%10 = 1.6514961294723207175
Cheers,
Bill.