Philippe Elbaz-Vincent on Mon, 24 Feb 2003 18:51:58 +0000 (WET)


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

Re: Fast substitutions in Pari


On Mon, 24 Feb 2003, Franck MICHEL wrote:

> \ps 16;
> u=sum(i=1,15,(-1)^i*i^2*x^i);
> a = 3741/2996+34323/2630*I;
> b =
> 2771/3873+1653/2366*I;
> c = 1264/1653+1883/2922*I;
> d =
> -2159/2174+91/776*I;
> phi=a*t*(1-t*b)*I/(1-t)/(1-c*t)/(1-d*t);
> subst(u,x,tayl
> or(phi,t));
> taylor(subst(u,x,phi),t);
>
> On my PC, subst(u,x,taylor(phi,t)) is done in 1502ms, and
> taylor(subst(u,x,phi),t) is done in 552ms.

But what version of PARI do you use ? (2.1.x I guess, could you confirm)

with 2.2.5 (development CHANGES-1.646)
I got (on a P4 3Ghz and no load!)

taylor(subst(u,x,phi),t);
time = 1,370 ms.
subst(u,x,taylor(phi,t));
time = 560 ms.

nevertheless there seems to be something "weird" here.
With 2.1.3 on a P2/450Mhz

I got
(18:49) gp > taylor(subst(u,x,phi),t);
time = 880 ms.
(18:49) gp > subst(u,x,taylor(phi,t));
time = 2,140 ms.

Any explanations ?

Cheers, Ph.