Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rational.Reduce doesn't always work #114

Open
no4ni opened this issue Jul 10, 2024 · 2 comments
Open

Rational.Reduce doesn't always work #114

no4ni opened this issue Jul 10, 2024 · 2 comments

Comments

@no4ni
Copy link

no4ni commented Jul 10, 2024

Infix.Format(Rational.Reduce(Infix.ParseOrThrow("(q^3*(q*(q + r) - t*(t + w))*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*(-q*r*(q*(q + r) - t*(t + w))*y11 + q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14)))/q^2"))) == "q*(q*(q + r) - t*(t + w))*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*(-q*r*(q*(q + r) - t*(t + w))*y11 + q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14))"

Infix.Format(Rational.Reduce(Infix.ParseOrThrow("(q^2*(q*(q + r) - t*(t + w))*(q*(r*t - q*w)*(q*(t + w) - r*(t + w)) + q*(q^2 - r^2)*(q*(q + r) - t*(t + w)))*(q*w*(q*(q + r) - t*(t + w))*y11 - q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14) - q^2*(q*(q + r) - t*(t + w))*y41))/q^2"))) == "(q*(q + r) - t*(t + w))*(q*(r*t - q*w)*(q*(t + w) - r*(t + w)) + q*(q^2 - r^2)*(q*(q + r) - t*(t + w)))*(q*w*(q*(q + r) - t*(t + w))*y11 - q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14) - q^2*(q*(q + r) - t*(t + w))*y41)"

Infix.Format(Rational.Reduce(Infix.ParseOrThrow("(q^5*(q*(q + r) - t*(t + w))^2*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*y44)/q^2"))) == "q^3*(q*(q + r) - t*(t + w))^2*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*y44"

but sum of these numerators doesn't work:

Infix.Format(Rational.Reduce(Infix.ParseOrThrow("(q^3*(q*(q + r) - t*(t + w))*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*(-q*r*(q*(q + r) - t*(t + w))*y11 + q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14)) + q^2*(q*(q + r) - t*(t + w))*(q*(r*t - q*w)*(q*(t + w) - r*(t + w)) + q*(q^2 - r^2)*(q*(q + r) - t*(t + w)))*(q*w*(q*(q + r) - t*(t + w))*y11 - q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14) - q^2*(q*(q + r) - t*(t + w))*y41) + q^5*(q*(q + r) - t*(t + w))^2*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*y44)/q^2"))) == "(q^3*(q*(q + r) - t*(t + w))*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*(-q*r*(q*(q + r) - t*(t + w))*y11 + q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14)) + q^2*(q*(q + r) - t*(t + w))*(q*(r*t - q*w)*(q*(t + w) - r*(t + w)) + q*(q^2 - r^2)*(q*(q + r) - t*(t + w)))*(q*w*(q*(q + r) - t*(t + w))*y11 - q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14) - q^2*(q*(q + r) - t*(t + w))*y41) + q^5*(q*(q + r) - t*(t + w))^2*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*y44)/q^2"

@no4ni
Copy link
Author

no4ni commented Jul 10, 2024

Rational.Simplify(Infix.ParseOrThrow("q"),Infix.ParseOrThrow("((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*(-q*r*(q*(q + r) - t*(t + w))*y11 + q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14))+((r*t - q*w)*(q*(t + w) - r*(t + w)) + (q^2 - r^2)*(q*(q + r) - t*(t + w)))*(q*w*(q*(q + r) - t*(t + w))*y11 - q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14) - q^2*(q*(q + r) - t*(t + w))*y41)+q^2*(q*(q + r) - t*(t + w))*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*y44")) also gives incorrect result

@no4ni
Copy link
Author

no4ni commented Jul 10, 2024

Rational.Expand(Infix.ParseOrThrow("((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*(-q*r*(q*(q + r) - t*(t + w))*y11 + q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14))+((r*t - q*w)*(q*(t + w) - r*(t + w)) + (q^2 - r^2)*(q*(q + r) - t*(t + w)))*(q*w*(q*(q + r) - t*(t + w))*y11 - q*(q*(t + w) - r*(t + w))*(t*y11 - q*y14) - q^2*(q*(q + r) - t*(t + w))*y41)+q^2*(q*(q + r) - t*(t + w))*((q*t - r*w)*(q*(q + r) - t*(t + w)) + q*(r*t - w)*(q*(q + r) - w*(t + w)))*y44")) also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant