Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

handle distribution with fractions more smartly #138

@evykassirer

Description

@evykassirer

right now (3 / x^2 + x / (x^2 + 3)) * (x^2 + 3) turns into
(3 / x^2 * x^2 + 9 / x^2 + x / (x^2 + 3) * x^2 + 3x / (x^2 + 3) which isn't super helpful

I think distribution should check to see if one of the groups we're multiplying contains fractions. If one (not both, not none) is, then multiply the non-fraction term into the numerators of the other term.

so here we'd have

(3 / x^2 + x / (x^2 + 3)) * (x^2 + 3) -> (3 *(x^2 + 3)) / x^2 + (x *(x^2 + 3)) / (x^2 + 3)

(this also helps fix an issue in #88)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions