Skip to content

An equation through abs is answered in decimals, with two non-real entries that are not roots #2139

Open

Description

@Rafael-SOWNet
solve::x::x^2/abs(1-x^2) = x
→ { 0, 0.618…, 1.618…, 1.618… + 1.7E-9i, 1.618… + 9.9E-8i }

The answer is { 0, (sqrt(5) - 1)/2, (sqrt(5) + 1)/2 }, exactly:

  • x^2 = x * abs(1 - x^2) makes x a non-negative real.
  • The two non-real entries are approximations of 1.618… and satisfy nothing.
  • The case split on the sign of 1 - x^2 gives each root exactly: x^2/(1-x^2) = x gives { 0, (-1 ± sqrt(5))/2 }, and x^2/(x^2-1) = x gives the other.

Found while reading Modenov's Problems in Geometry for #2131.

Activity

  1. added this to the 2.8 milestone on Oct 27, 2026
  2. Happypig375 commented on Oct 27, 2026

    @Happypig375
    Member

    While these approximation related quirks are fixable early, remember to simplify these changes away for v3.

  3. Rafael-SOWNet commented on Oct 27, 2026

    @Rafael-SOWNet
    MemberAuthor

    Will do. So that they can be found again, #2169 asks every such fix to link v3's downcasting decision (#1019) in its comment and in its test. A search for that comment then lists everything v3 has to take back out. The fix for this issue will be the first to carry the link.

  4. Rafael-SOWNet commented on Oct 27, 2026

    @Rafael-SOWNet
    MemberAuthor

    #2178 answers this exactly over the reals: with Codomain set to Real, x^2/abs(1-x^2) = x is { 0, (-1 + sqrt(5)) / 2, (1 + sqrt(5)) / 2 }. It also fixes abs(x^2 - 4) = 3x, which had a non-root 4.0000000000000062 + 1.6e-7 i beside { 1, 4 }.

    The complex codomain, the default and what this issue shows, needs a decision. The wrong entries come from Newton's method run in the complex plane, which assumes a holomorphic function, and |1 - x^2| is not one. A case split on the sign does not carry over either. Over the complex numbers |u| = ±u only where u is real, and roots need not make it real: x^2 + 1 = |x| has roots at ±0.618 i, where |x| is 0.618 and x is not ±0.618. So split-and-check finds roots and cannot say it found them all.

    Two ways:

    1. Leave such an equation unsolved in the complex codomain: one where x is inside a non-holomorphic function (abs, sgn, conj, re, im, arg) and also outside it. That is what |x - 2| = |x - 3| already gets (An equation between moduli is answered with points Newton's method finds on a curve #1573), for the same reason. It costs the equations Newton happened to answer right.
    2. Keep Newton's answer and drop the entries that are copies of another root within its tolerance. That removes this issue's two entries, but it is an approximation fix, to be taken out with downcasting in v3 (A fix for an approximation quirk before v3 links the decision that removes it #2169's rule), and it still answers in decimals.

    I recommend 1, since not answering is a legitimate answer and a near-copy of a root is not one. Which do you prefer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions