Skip to content

An exact zero test for algebraic numbers, for when downcasting is removed #2164

Description

@Rafael-SOWNet

A constant built from radicals currently reaches 0 by evaluation. It is computed to 100 digits, and downcasting takes any residual under 1e-50 as 0 (measured on #2143). So a check that answers 0 cannot tell an identity from a near miss. For example, take 8y^3 + 4y^2 - 4y - 1 at the Cardano root for cos(2pi/7):

  • as written, it simplifies to 0;
  • with one 7 changed to 7 + 10^(-50), it also simplifies to 0, although its value is 2.48e-52 - 3.26e-52 i.

#1019 removes downcasting in v3. A constant like this one then no longer reaches 0 at all, and two things depend on it reaching 0 today:

Proposal: decide e = 0 exactly for an algebraic e, in two steps:

  1. Compute a polynomial that e is a root of, from the polynomials that define its radicals, as SymPy's minimal_polynomial does.
  2. If 0 is one of that polynomial's roots, decide whether e is that root, using an isolating interval from the interval evaluator (The integrator's sampled-point checks evaluate in intervals, which read no setting #1497).

For sin(pi/7), the steps are the four in the answer on #2143.

References: Algebraic number, Minimal polynomial (field theory).

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

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions