> Hmm, how you measuer this?

You test small cases, I tested large cases:

x : SUP(INT) := reduce(+,[monomial(i, i)$SUP(INT) for i in 1..4000]);
y : SUP(INT) := reduce(+,[monomial(i, i)$SUP(INT) for i in 1..100]);
)time on
pseudoRemainder(x,y);
pseudoDivide(x,y);

Yes, my version of pseudoRemainder is a bit slower, because of
not inlining, degree and leadingCoefficient do a null check.
But I think that's the price to pay, otherwise every function can
replace degree(p) with p.first.k to gain performance.

As for pseudoDivide: NSUP is solwest, my version is from PRS,
it's correct and fastest.

> There is also another issue: if some coefficient mathematically
> should be 0 then it is good to make it zero without calculation.
> This helps if we want to reuse routine for say floating point
> computations.  AFAICS your 'pseudoDivide' does not have this
> property. Version from NSUP uses 'fmecg' which should ensure
> this.

Can you tell more details about it?  I think there are no term with
coefficient 0 stored in the first place.
BTW, use 'fmecg' in pseudoDivide doesn't slow it down.  And
replace "next term" in fmecg with 'break' will be better?

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to