These are chat archives for symengine/symengine

3rd
Jan 2016
Srajan Garg
@srajangarg
Jan 03 2016 15:08
Is there a way to see negative-ness of a Basic? If I call as_numer_denom(x^(-y)) the expected result is num = 1, dem = x^y. This should happen, because the program identified -y as 'negative'. How can this be achieved?
Should I just see if it's a Mul with a negative numer as the coeff, does that cover all the cases?
Abhinav Agarwal
@abhinavagarwal07
Jan 03 2016 16:48
there are properties for many functions like gamma(x)*gamma(1-x) that can simplify the expressions. Can we implement them by adding some virtual add mul etc in functions class?
Akash Trehan
@CodeMaxx
Jan 03 2016 17:05
@rwst can you take a look at #644
Isuru Fernando
@isuruf
Jan 03 2016 18:10
@srajangarg, your approach is correct. Take a look at could_extract_minus.
@abhinavagarwal07, that's not yet supported in SymEngine
@CodeMaxx, since MSVC is not supporting all of the C++11 features that gcc-4.8 does, it's okay for now to keep gcc-4.7, but when MSVC is C++11 feature-complete, then gcc-4.8 should be required
Ondřej Čertík
@certik
Jan 03 2016 20:59
@isuruf I think I figured out how to refactor our core to keep the speed (i.e. just one virtual function call), but use the visitor pattern like class to implement a given algorithm, fully local in a given cpp file. See #738.
See the comments of the PR for details. We should still keep the visitor pattern around, since it's a bit cleaner, but where speed matters, the approach in #738 should provide maximum speed and still be very modular.