(Maxima 5.31.2)

Similarly, when trying to solve system of equations given below, the wrong result is given. Instead of (x1,y1) and (x2,y2), the correct solution should be (x1,y2) and (x2,y1):

(%i78) p:1/(1-cos(1));

(%o78) 1/(1-cos(1))

(%i82) solution_1:float(solve([x*y=p,x-y=3],[x,y]));

(%o82) [[x=3.603649840080336,y=-3.603649840080335],[x=-0.60364984008034,y=0.60364984008034]]

But, if we convert p to float **before** solving the system of equations, the result will be correct:

(%i80) solution_2:float(solve([x*y=float(p),x-y=3],[x,y]));

rat: replaced -2.17534264967002 by -8846603/4066763 = -2.17534264967002

(%o80) [[x=-0.60364984008034,y=-3.603649840080335],[x=3.603649840080335,y=0.60364984008034]]

Last edit: Goran Igaly 2014-05-28