Here's the first version of series expansion that does

Main file:

https://github.com/rwst/symengine/blob/expansion3/symengine/expansion.cpp

Benchmark code: https://github.com/rwst/symengine/blob/expansion3/benchmarks/series_expansion_sincos.cpp

`sin(x)*cos(x)`

(and more). Oddly the N=1000 benchmark takes exactly the same time as Pari, so there seems to be some overhead from conversion.Main file:

https://github.com/rwst/symengine/blob/expansion3/symengine/expansion.cpp

Benchmark code: https://github.com/rwst/symengine/blob/expansion3/benchmarks/series_expansion_sincos.cpp

70% of the time is spent by GMP. I guess that's a good value, i.e., not so much overhead from other things.

130,000 actual calls to

`_gmpz_mul`

taking 60% of all time. At first glance there are 250,000 muls of rationals which are however all of form 1/(big integer).
Only 125,000 muls of rationals if you take into account the truncation, right?

@rwst great job! We can compare against your Piranha benchmark, but this time include the time to construct the sin and cos series.

Then ideally there should be zero overhead.

@certik it's 1420ms vs. 980ms. The final conversion to the

`vec_basic`

of coefficients accounts for part of it.