Skip to content

Simplify with assumptions failing using Power#158

Merged
mmatera merged 3 commits intomasterfrom
fix153
Feb 20, 2022
Merged

Simplify with assumptions failing using Power#158
mmatera merged 3 commits intomasterfrom
fix153

Conversation

@mmatera
Copy link
Copy Markdown
Contributor

@mmatera mmatera commented Feb 20, 2022

This PR fixes #153, which was due to a but in the Simplify implementation of the rule Simplify[b_^a_, assumptions_]

@rocky
Copy link
Copy Markdown
Member

rocky commented Feb 20, 2022

This is good, but what I would ask is (and I don't know if this is relevant here) whether this is a workaround for a misfeature of the code or something you might reasonably find in any WL implementation?

I looked in Symja for something like this and don't see anything, but I could have missed something.

If it should be something that we may want to revisit in the future, it would be great if this could be tagged in some way. Even better would be segregated this to a section which makes it easier to review such decisions should things change to make it not necessary.

But, again, I don't know if this is relevant here.

@mmatera
Copy link
Copy Markdown
Contributor Author

mmatera commented Feb 20, 2022

This is good, but what I would ask is (and I don't know if this is relevant here) whether this is a workaround for a misfeature of the code or something you might reasonably find in any WL implementation?

I looked in Symja for something like this and don't see anything, but I could have missed something.

If it should be something that we may want to revisit in the future, it would be great if this could be tagged in some way. Even better would be segregated this to a section which makes it easier to review such decisions should things change to make it not necessary.

But, again, I don't know if this is relevant here.

No, this is just a fix for a bug in the implementation of Simplify, that has some consequences in Integrate. Maybe the rule shouldn't be there, or maybe Symja does not have support for the parameter assumptions.
For example, in Mathics (and WMA)

In[1]:=0^a
Out[1]=0^a

while

In[2]:=Simplify[0^a,a>0]
Out[2]=0

or

In[3]:=$Assumptions={a>0}; Simplify[0^a]
Out[3]=0

What is the output in Symja?

@rocky
Copy link
Copy Markdown
Member

rocky commented Feb 20, 2022

But, again, I don't know if this is relevant here.

No, this is just a fix for a bug in the implementation of Simplify, that has some consequences in Integrate. Maybe the rule shouldn't be there, or maybe Symja does not have support for the parameter assumptions. For example, in Mathics (and WMA)

In[1]:=0^a
Out[1]=0^a

while

In[2]:=Simplify[0^a,a>0]
Out[2]=0

or

In[3]:=$Assumptions={a>0}; Simplify[0^a]
Out[3]=0

What is the output in Symja?

symja-simplify

@mmatera
Copy link
Copy Markdown
Contributor Author

mmatera commented Feb 20, 2022

OK, so in that case, we are doing it better...

@rocky
Copy link
Copy Markdown
Member

rocky commented Feb 20, 2022

Ok - so then let's merge and iterate.

@mmatera mmatera merged commit 8feea93 into master Feb 20, 2022
@rocky rocky deleted the fix153 branch February 20, 2022 14:09
@TiagoCavalcante
Copy link
Copy Markdown
Contributor

@rocky could you open an issue in Symja for this?

@rocky
Copy link
Copy Markdown
Member

rocky commented Feb 21, 2022

I am not the right person for this. I am not really a Symja user.

@axkr
Copy link
Copy Markdown
Collaborator

axkr commented Feb 21, 2022

Changed it in the code base:

@rocky rocky changed the title Fix153 Simplify with assumptions failing using Power Feb 21, 2022
@rocky
Copy link
Copy Markdown
Member

rocky commented Feb 21, 2022

@mmatera @axkr noticed something that is still amiss in our code:

In[1]:= Simplify[0^x, x<0]
Out[1]= Undefined

It should be instead ComplexInfinity, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double integration with f(x,y)=1 fails, while any other constant succeeds

4 participants