Bill Allombert on Mon, 30 Jun 2003 15:20:48 +0200


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

Re: ln gamma


On Mon, Jun 30, 2003 at 11:45:35AM +0200, Olivier Ramare wrote:
> Dear all,
> 
>   Among the things I don't grasp:
>    -- lines like
>   "pitemp = mppi(l2); setexpo(pitemp,2); "
>   "p7 = mplog(pitemp); setexpo(pitemp,1);"
>   "setexpo(p7,-1); "
>   What can be this setexpo-way of doing ??

This is a quick way of multiplying a t_REAL by a power of two!
"pitemp = mppi(l2); setexpo(pitemp,2); " => pitemp=2*Pi
"p7 = mplog(pitemp); setexpo(pitemp,1);" => p7=log(2*Pi);pitemp=Pi
"setexpo(p7,-1); "                       => p7=(1/2)*log(2*Pi).

>    -- What about the length in this ?
>   "p5=cgetg(3,t_COMPLEX);"
>   "p5[1]=lgetr(l2); setlg(p5[1],4);"
>   "p5[2]=lgetr(l2); setlg(p5[2],4);"

This is a hackish way to reserve memory in the stack, so that
p5[1] and p5[2] can be enlarged in place latter on.

>    -- who knows who is bernzone ?

berzone is an area in the heap where are cached the Bernoulli numbers,
so that they are computed only once.

Cheers,
Bill.