Changes between Version 38 and Version 46 of Ticket #7660


Ignore:
Timestamp:
04/14/15 19:44:06 (7 years ago)
Author:
chapoton
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7660

    • Property Status changed from needs_work to needs_review
    • Property Branch changed from u/rws/ticket/7660 to public/7660
    • Property Commit changed from 30cc86077172f9e57c6b5df06b40158e17e2320d to 17c4e8ad25114508ca1f722f66b497b594bca595
  • Ticket #7660 – Description

    v38 v46  
    3636{{{
    3737On Thu, 10 Dec 2009 00:37:10 -0800 (PST)
    38         "marik@mendelu.cz" <marik@mendelu.cz> wrote:
    39         
    40         > sage: f = x + 3 < y - 2
    41         > sage: f*(-1)
    42         > -x - 3 < -y + 2
    43         }}}
    44         
    45         It seems MMA doesn't apply any automatic simplification in this case:
    46         
    47         {{{
    48         On Thu, 10 Dec 2009 09:54:36 -0800
    49         William Stein <wstein@gmail.com> wrote:
    50         
    51         > Mathematica does something weird and formal:
    52         
    53         > In[1]:= f := x+3 < y-2;
    54         > In[3]:= f*(-1)
    55         > Out[3]= -(3 + x < -2 + y)
    56         }}}
    57         
    58         Maple acts more intuitively, though the way ``formal products`` are printed leaves something to be desired, IMHO:
    59         
    60         {{{
    61         On Thu, 10 Dec 2009 14:15:53 -0800
    62         William Stein <wstein@gmail.com> wrote:
    63         
    64         > Here is what Maple does:
    65         
    66         > flat:release_notes wstein$ maple
    67         >     |\^/|     Maple 13 (APPLE UNIVERSAL OSX)
    68         > ._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple
    69         > Inc. 2009 \  MAPLE  /  All rights reserved. Maple is a trademark of
    70         >  <____ ____>  Waterloo Maple Inc.
    71         >       |       Type ? for help.
    72         > > f := x < y;   
    73         >                                   f := x < y
    74         
    75         > > f*(-3);   
    76         >                                   -3 y < -3 x
    77         
    78         > > f*z;   
    79         >                                   *(x < y, z)
    80         
    81         > > f*a;   
    82         >                                   *(x < y, a)
    83         }}}
    84         
    85         
    86         We should multiply both sides of the inequality only if the argument is a real number (as opposed to a symbol with real domain), and invert the relation when the argument is negative.
    87         
    88         Note that GiNaC leaves everything formal, like MMA, by default:
    89         
    90         {{{
    91         ginsh - GiNaC Interactive Shell (ginac V1.5.3)
    92           __,  _______  Copyright (C) 1999-2009 Johannes Gutenberg University Mainz,
    93          (__) *       | Germany.  This is free software with ABSOLUTELY NO WARRANTY.
    94           ._) i N a C | You are welcome to redistribute it under certain conditions.
    95         <-------------' For details type `warranty;'.
    96         
    97         Type ?? for a list of help topics.
    98         > f= x < y;
    99         x<y
    100         > f*-1;
    101         -(x<y)
    102         > f*-5;
    103         -5*(x<y)
    104         > f*-z;
    105         -z*(x<y)
    106         > f*z;
    107         z*(x<y)
    108         }}}
     38     "marik@mendelu.cz" <marik@mendelu.cz> wrote:
     39    
     40     > sage: f = x + 3 < y - 2
     41     > sage: f*(-1)
     42     > -x - 3 < -y + 2
     43     }}}
     44    
     45     It seems MMA doesn't apply any automatic simplification in this case:
     46    
     47     {{{
     48     On Thu, 10 Dec 2009 09:54:36 -0800
     49     William Stein <wstein@gmail.com> wrote:
     50    
     51     > Mathematica does something weird and formal:
     52    
     53     > In[1]:= f := x+3 < y-2;
     54     > In[3]:= f*(-1)
     55     > Out[3]= -(3 + x < -2 + y)
     56     }}}
     57    
     58     Maple acts more intuitively, though the way ``formal products`` are printed leaves something to be desired, IMHO:
     59    
     60     {{{
     61     On Thu, 10 Dec 2009 14:15:53 -0800
     62     William Stein <wstein@gmail.com> wrote:
     63    
     64     > Here is what Maple does:
     65    
     66     > flat:release_notes wstein$ maple
     67     >     |\^/|     Maple 13 (APPLE UNIVERSAL OSX)
     68     > ._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple
     69     > Inc. 2009 \  MAPLE  /  All rights reserved. Maple is a trademark of
     70     >  <____ ____>  Waterloo Maple Inc.
     71     >       |       Type ? for help.
     72     > > f := x < y;   
     73     >                                   f := x < y
     74    
     75     > > f*(-3);   
     76     >                                   -3 y < -3 x
     77    
     78     > > f*z;   
     79     >                                   *(x < y, z)
     80    
     81     > > f*a;   
     82     >                                   *(x < y, a)
     83     }}}
     84    
     85    
     86     We should multiply both sides of the inequality only if the argument is a real number (as opposed to a symbol with real domain), and invert the relation when the argument is negative.
     87    
     88     Note that GiNaC leaves everything formal, like MMA, by default:
     89    
     90     {{{
     91     ginsh - GiNaC Interactive Shell (ginac V1.5.3)
     92       __,  _______  Copyright (C) 1999-2009 Johannes Gutenberg University Mainz,
     93     (__) *       | Germany.  This is free software with ABSOLUTELY NO WARRANTY.
     94       ._) i N a C | You are welcome to redistribute it under certain conditions.
     95     <-------------' For details type `warranty;'.
     96    
     97     Type ?? for a list of help topics.
     98     > f= x < y;
     99     x<y
     100     > f*-1;
     101     -(x<y)
     102     > f*-5;
     103     -5*(x<y)
     104     > f*-z;
     105     -z*(x<y)
     106     > f*z;
     107     z*(x<y)
     108     }}}