Test tool for the simplifier



Am Donnerstag, den 04.02.2010, 15:11 -0700 schrieb Robert Dodier:
> On Thu, Feb 4, 2010 at 2:35 PM, Dieter Kaiser <drdieterkaiser at web.de> wrote:
> 
> > I have reported work on a tool to generate automatically valid Maxima
> > expression which have a known value and are suitable to test the
> > simplifier more stringent.
> 
> Terrific, that is a great idea. Have you already committed the
> code for this tool? Please do so if you haven't already.

Hello Robert,

there is some work to do to get nice and general working code.
Furthermore, I am testing different approaches of the main idea to
generate valid expressions with a known value.

One point is, that I try to generate more direct interesting
expressions. Today, I have tested two different starting tables to build
up the more general expressions:

(defvar $table_2
  '((mlist) ((mlist)  0   0)
            ((mlist)  1   1)
            ((mlist)  2   $x2)
            ((mlist)  3   3)
            ((mlist)  4   $x4)))

(defvar $table_3
  '((mlist) ((mlist)  0   0)
            ((mlist)  1   $x1)
            ((mlist)  2   2)
            ((mlist)  3   $x3)
            ((mlist)  4   4)))

The tables above use a mixture of symbols and integers as starting
values. The first introduces symbols for even integers, the second for
odd integers.

I have checked the versions Maxima 5.13, 5.20 and 5.20post with these
starting values. I have generated about 300.000 expressions to get the
following results.

Maxima 5.20post

206 Simplification errors with table_2
  0 Simplification errors with table_3

Most of the simplification errors are due to the wrong simplification of
(1/z)^a -> 1/z^a, which is not in general correct. At this time this
simplification is switched off only for the sqrt function. This is an
example of an automatically generated expression which simplifies
wrongly:

   ((mexpt) 
    ((mquotient) ((mquotient) 1 3) ((mplus) 1 ((mminus) $x4))) 
    ((mquotient) 3 $x2))

   or (1/3/(1-x4))^(3/x2)

With $x4 = 4 and $x2 = 2 this expression has the value -%i/27. Maxima
simplifies wrongly to

   1/(3^(3/x2)*(1-x4)^(3/x2))

and we get the value %i/27, which has the wrong sign.

With radexpand set to false we have 6 remaining simplification errors.
All of these errors are generated by the simplification of
(z^(n/a))^(1/n) -> z^(1/a) which is not in general correct, e.g.
((-1)^3/2)^(1/3) is not equal to (-1)^(1/2).


This can be compared with earlier Maxima versions.

Maxima 5.20

408 Simplification errors with table_2
606 Simplification errors with table_3

Maxima 5.13

423 simplification errors with table_2
606 simplification errors with table_3

Most of the errors of earlier Maxima versions have gone because of the
revision of the simplification for the sqrt function.

Dieter Kaiser