integrate 'quotient by zero' error message



On 10/30/2011 12:02 PM, Edwin Woollett wrote:
>
> Evidently, all code writers like the phrase "quotient by zero" in an
> error message.  Wouldn't "divide by zero" be more appropriate?

Not really much better, but see below..
> Or even "Code fails to accomodate this case".
That's terrible.

> And the message only seems appropriate as a debug message
> for code writers, not an informative message for the general user.
That's probably true.

I think the reason that this occurs is not that the polynomial gcd 
programs have
a bug in them, but in how they are used.  Let us say you have an expression
involving sqrt(x).  For purposes of the rational function package let us 
rename it:

z1 is  now sqrt(x).

Next, say that the integration program in its various manipulations
generates an expression exp(log(x)/2), and that rational function package
renames it as z2.

Let us also say that some expression is developed like   (z1^2-z2^2)/ 
(z1-z2).
The rational function package correctly computes the gcd of numerator 
and denominator,
as z1-z2, and divides through by it.

Unfortunately, a closer look at that suggests that z1-z2  (or maybe 
z1+z2) s equal to zero.

Now different versions of the polynomial gcd program are in some cases 
more aware of
the possibilities of algebraic dependencies of the "variables" it makes 
up, like z1, z2, ... and
so may avoid some of these situations.

in this particular example, there is a z83125 representing  
%e^(%i*%e^(log(x)/2)) generated
as well as a z83126 representing %e^(%i*%e^(log(x)).

so we have a situation where z1=z2^2   or some such thing.  Bad news.
whose bug is it though?  Unlikely to be in rat3b.lisp whose programs 
expects to
deal with canonical rational expressions in algebraically independent 
variables, and
is merely reporting something incorrect that was handed to  ratreduce.


maybe in ratrep or newvar  which attempts to collect algebraically 
independent components, but
sometimes doesn't do a careful enough job.
maybe in integrate, which neglects to simplify exp(log(x)/2) somewhere.


Incidentally, the wording of that message seems peculiar "`quotient' by 
`zero'".   Why not just
"quotient by zero"    or  "An internal program error: quotient by zero 
in rational function; probably
caused by unexpected algebraic dependence of internal variables".

The program that is used to "throw" the errror to the top level is 
errrjf.  My attempt to keep other people
from catching that error somewhere else.  The program name is err+rjf, 
my initials... and has been in there
since 1969 or so.

RJF




RJF




>
> Ted
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima