just read on primitive polys in the book... that wording tho.
a poly [t1*x] t2
in t2, with lc==t1*x
followed so far, although skipped the splitting part since it is not relevant to the case
so basically, integrate_primitive_polynomial(x*t1*t2, [D[x]=1, D[t1]=-2x*t1, D[t2]=t1])?
Aaron Meurer
@asmeurer
something like that
hacklex
@hacklex
ok trying to trace what happens to that input...
I mean, in my mind
what p.expr.has(DE.t) is?
Aaron Meurer
@asmeurer
DE.t will be t1
unless it's in the decrement level block, then it will be t0
hacklex
@hacklex
t is t2 here?
so DE.t is t1, makes sense
Aaron Meurer
@asmeurer
oh yeah, I started from 0
hacklex
@hacklex
what does p.expr.has() mean?
Aaron Meurer
@asmeurer
In that while loop, p and q gain a degree with each iteration
expr.has(x) checks if x appears in expr
hacklex
@hacklex
as coefficient?
or as summand?
Aaron Meurer
@asmeurer
In that while loop, p and q gain a degree with each iteration
normally they should not do that
hacklex
@hacklex
p is a poly in [supposedly?] t2?
Aaron Meurer
@asmeurer
anywhere in the expression
not p.has(DE.t) checks if p is a constant polynomial wrt t
hacklex
@hacklex
oh
so it checks the poly variable, not poly coefficient
this naming somehow confuses me, sorry
p is a poly in t, and we ask if p has t anywhere? well yes, without t it would be a const
a const poly in t, ofc
so it considers such a poly already-reduced to a poly in lower tower
and returns said poly as a "t-free remainder"
to be dealt later when you get to deal with the lower-level tower
wait, do I at least have the order right in my mind?
Aaron Meurer
@asmeurer
I think you have it right
hacklex
@hacklex
so that first we deal with polys in t2, compute and get back to towers in t1, and finally x
so we go from the deepest level back to x
I see, the recursion, that chops away t-free pieces
so basically, it endlessly chops pieces off x*t1*t2?
from what you said so far, I'm afraid I can't deduce whether it was the deepest level of recursion or not
but if we continue tracing as if it was the case,
what is frac_in?
Aaron Meurer
@asmeurer
I think it is stuck at the top level
it converts something into a fraction
it's a helper function from what I mentioned above where sympy doesn't support rational functions directly
hacklex
@hacklex
can we extract the parameters it got stuck with?
I mean, what did p look like
at the top level
hacklex
@hacklex
Anyway I perceive that is a rather late hour now (3AM for me) -- thank you for your time! I'm only curious, so there is no rush, I'm just slowly studying math as a hobby.
hope you'll find another few minutes for me later, as comments from a living person who actually implemented this stuff helps me more than anything else
Thanks and have a good day, night or whatever it is now in your timezone :)
Aaron Meurer
@asmeurer
I would suggest running the code yourself, and either add print statements or step through it in a debugger