These are chat archives for symengine/symengine

Jun 2015
Ondřej Čertík
Jun 22 2015 04:03
@Sumith1896 use git bisect to figure out which commit slowed it down. At least post the commit that is fast, and a commit that is slow, so that I can have a look at the difference, but if you want to help, use git bisect, and then just post the first commit that slows it down.
@isuruf thanks for looking into it. Let me have a look at a few libraries myself. I wonder if we should ask on stack overflow for the recommended practice.
Ondřej Čertík
Jun 22 2015 06:13
@isuruf I looked at the Facebook's Folly library, e.g. and is at the same level and the directory structure is identical to how it is installed. I think that's what we should follow. In other words, we should rename src to symengine and keep .h and .cpp in the same directory.
(The Python wrappers should be moved, obviously.)
Sumith Kulal
Jun 22 2015 17:08
@certik Give me a bit of time, I'm currently figuring out the optimizations @bluescarni mentions, I'll give a report on the slow-down soon.
Sumith Kulal
Jun 22 2015 17:18
@bluescarni I have one question
We have to search the bucket on basis of the exponent, that is the first in my_pair
we don't a my_pair prepared, so how do I pass the arguments to _bucket and _find?
Shivam Vats
Jun 22 2015 18:07

@bluescarni I am very sorry for my late reply.
The reason we want to use polynomials is that any truncated series is basically a polynomial (sometimes with fractional and negative powers, though). We are using polys' ring structure because it is sparse and sparse representation along with the use of polynomial structure gives tremendous speed-up. I tried cos(a+b) for example. ring_series does not yet take a constant term so I had to separate them myself.

In [110]: R,x,y= ring('x,y',QQ[sin(a), cos(a)])

In [111]: %timeit cos(a)*rs_cos(x,x,200) - sin(a)*rs_sin(x,x,200)
10 loops, best of 3: 21.5 ms per loop

In [112]: %timeit cos(a+b).series(a,0,200)
1 loops, best of 3: 6.8 s per loop

I am wondering if it is possible to have a generator as the coefficient. The ring I am currently using doesnt seem to allow that.

Thank you for the code. It will be very helpful when I port it to symengine.

Isuru Fernando
Jun 22 2015 18:26
@certik, shall I put python files in symengine/python?