/**/ use QQ[x,y,z];
/**/ L := [x^3-y^2+z-1, x-2, (y-3)*(y+2)];
/**/ RationalSolve(L);
[[2, -2, -3], [2, 3, 2]]
/**/ ApproxSolve(L);
[[2, -2, -3], [2, 3, 2]]
/**/ L := [x^3-y^2+z-1, x^2-2, (y-3)*(y+2)];
/**/ Pts := ApproxSolve(L);
--> use FloatStr or DecimalStr to make result more readable
/**/ indent([[ FloatStr(coord) | coord in pt] | pt in Pts]);
[
["1.4142", "-2.0000", "2.1716"],
["-1.4142", "-2.0000", "7.8284"],
["1.4142", "3.0000", "7.1716"],
["-1.4142", "3.0000", "12.828"]
]
-- Verify we have an approximate answer:
/**/ indent([ [ FloatStr(eval(f, pt)) | f in L ] | pt in Pts]);
[
["-3.2567*10^(-76)", "-6.2932*10^(-77)", "2.3668*10^(-76)"],
["-1.3971*10^(-77)", "8.1808*10^(-78)", "2.5541*10^(-77)"],
["-3.7110*10^(-77)", "8.1808*10^(-78)", "2.5541*10^(-77)"],
["7.7208*10^(-77)", "3.2902*10^(-77)", "-1.2374*10^(-76)"]
]
|