approx-alike bug



Barton,

I think you can replace this:

      (or (and (member 'array (car f) :test #'eq)
       (member 'array (car g) :test #'eq))
  (and (not (member 'array (car f) :test #'eq))
       (not (member 'array (car g) :test #'eq))))
with this:

      (eq (not (memq 'array (car f))) ;'not' necessary to convert to boolean
  (not (memq 'array (car g))))

As for checking consp etc. before using mop, just about all of Maxima
assumes that expressions are well-formed.  I suppose in this case, in
checking for equality in the test suite, you can't make that assumption.
 But in that case, you should probably throw an error rather than
*ignore* malformed
expressions... and also check for more kinds of malformation.

Other clauses are questionable, too.  Why do you consider rat(x,x,y) and
rat(x,y,x) approximately alike?  Or taylor(x,x,0,5) and taylor(x,x,0,10)?

But maybe I don't fully understand the purpose of approx-alike....

           -s

On Sun, Dec 2, 2012 at 12:53 PM, Barton Willis <willisb at unk.edu> wrote:

> This function approx-alike has a bug: (The testing code uses approx-alike
> to test for equality.)
>
>   (%i1) ?approx\-alike(a[1],a(1));
>   (%o1) true
>
> I filed a report (https://sourceforge.net/p/maxima/bugs/2511/). Since
> this bug has been with us for years, I don't think
> it's a deal breaker for 5.29. With my proposed fix, the test suite runs OK.
>
> The diff for my proposed fix was automagically formatted as a bullet list
> :(  Apparently,  I need to read the "formatting help"  document :(
> Also, it's necessary to read a bug report to see who submitted
> it--previously, that information was listed in the summary :(  Maybe I'm
> just grumpy :(
>
> --Barton
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>