Hi! Working on #10771 (making gcd and lcm work nicer), I got trouble with the multiplication of symbolic expressions. The problem seems to boil down to examples of the following type:
Without the patch sage: x = -sqrt(2)-1/5*I sage: x*x 1/25*(5*sqrt(2) + I)^2 With the patch sage: x = -sqrt(2)-1/5*I sage: x*x 1/25*(-5*sqrt(2) - I)^2 In another multiplication example, the patch even results in a segmentation fault: sage: F(x) = 1/sqrt(2*pi*1^2)*exp(-1/(2*1^2)*(x-0)^2) sage: G(x) = 1/sqrt(2*pi*n(1)^2)*exp(-1/(2*n(1)^2)*(x-n(0))^2) sage: (F-G)**2 /mnt/local/king/SAGE/sage-4.6.2.alpha4/local/bin/sage-sage: Zeile 300: 19386 Speicherzugriffsfehler sage-ipython "$@" -i The first example seems to indicate that my gcd/lcm patch changes a sign when pulling a common factor out of a list of symbolic coefficients. The second example is totally obscure to me. I could trac down the code up to a call to new_Expression_from_GEx. But I have not been able to locate the definition of that function. To symbolists: Please tell me whether (and how) gcd or lcm occur in new_Expression_from_GEx, or at least show me the code! What gcd/lcm would be computed in the two examples above, and what is the expected result? Best regards, Simon -- 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