#18356: special resultants ``composed_sum`` and ``composed_product``
-------------------------------------+-------------------------------------
Reporter: pernici | Owner:
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-6.7
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/pernici/ticket/18356 | 1fe9b052c8f1e49f9b0480f40dfa1937ef9f8dcf
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by pernici):
I tried some benchmark with some small polynomials in #18420;
I find that `p1._mul_trunc_(p2, prec)`
is slightly faster than `(p1*p2).truncate(prec)`, with polynomials of
degree `prec-1`.
I will look further at #18420, but it is not the way to speed up
`composed_op`,
as the following benchmark shows.
{{{
def test2():
K.<x> = QQ[]
p1 = x^2 - 2
p2 = x^2 - 3
t0 = time()
r = p1.composed_op(p2, operator.mul, algorithm='BFSS')
#r = p1.composed_mul(p2)
t1 = time()
print 'r=', r
print '%.6f' %(t1 - t0)
}}}
Here are the results for the best out of 10 runs:
composed_op 'BFSS':
up to PowerSeriesRing(...) included: 0.000524
newton_sums: 0.001369
hadamard prod: 0.000030
integral: 0.000073
exp: 0.001195
reverse: 0.000002
total: 0.003264
Only the newton sums could use `_mul_trunc_`, although it is not clear to
me how
to do it best; anyway it would make it only slightly faster. But even if
the newton sums
took zero time, this algorithm would be slower than the resultant
algorithm and much
slower than `composed_mul`
`composed_op` 'resultant': 0.000584
`composed_mul`: 0.000026
--
Ticket URL: <http://trac.sagemath.org/ticket/18356#comment:27>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.