The example mentioned above [exp(x)/loggamma(1/x)] is typical for the
kind of expansion we do in limits, in this case we need two terms. This
takes about 0.5 seconds currently.

This seems to me can be done with a bivariate series
in x and w, where w = 1/y = 1/log(x)


Maybe this was a bad example. My point is not the log(x) - this should be treated as an independent symbol, yes. My point is can your fast taylor function cooperate with the ordinary series expansion code for things it does not know how to expand?


multivariate series are not yet in lpoly, but I plan to
translate them from rmpoly.

Using rmpoly

import sys
from time import time
from rmpoly import *
from sympy import *

rp, x,w = rgens('x,w',8,sympify)

hx = 4
hw = 3
t0 = time()
p1 = 1 - x/2 + w - x*w*log(2*pi)/2 - x**2*w/12
p1 = p1.pow_trunc(-1,['x','w'],[hx,hw-1]).mul_trunc(w,'w',hw)
p2 = -x.exp('x',hx).mul_trunc(x,'x',hx)
p = p2.mul_trunc(p1,'x',hx)
t1 = time()
print p1
print '%.2f' %(t1-t0)

The output is
  +(-5/12 + 3*log(2*pi)/8)*w^2*x^3 +(-2/3 + log(2*pi)/2)*w^2*x^2 +(-1 +
log(2*pi)/2)*w^2*x +(-1)*w^2 +(1/8)*w*x^3 +(1/4)*w*x^2 +(1/2)*w*x
+(1)*w
  0.01

Is this the result expected? If I have misunderstood the
problem please tell me.

with hw=10 it takes 0.04s

I guess that in lpoly it would be something like
p1 = multi_taylor(-w*(x*exp(x)*(1-x/2+w -x*w*log(2*pi)/2 -x**2*w/
12)**-1, [x,y],[hx,hw])
and that it would be 2x or 3x slower.


Mario


--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to