@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.

@shivamvats, can you send a reference to what

`series_inversion`

is doing in `rs_series`

?
@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)`

.
For reference, you can see Modern Computer Arithmetic by Paul Zimmerman

Great!

@certik, I've added the logic to handle constant terms. i.e.

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.

`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.

@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>.

@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.

@certik, what do you mean by

a specialized series that doesn't need a general Expression

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
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