Skip to content

Collapsing 4x^2-4y^2 produces unsimplified 2/2 powers #178

Description

@Happypig375
No description provided.

Activity

  1. added this to the milestone on Aug 10, 2020
  2. removed this from the milestone on Sep 7, 2020
  3. added this to the 1.4 milestone on May 13, 2021
  4. Rafael-SOWNet commented on Aug 5, 2026

    @Rafael-SOWNet
    Member

    Re-measured on master (7f83a82) and this is fixed.

    "4*x^2 - 4*y^2".ToEntity().Factorize()   =>  4 * (x - y) * (x + y)
    "x^2 - y^2".ToEntity().Factorize()       =>  (x - y) * (x + y)
    

    No half powers left anywhere.

    What was wrong. The difference-of-squares rule halved exponents without checking they were even, so it fired again on the linear factors it had just made -- (x - y) became (x^(1/2) - y^(1/2))(x^(1/2) + y^(1/2)) in effect, which is where the 2/2 powers in your title came from -- and nothing simplified the result afterwards. The rule now requires an even exponent, and the factored form is simplified before it is returned.

    Pinned by a test so it stays fixed. Full suite green, 117-problem corpus unchanged.

  5. added theissue type on Sep 22, 2026
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

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions