Comment #3 on issue 2607 by asmeurer: as_numer_denom() is too slow
http://code.google.com/p/sympy/issues/detail?id=2607

Well, my brain started hurting thinking about this, so I asked on stackoverflow: http://stackoverflow.com/questions/6840988/most-efficient-algorithm-to-compute-a-common-denominator-of-fractions.

If that doesn't produce any good answers, I will think about it some more, and if I can't figure anything out, I will implement a more efficient but still not the most efficient method, which basically involves iteratively computing denoms[0]*denoms[1], denoms[0]*denoms[1]*denoms[2], ... and denoms[-1]*denoms[-2], denoms[-1]*denoms[-2]*denoms[-3], ... and using those. This method is simple to implement, and a preliminaty test indicates that it sufficiently speeds up this particular example. But note that it's still not completely as efficient as it could be, as we end up computing some of the "inner" products twice (like denoms[2]*denoms[3] for example, if len(denoms) is big enough).


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to