These are chat archives for symengine/symengine

24th
Jun 2016
Srajan Garg
@srajangarg
Jun 24 2016 05:05
Do we want `Poly((x+y)**2 + 1, (x + y), domain='ZZ')` in SymEngine
Srajan Garg
@srajangarg
Jun 24 2016 06:15
Doesn't this need simplification, automatically?
``````In [7]: log(E**x)
Out[7]: log(exp(x))``````
Similar
``````In [11]: log(2**x, 2)
Out[11]: log(2**x)/log(2)``````
Ralf Stephan
@rwst
Jun 24 2016 07:36
``````sage: log(exp(x))
log(e^x)
sage: x = var('x', domain='real')
sage: log(exp(x))
x``````
but
``````In [1]: Symbol('x', real=True)
Out[1]: x

In [2]: log(exp(x))
Out[2]:
⎛ x⎞
log⎝ℯ ⎠``````
Hold on
``````In [3]: log(exp(Symbol('x', real=True)))
Out[3]: x``````
so both Sage and Sympy do it if x is real
because I think the complex log has two branches
similar to `sqrt(x**2)`
Srajan Garg
@srajangarg
Jun 24 2016 07:42
I see, thanks. SymEngine does not have support for domains on symbols yet.
Maybe I can do a `is not Complex` check and then simplify?
Ralf Stephan
@rwst
Jun 24 2016 07:43
Yes. @srajangarg a different question, is polynomial `multieval(vector)` the same as substituting a polynomial into a polynomial?
I'm asking because I cannot find a `eval(vector)` in flint C api
and the C++ is practically unreadable
Srajan Garg
@srajangarg
Jun 24 2016 07:47
I'll tell you what I have done in C++. `multieval` in it's simplest form is just calling `eval` n number of times (right now) (better algorithms exist, maybe flint uses them?)
From `vec<integer_class>` I convert to `fmpz_vecxx` which is the c++ version of `fpmz_vec`
Then, flint C++ provides `evaluate(poly, fmpz_vecxx)`, which returns `fmpz_vecxx`
Finally convert `fpmpz_vecxx` back to `vec<intger_class>`
Ralf Stephan
@rwst
Jun 24 2016 07:49
ah you mean `<y0,y1,...yn> = <eval(x0),eval(x1),...eval(xn)>`
Srajan Garg
@srajangarg
Jun 24 2016 07:49
Ys
Ralf Stephan
@rwst
Jun 24 2016 07:49
ok
Srajan Garg
@srajangarg
Jun 24 2016 07:58
@isuruf does it make sense to simplify `log(E**x)`?
Isuru Fernando
@isuruf
Jun 24 2016 08:00
Yes, but only when `x` is a `Number` and a real
Ralf Stephan
@rwst
Jun 24 2016 08:11
you can also have a real assumption on a variable or even expression
Isuru Fernando
@isuruf
Jun 24 2016 08:48
Yes, when assumptions are integrated into SymEngine, we could do that
Srajan Garg
@srajangarg
Jun 24 2016 11:21
@isuruf `master` is failing on my machine, can you check? here are the cmake settings `-DWITH_FLINT=yes -DWITH_PIRANHA=yes`
Isuru Fernando
@isuruf
Jun 24 2016 11:21
what do you mean by failing?
Srajan Garg
@srajangarg
Jun 24 2016 11:21
Doesn't compile, errors in `series_flint.cpp`
Isuru Fernando
@isuruf
Jun 24 2016 11:22
I'm not able to test at the moment. Can you post the error log in a gist?
Srajan Garg
@srajangarg
Jun 24 2016 11:23
Log is here
Looks like the changes from the move to flint C api?
Srajan Garg
@srajangarg
Jun 24 2016 11:32
We definitely need a travis test with `INTEGER_CLASS=GMP -WITH_FLINT=yes -WITH_PIRANHA=yes`
Sumith Kulal
@Sumith1896
Jun 24 2016 12:32
to `.travis.yml`
If that is a test that is failing and the rest are passing, we need it there
Srajan Garg
@srajangarg
Jun 24 2016 12:40
@Sumith1896 @isuruf I can just change the first build `BUILD_TYPE="Debug" WITH_BFD="yes"` to `BUILD_TYPE="Debug" WITH_BFD="yes" WITH_FLINT="yes" WITH_PIRANHA="yes"`. This will cover what the previous build was checking (the defaults), and also check the flint and piranha functionalities
Sumith Kulal
@Sumith1896
Jun 24 2016 12:44
Yes, that works for me
@srajangarg Doesn't this env settings cover what you need
``````Setting environment variables from .travis.yml
\$ export BUILD_TYPE="Debug"
\$ export WITH_BFD="yes"
\$ export WITH_PIRANHA="yes"
\$ export WITH_BENCHMARKS_NONIUS="yes"
\$ export WITH_COVERAGE="yes"
\$ export TEST_IN_TREE="yes"
\$ export WITH_FLINT="yes"
\$ export WITH_MPC="yes"``````
Srajan Garg
@srajangarg
Jun 24 2016 12:48
Which build number is this?
Sumith Kulal
@Sumith1896
Jun 24 2016 12:48
13
Srajan Garg
@srajangarg
Jun 24 2016 12:50
`WITH_FLINT=no` in the build you just linked
Look at the cmake config generated
Srajan Garg
@srajangarg
Jun 24 2016 12:57
That's weird, I'll fix that
Why do you think it's not setting `WITH_FLINT` ?
Sumith Kulal
@Sumith1896
Jun 24 2016 13:00
Just guessing, didn't look into the issue in detail
@srajangarg Could you have a look at the file I linked?
and see if that does it
Srajan Garg
@srajangarg
Jun 24 2016 16:15

yes, that file doesn't have

``````if [[ "\${WITH_FLINT}" != "" ]]; then
cmake_line="\$cmake_line -DWITH_FLINT=\${WITH_FLINT}"
fi``````

I think whoever is going to fix master, should put this in, in the last commit