add logic for pure quadratics

This commit is contained in:
hugogogo
2026-05-14 23:11:37 +02:00
parent 840f5bcfdf
commit 6c6accc289
7 changed files with 301 additions and 51 deletions

View File

@@ -324,3 +324,50 @@ Polynomial degree: 2
Discriminant is strictly negative, the two complex solutions are:
4.89898i/6
-4.89898i/6"
run_test \
"26. degree 2 pure" \
"3 * x^2 + 5 * x^1 - 2 * x^0 = 5 * x" "\
Reduced form: -2 * x^0 + 0 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
√(2/3)
-√(2/3)"
run_test \
"27. degree 2 pure" \
"9 * x^2 + 5 * x^1 - 2 * x^0 = 5 * x" "\
Reduced form: -2 * x^0 + 0 * x^1 + 9 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
(√2)/3
-(√2)/3"
run_test \
"28. degree 2 pure" \
"3 * x^2 + 5 * x^1 - 4 * x^0 = 5 * x" "\
Reduced form: -4 * x^0 + 0 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
2/√(3)
-2/√(3)"
run_test \
"29. degree 2 pure" \
"16 * x^2 + 5 * x^1 - 4 * x^0 = 5 * x" "\
Reduced form: -4 * x^0 + 0 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
1/2
-1/2"
run_test \
"30. degree 2 pure" \
"4 * x^2 + 5 * x^1 - 16 * x^0 = 5 * x" "\
Reduced form: -4 * x^0 + 0 * x^1 + 3 * x^2 = 0
Polynomial degree: 2
Discriminant is strictly positive, the two solutions are:
2
-2"