The same behavior mentioned in the question posted 10 years ago is also reproduce with the following code:
(%i4) f:(2xy)/ (x^2+y^2)$
f1:diff(f,x,1)$
f1:ratsimp(f1)$
at(f1, [x=0,y=0]);
(%o4) 0
Here is my build_info()
build_info(version="5.46.0",timestamp="2022-04-13 23:24:03",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.2.2",maxima_userdir="C:/Users/Usuario/maxima",maxima_tempdir="C:/Users/Usuario/AppData/Local/Temp",maxima_objdir="C:/Users/Usuario/maxima/binary/5_46_0/sbcl/2_2_2",maxima_frontend="wxMaxima",maxima_frontend_version="22.04.0_MSW")
In Maxima, to multiply x and y, you need to write
x*y. But I see that's what you're writing in the attachment.The answer about
atis more subtle.In principle, to handle
aton more than one variable, you need a multivariate limit, which is not necessarily the same as nested univariate limits. For example,limit(x/y)as x->0 and y->0 should beUND, butlimit(limit(x*y,x,0),y,0)andlimit(limit(x*y,y,0),x,0)are not equivalent to that.Unfortunately, Maxima does not have multidimensional limits.
You might think that
taylor(f1,[x,y],0,1)would give a more helpful answer, but alas it does not.Documentation for
atsays that multiple substitutions are applied in parallel, and I see thatpsubstituteis called in the code (src/comm2.lisp). So far, so good.I see that
psubstitute([x=0,y=0], x/y)returns 0 (incorrect) whilepsubstitute([x=0,y=0], y/x)triggers a divide by zero error (correct). So the order of arguments seems to make a difference.Tracing SIMPLIFYA (general expression simplifier), I see that
0*(0^-1)simplifies to 0 (incorrect). Indeed, just entering'(0*(0^-1))at the input prompt yields 0.So at this point it looks to me that the problem is in the simplifier (SIMPTIMES specifically); when it encounters 0 it drops the rest of the expression and returns 0.
I wouldn't be surprised if other variations of this bug have been encountered, although I don't know of any offhand.
Yes,
simptimesdoesn't bother to simplify its other arguments if the first one is 0.This is the very first clause of
simptimes.Looks like https://sourceforge.net/p/maxima/bugs/4011/ describes the same bug.
Add this before
(return res)insimptimesto simplify any remaining factors after encountering a zero factor:Then we get the desired error message.
It doesn't break any tests from the test suite.
I'll ask for opinions on the mailing list.