Hi,

The patches attached to ticket #12068 (Numerator for symbolic expression 
shouldn't use maxima) were applied to sage-5.0.beta, which I was happy to 
see because I had tried to do something similar (#10268, which can probably 
be closed) to use GiNaC's normal() function for rational expressions 
instead of the corresponding Maxima function. However, my version was 
stalled by a GCD bug (#10284) that was fixed in GiNaC but not in sage. 
Basically, when normal() is called it puts expressions under a common 
denominator and then tries to cancel the greatest common factor, which can 
cause sage to hang. Alas, the same issue arises when the patches on #12068 
are applied:

sage: a = var('a')
sage: b = var('b')
sage: c = var('c')
sage: x = 4*(b^2 + 1)^2*(2*a^4*b*c^2 + a^3*b^2*c^2 - 2*a^4*b + a^3*b^2 - 
a^3*c^2 - a*b^2*c^2 - a^3 - a*b^2 + a*c^2 + 2*b*c^2 + a - 2*b)^2/((c^2 + 
1)^2*((3*a^4 + 2*a^2 + 3)*b^4 + 3*a^4 + 2*(a^4 - 2*a^2 + 1)*b^2 + 2*a^2 + 
3)^2) + 4*(a^2 + 1)^2*(a^2*b^3*c^2 + 2*a*b^4*c^2 - a^2*b^3 - a^2*b*c^2 + 
2*a*b^4 - b^3*c^2 + a^2*b + 2*a*c^2 + b^3 + b*c^2 + 2*a - b)^2/((c^2 + 
1)^2*((3*a^4 + 2*a^2 + 3)*b^4 + 3*a^4 + 2*(a^4 - 2*a^2 + 1)*b^2 + 2*a^2 + 
3)^2) + 4*(a^4*b^3*c^2 - a^3*b^4*c^2 - a^4*b^3 - a^4*b*c^2 - a^3*b^4 - 
2*a^3*b^2*c^2 + 2*a^2*b^3*c^2 + a*b^4*c^2 + a^4*b - 2*a^3*b^2 - a^3*c^2 - 
2*a^2*b^3 - 2*a^2*b*c^2 + a*b^4 + 2*a*b^2*c^2 + b^3*c^2 - a^3 + 2*a^2*b + 
2*a*b^2 + a*c^2 - b^3 - b*c^2 + a + b)^2/((c^2 + 1)^2*((3*a^4 + 2*a^2 + 
3)*b^4 + 3*a^4 + 2*(a^4 - 2*a^2 + 1)*b^2 + 2*a^2 + 3)^2)    

sage: x.simplify_rational() # less than 1 second
8*(a^2*b^4 + (a^2*b^4 + (a^3 - a)*b^3 + (a^4 + 1)*b^2 - (a^3 - a)*b + 
a^2)*c^4 - (a^3 - a)*b^3 + (a^4 + 1)*b^2 + 2*(a^2*b^4 - (a^4 + 1)*b^2 + 
a^2)*c^2 + (a^3 - a)*b + a^2)/((3*a^4 + 2*a^2 + 3)*b^4 + ((3*a^4 + 2*a^2 + 
3)*b^4 + 3*a^4 + 2*(a^4 - 2*a^2 + 1)*b^2 + 2*a^2 + 3)*c^4 + 3*a^4 + 2*(a^4 
- 2*a^2 + 1)*b^2 + 2*((3*a^4 + 2*a^2 + 3)*b^4 + 3*a^4 + 2*(a^4 - 2*a^2 + 
1)*b^2 + 2*a^2 + 3)*c^2 + 2*a^2 + 3)
sage: 
sage: x.normalize() # hang in infinite loop

So, does anyone have any ideas about how to proceed. Using GiNaC's normal() 
is very useful, but it is hard to know in advance when it will hang and 
when it does you have to kill your sage session.

Thanks,
Ben

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to