These are chat archives for symengine/symengine

24th
Dec 2015
Shivam Vats
@shivamvats
Dec 24 2015 08:23

@certik About Series behaving like a number and expanding anything operated with it:
How do we deal with symbolic rings? For example if we allow symbolic coeffs, sin(x) + cos(x).series(x, 10) is a perfectly valid series even if sin(x) is left unexpanded.

So effectively, choosing to expand sin(x) implicitly would mean the answer will not be symbolic.

Isuru Fernando
@isuruf
Dec 24 2015 10:01
@shivamvats, can you send a reference to what series_inversion is doing in rs_series?
Shivam Vats
@shivamvats
Dec 24 2015 11:39
@isuruf It is basically doing Newton Iterations. Let y be the approximate expansion of 1/p(x). Then I define f(x) as y - 1/p(x). Using Newton iteration formula gives me x_j+1 = x_j + x_j*(1 - y*x_j).
Isuru Fernando
@isuruf
Dec 24 2015 11:39
Ah, got it. Thanks
Shivam Vats
@shivamvats
Dec 24 2015 11:40
For reference, you can see Modern Computer Arithmetic by Paul Zimmerman
Great!
Isuru Fernando
@isuruf
Dec 24 2015 16:37
@certik, I've added the logic to handle constant terms. i.e. sin(1+x) etc.
To test this, I need a polynomial of Expressions. Were there any plans to do one? If not, I can make a simple class that can do basic stuff.
Ondřej Čertík
@certik
Dec 24 2015 16:52
@isuruf that was the original intention by @bluescarni . But if the Expression is a coefficient, then perhaps we can just use our own data structures, since the overhead will be larger that Piranha's optimizations won't show much of a difference. We should try it though.
I.e. as one of the subclasses/template that I want to try with your design is just a dense list of RCP<Basic>.
Ondřej Čertík
@certik
Dec 24 2015 17:03
@isuruf does your design allow for specialized series that doesn't need a general Expression? Many times you can do that, but sometimes you can't.
Isuru Fernando
@isuruf
Dec 24 2015 17:54

@certik, what do you mean by

a specialized series that doesn't need a general Expression

Francesco Biscani
@bluescarni
Dec 24 2015 22:34
I did some experiments with Expression as a coefficient type for piranha::polynomial, but as @certik says the performance was bottlenecked by the expression arithmetic
Francesco Biscani
@bluescarni
Dec 24 2015 22:44
but it's all relative of course, I was comparing with integer coefficients :) Might as well be that there are some nice speedups to reap