Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong result of content_ #185

Closed
tueda opened this issue May 13, 2017 · 2 comments
Closed

Wrong result of content_ #185

tueda opened this issue May 13, 2017 · 2 comments

Comments

@tueda
Copy link
Collaborator

tueda commented May 13, 2017

As far as I understand, content_ gives an overall factor of an expression such that if the original expression is divided by it then all terms in the quotient have integer coefficients and are without negative powers of symbols. For example,

* This is OK.
S x,y;
#$p = (x/3+2/y)^2;
#$c = content_($p);
#$q = $p/$c;
#message (`$p')/(`$c') = `$q'
.end

gives

~~~(4*y^-2+4/3*x*y^-1+1/9*x^2)/(1/9*y^-2) = 36+12*x*y+x^2*y^2

But it doesn't work when the input has a constant term, like

* This is BAD.
S x;
#$p = 1+1/x;
#$c = content_($p);
#$q = $p/$c;
#message (`$p')/(`$c') = `$q'
.end
~~~(1+x^-1)/(1) = 1+x^-1

In this case the content should be 1/x.

@tueda
Copy link
Collaborator Author

tueda commented Jun 22, 2017

A workaround:

FORM 4.1 (Jun 14 2017, v4.1-20131025-356-g541f847) 64-bits  Run: Thu Jun 22 12:41:42 2017
    S x,xxx;
    #$p = 1+1/x;
    #$tmp = $p*xxx;
    #$c = content_($tmp)/xxx;
    #$q = $p/$c;
    #message (`$p')/(`$c') = `$q'
~~~(1+x^-1)/(x^-1) = 1+x
    .end

@tueda
Copy link
Collaborator Author

tueda commented Mar 13, 2018

Fixed by 68d5cb1.

@tueda tueda closed this as completed Mar 13, 2018
tueda added a commit that referenced this issue Mar 13, 2018
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

No branches or pull requests

1 participant