[sage-devel] Re: Bug with expand



cc'd to the maxima list.

This seems to be a bug in Maxima 5.13, not Sage.
(Maxima 5.16 is the current release, I think, and I don't know
if it is fixed there or not.)

sage: maxima_console()
Maxima 5.13.0 http://maxima.sourceforge.net
Using Lisp CLISP 2.46 (2008-07-02)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1) t1 : (sqrt(3)-3)*(sqrt(3)+1)/6
;
                          (sqrt(3) - 3) (sqrt(3) + 1)
(%o1)                     ---------------------------
                                       6
(%i2) t1 : (sqrt(3)-3)*(sqrt(3)+1)/6;
                          (sqrt(3) - 3) (sqrt(3) + 1)
(%o2)                     ---------------------------
                                       6
(%i3) tt1 : -1/sqrt(3);
                                        1
(%o3)                              - -------
                                     sqrt(3)
(%i4) t2 : sqrt(3)/6;
                                     - 1/2
                                    3
(%o4)                               ------
                                      2
(%i5) expand(t1+t2);
                                       - 1/2
                                    3 3
(%o5)                             - --------
                                      2 2
(%i6) expand(tt1+t2);
                                        1
(%o6)                             - ---------
                                    2 sqrt(3)

++++++++++++++++++++++++++++++++++++++

On Mon, Aug 11, 2008 at 6:06 AM, Francis Colas <colas.francis at gmail.com> wrote:
> On 11 ao?t, 11:58, "William Stein" <wst... at gmail.com> wrote:
>> On Mon, Aug 11, 2008 at 2:42 AM, Francis Colas <colas.fran... at gmail.com> wrote:
>>
>> > Hello,
>>
>> > It seems there is an issue somewhere with the expand function with
>> > square roots and fractions. Here is an excerpt of a notebook (SAGE
>> > Version 3.0, Release Date: 2008-04-21, reproduced on the Sage online
>> > server):
>>
>> > sage: t1 = (sqrt(3)-3)*(sqrt(3)+1)/6
>> > sage: tt1 = -1/sqrt(3)
>> > sage: t2 = sqrt(3)/6
>> > sage: print t1+t2, tt1+t2
>> >                    (sqrt(3) - 3) (sqrt(3) + 1)       1
>> >                    --------------------------- + ---------
>> >                                 6                2 sqrt(3)
>> >                                        1
>> >                                  - ---------
>> >                                    2 sqrt(3)
>> > sage: print expand(t1)
>> > sage: print expand(tt1)
>> > sage: print expand(t2)
>> > sage: print expand(t1+t2), expand(tt1+t2)
>> >                                        1
>> >                                   - -------
>> >                                     sqrt(3)
>>
>> >                                        1
>> >                                   - -------
>> >                                     sqrt(3)
>>
>> >                                       1
>> >                                   ---------
>> >                                   2 sqrt(3)
>>
>> >                                        3
>> >                                  - ---------
>> >                                    4 sqrt(3)
>> >                                        1
>> >                                  - ---------
>> >                                    2 sqrt(3)
>
>> Please explain precisely why you think the expansion of t1 + t2 is wrong.
>
> Because t1+t2 = -1/(2*sqrt(3)) != -3/(4*sqrt(3))
>
> But I may have misunderstood your question.
>
> --~--~---------~--~----~------------~-------~--~----~
> To post to this group, send email to sage-devel at googlegroups.com
> To unsubscribe from this group, send email to sage-devel-unsubscribe at googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-devel
> URLs: http://www.sagemath.org
> -~----------~----~----~----~------~----~------~--~---
>
>