vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.16k stars 138 forks source link

question about div_ #559

Closed jmbrod closed 2 weeks ago

jmbrod commented 2 months ago

Hello,

why does

s x;
l exp = div_(1,x) ;
print;
.end

yield exp = 0; and not exp = x^-1;? (This is what I get, as expected, when I define l exp = 1/x; instead.) If I read the documentation correctly, the arguments of div_ can be any subexpressions. (Maybe I do not understand what subexpressions are?)

Thanks for any help!

tueda commented 2 months ago

This is because $1 = 0 \times x + 1$ in the sense of polynomial division (the quotient is $0$). The reference manual says

div_(x1,x2) is replaced by the quotient of the arguments.

This function replaces the experimental function polydiv_ that existed in version 3.

For reference, the Mathematica counterpart (for univariate polynomials) is PolynomialQuotient[1, x, x], which gives 0.

jmbrod commented 2 months ago

OK, I see, thank you! (I should have read more carefully.)