A solution has its k-th coordinate zero when the abs function evaluates to a number less than or equal to the given tolerance.
i1 : R = CC[x,y]; |
i2 : f = { x^3*y^5 + y^2 + x^2*y, x*y + x^2 - 1};
|
i3 : fSols = solveSystem(f); using temporary files /var/folders/40/dy88l5qd361391m_3v2m51bm0000gn/T/M2-44625-0/0PHCinput and /var/folders/40/dy88l5qd361391m_3v2m51bm0000gn/T/M2-44625-0/0PHCoutput |
i4 : fSols/print
{-1, 0}
{1, 0}
{.742585+.425943*ii, .270685-1.00715*ii}
{-.764107, -.544612}
{.742585-.425943*ii, .270685+1.00715*ii}
{-.894935+.624334*ii, .143333-1.14868*ii}
{-1.59272, .964857}
{-.894935-.624334*ii, .143333+1.14868*ii}
{1.33076+.335184*ii, -.62414-.513163*ii}
{1.33076-.335184*ii, -.62414+.513163*ii}
o4 = {, , , , , , , , , }
o4 : List
|
There is one solution with zero second coordinate:
i5 : zeroSols = zeroFilter(fSols,1,1.0e-10); |
i6 : zeroSols / print
{-1, 0}
{1, 0}
o6 = {, }
o6 : List
|
Here is another system where we filter solutions with ‘small’ first coordinate:
i7 : f = {x^2+y^2,y*x+x};
|
i8 : fSols = solveSystem(f); using temporary files /var/folders/40/dy88l5qd361391m_3v2m51bm0000gn/T/M2-44625-0/1PHCinput and /var/folders/40/dy88l5qd361391m_3v2m51bm0000gn/T/M2-44625-0/1PHCoutput |
i9 : fSols/print
(-3.08149e-33+7.70372e-33*ii, 1.69517e-33-1.2398e-32*ii)
{ii, -1}
{-ii, -1}
o9 = {, , }
o9 : List
|
i10 : zeroSols = zeroFilter(fSols,0,1.0e-10); |
i11 : zeroSols/print
(-3.08149e-33+7.70372e-33*ii, 1.69517e-33-1.2398e-32*ii)
o11 = {}
o11 : List
|