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

Incorrect expansion of expression #1990

Open
justinacolmena opened this issue Jan 30, 2025 · 2 comments
Open

Incorrect expansion of expression #1990

justinacolmena opened this issue Jan 30, 2025 · 2 comments

Comments

@justinacolmena
Copy link

justinacolmena commented Jan 30, 2025

False coefficients are showing up on some terms, and other terms are omitted.

Image

This is the equation that arises when solving for the leading coefficient of the resolvent quadratic equation for a quartic curve, when the resultant quartic equation is determined so as to have two distinct double roots.

The equation AFAICT is reported correctly when input, but the expand(%); step produces a false result.

wxWidgets: 3.2.5
Unicode support: yes
Maxima version: 5.47.0 (x86_64-redhat-linux-gnu)
Maxima compiled using: SBCL 2.3.11-3.fc41

@justinacolmena
Copy link
Author

justinacolmena commented Jan 30, 2025

The unsimplified equation is solved in R, but I noticed that the expanded/simplified expression produced a large residual.

> (2*a*y1_ - 2*a^2*x1 - q3 - 2*q4*x1)^2 - 4*(a^2 - q4)*
+       (y1_^2 + a^2*x1^2 + 2*a*y1 - 2*a*x1*y1_ -
+               q2 - 2*q3*x1 - 3*q4*x1^2) 
[1] -0.003895801
> 
> -8*y1*a^3 + (24*q4*x1^2 + 12*q3*x1 + 4*q2)*a^2 +
+       ((-16*q4*x1 - 4*q3)*y1_ + 8*q4*y1)*a +
+       4*q4*y1_^2 - 8*q4^2*x1^2 - 4*q2*q4 + q3^2
[1] 0.1718608

The correct result

> (- 8*a^3*y1 + 4*a^2*y1_^2 + 12*a^2*q3*x1 + 24*a^2*q4*x1^2 - 4*a^2*y1_^2 + 4*a^2*q2
+       - 4*a*q3*y1_ - 8*a*q4*x1*y1_ + q3^2 + 4*q4*q3*x1 + 4*q4^2*x1^2 + 4*q4*y1_^2
+       + 8*a*q4*y1 - 8*a*q4*x1*y1_ - 4*q4*q2 - 8*q4*q3*x1 - 12*q4^2*x1^2)
[1] -0.003895801
> 

@daute
Copy link
Member

daute commented Jan 31, 2025

This is clearly a Maxima (the backend, which does the mathematics in the background) issue and have nothing to do with wxMaxima (the graphical frontend), and might be reported/discussed there:
https://sourceforge.net/projects/maxima/

But I am not sure,what you want to do? Solve an equation (as you wrote)? Which one? Where do the R-results (e.g. -0.003895801) come from?
Best regards, Wolfgang

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

2 participants