axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] severe (!) bug in normalize


From: Martin Rubey
Subject: Re: [Axiom-developer] severe (!) bug in normalize
Date: 05 Dec 2006 22:59:30 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Dear Francois,

Francois Maltey <address@hidden> writes:

> I'm testing some patchs in expr.spad.
> On my today-version I get : 
> 
> (64) -> T := t^(n^2)*sqrt(1+t)^n
>            2
>           n   +-----+n
>    (64)  t   \|t + 1
>                                                      Type: Expression Integer
> (65) -> T/subst (T, n=n-1)
>           2n - 1 +-----+
>    (65)  t      \|t + 1
>                                                      Type: Expression Integer
> (68) -> normalize (T/eval (T, n=n-1))
>           +-----+  (2n - 1)log(t)
>    (68)  \|t + 1 %e
>                                                      Type: Expression Integer

Although this is very nice (I tried it!), it only steps around the bug in
rischNormalize, since the latter is not called with the same arguments: your
patches make axiom simplify T/eval(T, n=n-1) right away. Although this is a
very good thing, I suspect that the bug in rischNormalize will surface under
other circumstances, too.

I will comment on your patches in a separate email tomorrow, but I'd like to
express my joy about your work on EXPR and friends. I do have some - hopefully
constructive - critisism, though.

Meanwhile I did a bit of tracing. It seems likely that the bug occurs in
expeval, possibly in goodCoef. Here is the relevant bit of the trace:

  1<enter ElementaryFunctionStructurePackage.expeval,119 : 
                            +-----+
           n log(t)  n log(\|t + 1 )
         %e        %e
   arg1= ---------------------------
                          +-----+
              (n - 1)log(\|t + 1 )
            %e
                                                                 +-----+
                  +-----+   n log(t)      +-----+    (n - 1)log(\|t + 1 )
   arg2= [log(t),\|t + 1 ,%e        ,log(\|t + 1 ),%e                    ]
                  +-----+
           n log(\|t + 1 )
   arg3= %e
   arg4= [0,0,1,1]
   1<enter ElementaryFunctionStructurePackage.goodCoef,142 : 
    arg1= [0,0,1,1]
                                                                  +-----+
                   +-----+   n log(t)      +-----+    (n - 1)log(\|t + 1 )
    arg2= [log(t),\|t + 1 ,%e        ,log(\|t + 1 ),%e                    ]
    arg3= exp
   1>exit  ElementaryFunctionStructurePackage.goodCoef,142 : 
                     n log(t)
    [index= 3,ker= %e        ]
  1>exit  ElementaryFunctionStructurePackage.expeval,119 : 
                       +-----+  2
                n log(\|t + 1 )
             (%e               )              n log(t)
   [func= -------------------------, kers= [%e        ],
                         +-----+  2
             (n - 1)log(\|t + 1 )
          (%e                    )
                       +-----+
                n log(\|t + 1 )
              %e
    vals= [----------------------]]
                         +-----+
             (n - 1)log(\|t + 1 )
           %e


Note that the expeval replaces the elements of "kers" with the elements of
"vals", but here, these are clearly not equivalent: kers contains t^n, vals
however sqrt(t+1).

Maybe this is simply an index mismatch: The length of the fourth argument to
expeval and goodCoef is four, but I have the feeling that it is meant to refer
to the elements of the second argument which are of the form exp... or log...,
and thus sqrt(t+1) should not be counted. In other words, maybe goodCoef should
rather return [index= 4, ker= log(sqrt(t+1))] or so.


Any ideas?

This really calls for unit testing!!!

Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]