454 lines
23 KiB
Bash
454 lines
23 KiB
Bash
#!/bin/bash
|
|
|
|
# ----------------------------------------------------------------------
|
|
# COLORS
|
|
# ----------------------------------------------------------------------
|
|
|
|
GRAY="\e[0;30m"
|
|
RED="\e[0;31m"
|
|
GREEN="\e[0;32m"
|
|
YELLOW="\e[0;33m"
|
|
BLUE="\e[0;34m"
|
|
PURPLE="\e[0;35m"
|
|
CYAN="\e[0;36m"
|
|
WHITE="\e[0;37m"
|
|
|
|
B_GRAY="\e[1;30m"
|
|
B_RED="\e[1;31m"
|
|
B_GREEN="\e[1;32m"
|
|
B_YELLOW="\e[1;33m"
|
|
B_BLUE="\e[1;34m"
|
|
B_PURPLE="\e[1;35m"
|
|
B_CYAN="\e[1;36m"
|
|
B_WHITE="\e[1;37m"
|
|
|
|
RESET="\e[0m"
|
|
|
|
# ----------------------------------------------------------------------
|
|
# CONFIGURATION
|
|
# ----------------------------------------------------------------------
|
|
|
|
NAME="computor"
|
|
BINARY="./$NAME"
|
|
|
|
if [[ ! -x "$BINARY" ]]; then
|
|
echo -e >&2 $B_RED"Error:$RESET binary $B_PURPLE'$BINARY'$RESET not found or not executable."
|
|
echo >&2 "Did you compile your C program?"
|
|
exit 1
|
|
fi
|
|
|
|
# flags
|
|
SKIP_REDUCED=false
|
|
SKIP_SOLUTION=false
|
|
RUN_ONLY=false
|
|
FLAGS="" # default empty
|
|
|
|
# Parse command-line arguments
|
|
while [[ "$#" -gt 0 ]]; do
|
|
case $1 in
|
|
--skip-reduced) SKIP_REDUCED=true ;;
|
|
--skip-solution) SKIP_SOLUTION=true ;;
|
|
--run-only) RUN_ONLY=true ;;
|
|
-b) FLAGS="$FLAGS -b" ;; # append -b to FLAGS
|
|
-d) FLAGS="$FLAGS -d" ;; # append -d to FLAGS
|
|
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
# ----------------------------------------------------------------------
|
|
# TEST LOGIC
|
|
# ----------------------------------------------------------------------
|
|
|
|
run_test() {
|
|
local test_name="$1"
|
|
local input="$2"
|
|
local expected="$3"
|
|
local check_error="${4:-no_error}" # Default: false (compare output)
|
|
|
|
# If RUN_ONLY is true, skip all test logic and just run the binary
|
|
if [[ "$RUN_ONLY" == "true" ]]; then
|
|
printf $B_PURPLE"Running: '%s'$RESET\n" "$test_name"
|
|
printf "Input: '%s'\n" "$input"
|
|
printf "Output:\n"
|
|
printf "%s" "$input" | "$BINARY" $FLAGS 2>&1
|
|
printf "\n"
|
|
return
|
|
fi
|
|
|
|
printf $B_PURPLE"Test : '%s'$RESET - " "$test_name"
|
|
|
|
# Run the program and capture the output
|
|
out=$(printf "%s" "$input" | "$BINARY" $FLAGS 2>&1)
|
|
exit_code=$?
|
|
|
|
# If SKIP_REDUCED is true, remove the "Reduced form" line from both output and expected
|
|
if [[ "$SKIP_REDUCED" == "true" ]]; then
|
|
out=$(echo "$out" | grep -v "Reduced form:")
|
|
expected=$(echo "$expected" | grep -v "Reduced form:")
|
|
fi
|
|
|
|
# If SKIP_SOLUTION is true, remove all lines after the 2nd line following "Polynomial degree:"
|
|
if [[ "$SKIP_SOLUTION" == "true" ]]; then
|
|
# Get the line number of "Polynomial degree:"
|
|
line_num=$(echo "$out" | grep -n "Polynomial degree:" | head -1 | cut -d: -f1)
|
|
if [[ -n "$line_num" ]]; then
|
|
# Keep lines up to 1 lines after "Polynomial degree:"
|
|
out=$(echo "$out" | head -n $((line_num + 1)))
|
|
expected=$(echo "$expected" | head -n $((line_num + 1)))
|
|
fi
|
|
fi
|
|
|
|
# If check_error is true, verify if the output contains an error message or non-zero exit code
|
|
if [[ "$check_error" == "error" ]]; then
|
|
if [[ $exit_code -ne 0 || "$out" == *"Error"* ]]; then
|
|
printf $B_GREEN"PASS$RESET (Input: '%s')\n" "$input"
|
|
else
|
|
printf $B_RED"FAIL$RESET\n"
|
|
printf " "$B_WHITE"Input:$RESET '%s'\n" "$input"
|
|
printf " "$B_WHITE"Got:$RESET\n"
|
|
printf '%s\n' "$out" | sed 's/^/ | /'
|
|
printf " "$B_WHITE"Expected:$RESET an error (non-zero exit code or 'Error' in output: $exit_code)\n"
|
|
echo
|
|
fi
|
|
else
|
|
# Compare with expected output
|
|
if [[ "$out" == "$expected" ]]; then
|
|
printf $B_GREEN"PASS$RESET (Input: '%s')\n" "$input"
|
|
else
|
|
printf $B_RED"FAIL$RESET\n"
|
|
printf " "$B_WHITE"Input:$RESET '%s'\n" "$input"
|
|
printf " "$B_WHITE"Got:$RESET\n"
|
|
printf '%s\n' "$out" | sed 's/^/ | /'
|
|
printf " "$B_WHITE"Expected:$RESET\n"
|
|
printf '%s\n' "$expected" | sed 's/^/ | /'
|
|
echo
|
|
fi
|
|
fi
|
|
}
|
|
|
|
# ----------------------------------------------------------------------
|
|
# TESTS CASES
|
|
# ----------------------------------------------------------------------
|
|
|
|
run_test \
|
|
"1. degree 2" \
|
|
"3 * x^2 + 5 * x^1 - 2 * x^0 = 5 * x^1" "\
|
|
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 \
|
|
"2. degree 2" \
|
|
"3.4 * x^2 + 1 * x^1 - 2.0 * x^0 = 5 * x^1" "\
|
|
Reduced form: -2 * x^0 - 4 * x^1 + 3.4 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
1.5548
|
|
-0.378334"
|
|
|
|
run_test \
|
|
"3. degree 2" \
|
|
"3 * x^2 + 2 * x^2 = 5 * x^1" "\
|
|
Reduced form: 0 * x^0 - 5 * x^1 + 5 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
1
|
|
0"
|
|
|
|
run_test \
|
|
"4. flag -e" \
|
|
'-e "3 * x^2 + 2 * x - 7 * x^4 = 1 * x^4"' \
|
|
"" \
|
|
error
|
|
|
|
run_test \
|
|
"5. degree 2" \
|
|
"3*x^2 + 2x = 0" "\
|
|
Reduced form: 0 * x^0 + 2 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
0
|
|
-0.666667"
|
|
|
|
run_test \
|
|
"6. degree 2" \
|
|
"3.4 * x^2 + 1 * x^1 - 2.0 * x^0 = 5.123 * x^1" "\
|
|
Reduced form: -2 * x^0 - 4.123 * x^1 + 3.4 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
1.58401
|
|
-0.371359"
|
|
|
|
run_test \
|
|
"7. float exponent" \
|
|
"3.4 * x^2 + 1 * x^1 - 2.0 * x^0 = 5 * x^1.2" \
|
|
"" \
|
|
error
|
|
|
|
run_test \
|
|
"8. degree 4" \
|
|
"3x^2 + 2x -7x^4 = x^4" "\
|
|
Reduced form: 0 * x^0 + 2 * x^1 + 3 * x^2 + 0 * x^3 - 8 * x^4 = 0
|
|
Polynomial degree: 4
|
|
The polynomial degree is strictly greater than 2, I can't solve."
|
|
|
|
run_test \
|
|
"9. degree 2" \
|
|
"3x² + 2x -7x¹ = x" "\
|
|
Reduced form: 0 * x^0 - 6 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
2
|
|
0"
|
|
|
|
run_test \
|
|
"10. degree 2" \
|
|
"3 * x^2 + 2 * x - 7 * x^1 = x" "\
|
|
Reduced form: 0 * x^0 - 6 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
2
|
|
0"
|
|
|
|
run_test \
|
|
"11. degree 2" \
|
|
"-3x² + 2x -7 = x" "\
|
|
Reduced form: -7 * x^0 + 1 * x^1 - 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly negative, the two complex solutions are:
|
|
0.166667 - 1.51841*i
|
|
0.166667 + 1.51841*i"
|
|
|
|
run_test \
|
|
"12. degree 2" \
|
|
"+3x² + 2x -7 = x" "\
|
|
Reduced form: -7 * x^0 + 1 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
1.36992
|
|
-1.70326"
|
|
|
|
run_test \
|
|
"13. degree 2" \
|
|
"3x² + 0x -7 = x" "\
|
|
Reduced form: -7 * x^0 - 1 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
1.70326
|
|
-1.36992"
|
|
|
|
run_test \
|
|
"14. degree 2" \
|
|
"3x² + 0x -0 = x" "\
|
|
Reduced form: 0 * x^0 - 1 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
0.333333
|
|
0"
|
|
|
|
run_test \
|
|
"15. degree 2" \
|
|
"3x² + 2x -0 = x" "\
|
|
Reduced form: 0 * x^0 + 1 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
0
|
|
-0.333333"
|
|
|
|
run_test \
|
|
"16. degree 1" \
|
|
"3x + 2x -0 = x" "\
|
|
Reduced form: 0 * x^0 + 4 * x^1 = 0
|
|
Polynomial degree: 1
|
|
The solution is:
|
|
0"
|
|
|
|
run_test \
|
|
"17. degree 2" \
|
|
"3x² + x -0 = x" "\
|
|
Reduced form: 0 * x^0 + 0 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is equal to zero, the solution is:
|
|
0"
|
|
|
|
run_test \
|
|
"18. degree 2" \
|
|
"0x² + x -0 = x" "\
|
|
Reduced form: 0 * x^0 = 0
|
|
Any real number is a solution."
|
|
|
|
run_test \
|
|
"19. degree 5" \
|
|
"2x⁵ + x -0 = -7x^5" "\
|
|
Reduced form: 0 * x^0 + 1 * x^1 + 0 * x^2 + 0 * x^3 + 0 * x^4 + 9 * x^5 = 0
|
|
Polynomial degree: 5
|
|
The polynomial degree is strictly greater than 2, I can't solve."
|
|
|
|
run_test \
|
|
"20. degree 1" \
|
|
"2x + x -0 = -7x" "\
|
|
Reduced form: 0 * x^0 + 10 * x^1 = 0
|
|
Polynomial degree: 1
|
|
The solution is:
|
|
0"
|
|
|
|
run_test \
|
|
"21. degree 1" \
|
|
"2x + x -3 = -7x" "\
|
|
Reduced form: -3 * x^0 + 10 * x^1 = 0
|
|
Polynomial degree: 1
|
|
The solution is:
|
|
0.3"
|
|
|
|
run_test \
|
|
"22. degree 1" \
|
|
"-2x + x -3 = -7x" "\
|
|
Reduced form: -3 * x^0 + 6 * x^1 = 0
|
|
Polynomial degree: 1
|
|
The solution is:
|
|
0.5"
|
|
|
|
run_test \
|
|
"23. degree 2 without [=]" \
|
|
"3x^2" \
|
|
"" \
|
|
error
|
|
|
|
run_test \
|
|
"24. degree 2" \
|
|
"3x^2 = 0" "\
|
|
Reduced form: 0 * x^0 + 0 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is equal to zero, the solution is:
|
|
0"
|
|
|
|
run_test \
|
|
"25. degree 2" \
|
|
"3x^2 + 2 = 0" "\
|
|
Reduced form: 2 * x^0 + 0 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly negative, the two complex solutions are:
|
|
i√(2/3)
|
|
-i√(2/3)"
|
|
|
|
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 + 16 * 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: -16 * x^0 + 0 * x^1 + 4 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
2
|
|
-2"
|
|
|
|
run_test \
|
|
"31. degree 2" \
|
|
"3x² + 2x -7 = x" "\
|
|
Reduced form: -7 * x^0 + 1 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
1.36992
|
|
-1.70326"
|
|
|
|
run_test \
|
|
"32. degree 2 sign -" \
|
|
"3x² + -2x -7 = 0" "\
|
|
Reduced form: -7 * x^0 - 2 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
1.89681
|
|
-1.23014"
|
|
|
|
run_test \
|
|
"33. degree 2 float because big" \
|
|
"3x² + 12345678901234567x -7 = 0" "\
|
|
Reduced form: -7 * x^0 + 1.23457e+16 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
0
|
|
-4.11523e+15"
|
|
|
|
run_test \
|
|
"34. degree 2 float because too big by 1" \
|
|
"3x² + 2147483648x -7 = 0" "\
|
|
Reduced form: -7 * x^0 + 2.14748e+09 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
0
|
|
-7.15828e+08"
|
|
|
|
run_test \
|
|
"35. degree 2 float because too small by 1" \
|
|
"3x² + -2147483649x -7 = 0" "\
|
|
Reduced form: -7 * x^0 - 2.14748e+09 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
7.15828e+08
|
|
0"
|
|
|
|
run_test \
|
|
"36. degree 2 int max" \
|
|
"3x² + 2147483647x -7 = 0" "\
|
|
Reduced form: -7 * x^0 + 2.14748e+09 * x^1 + 3 * x^2 = 0
|
|
Polynomial degree: 2
|
|
Discriminant is strictly positive, the two solutions are:
|
|
0
|
|
-7.15828e+08"
|
|
|
|
run_test \
|
|
"37. degree 2 exponent too big" \
|
|
"3x²¹⁴⁷⁴⁸³⁶⁴⁷ + 2x -7 = 0" \
|
|
"" \
|
|
error
|
|
|
|
run_test \
|
|
"38. degree 2 big enough" \
|
|
"3x⁹⁹⁹ + 2x -7 = 0" "\
|
|
Reduced form: -7 * x^0 + 2 * x^1 + 0 * x^2 + 0 * x^3 + 0 * x^4 + 0 * x^5 + 0 * x^6 + 0 * x^7 + 0 * x^8 + 0 * x^9 + 0 * x^10 + 0 * x^11 + 0 * x^12 + 0 * x^13 + 0 * x^14 + 0 * x^15 + 0 * x^16 + 0 * x^17 + 0 * x^18 + 0 * x^19 + 0 * x^20 + 0 * x^21 + 0 * x^22 + 0 * x^23 + 0 * x^24 + 0 * x^25 + 0 * x^26 + 0 * x^27 + 0 * x^28 + 0 * x^29 + 0 * x^30 + 0 * x^31 + 0 * x^32 + 0 * x^33 + 0 * x^34 + 0 * x^35 + 0 * x^36 + 0 * x^37 + 0 * x^38 + 0 * x^39 + 0 * x^40 + 0 * x^41 + 0 * x^42 + 0 * x^43 + 0 * x^44 + 0 * x^45 + 0 * x^46 + 0 * x^47 + 0 * x^48 + 0 * x^49 + 0 * x^50 + 0 * x^51 + 0 * x^52 + 0 * x^53 + 0 * x^54 + 0 * x^55 + 0 * x^56 + 0 * x^57 + 0 * x^58 + 0 * x^59 + 0 * x^60 + 0 * x^61 + 0 * x^62 + 0 * x^63 + 0 * x^64 + 0 * x^65 + 0 * x^66 + 0 * x^67 + 0 * x^68 + 0 * x^69 + 0 * x^70 + 0 * x^71 + 0 * x^72 + 0 * x^73 + 0 * x^74 + 0 * x^75 + 0 * x^76 + 0 * x^77 + 0 * x^78 + 0 * x^79 + 0 * x^80 + 0 * x^81 + 0 * x^82 + 0 * x^83 + 0 * x^84 + 0 * x^85 + 0 * x^86 + 0 * x^87 + 0 * x^88 + 0 * x^89 + 0 * x^90 + 0 * x^91 + 0 * x^92 + 0 * x^93 + 0 * x^94 + 0 * x^95 + 0 * x^96 + 0 * x^97 + 0 * x^98 + 0 * x^99 + 0 * x^100 + 0 * x^101 + 0 * x^102 + 0 * x^103 + 0 * x^104 + 0 * x^105 + 0 * x^106 + 0 * x^107 + 0 * x^108 + 0 * x^109 + 0 * x^110 + 0 * x^111 + 0 * x^112 + 0 * x^113 + 0 * x^114 + 0 * x^115 + 0 * x^116 + 0 * x^117 + 0 * x^118 + 0 * x^119 + 0 * x^120 + 0 * x^121 + 0 * x^122 + 0 * x^123 + 0 * x^124 + 0 * x^125 + 0 * x^126 + 0 * x^127 + 0 * x^128 + 0 * x^129 + 0 * x^130 + 0 * x^131 + 0 * x^132 + 0 * x^133 + 0 * x^134 + 0 * x^135 + 0 * x^136 + 0 * x^137 + 0 * x^138 + 0 * x^139 + 0 * x^140 + 0 * x^141 + 0 * x^142 + 0 * x^143 + 0 * x^144 + 0 * x^145 + 0 * x^146 + 0 * x^147 + 0 * x^148 + 0 * x^149 + 0 * x^150 + 0 * x^151 + 0 * x^152 + 0 * x^153 + 0 * x^154 + 0 * x^155 + 0 * x^156 + 0 * x^157 + 0 * x^158 + 0 * x^159 + 0 * x^160 + 0 * x^161 + 0 * x^162 + 0 * x^163 + 0 * x^164 + 0 * x^165 + 0 * x^166 + 0 * x^167 + 0 * x^168 + 0 * x^169 + 0 * x^170 + 0 * x^171 + 0 * x^172 + 0 * x^173 + 0 * x^174 + 0 * x^175 + 0 * x^176 + 0 * x^177 + 0 * x^178 + 0 * x^179 + 0 * x^180 + 0 * x^181 + 0 * x^182 + 0 * x^183 + 0 * x^184 + 0 * x^185 + 0 * x^186 + 0 * x^187 + 0 * x^188 + 0 * x^189 + 0 * x^190 + 0 * x^191 + 0 * x^192 + 0 * x^193 + 0 * x^194 + 0 * x^195 + 0 * x^196 + 0 * x^197 + 0 * x^198 + 0 * x^199 + 0 * x^200 + 0 * x^201 + 0 * x^202 + 0 * x^203 + 0 * x^204 + 0 * x^205 + 0 * x^206 + 0 * x^207 + 0 * x^208 + 0 * x^209 + 0 * x^210 + 0 * x^211 + 0 * x^212 + 0 * x^213 + 0 * x^214 + 0 * x^215 + 0 * x^216 + 0 * x^217 + 0 * x^218 + 0 * x^219 + 0 * x^220 + 0 * x^221 + 0 * x^222 + 0 * x^223 + 0 * x^224 + 0 * x^225 + 0 * x^226 + 0 * x^227 + 0 * x^228 + 0 * x^229 + 0 * x^230 + 0 * x^231 + 0 * x^232 + 0 * x^233 + 0 * x^234 + 0 * x^235 + 0 * x^236 + 0 * x^237 + 0 * x^238 + 0 * x^239 + 0 * x^240 + 0 * x^241 + 0 * x^242 + 0 * x^243 + 0 * x^244 + 0 * x^245 + 0 * x^246 + 0 * x^247 + 0 * x^248 + 0 * x^249 + 0 * x^250 + 0 * x^251 + 0 * x^252 + 0 * x^253 + 0 * x^254 + 0 * x^255 + 0 * x^256 + 0 * x^257 + 0 * x^258 + 0 * x^259 + 0 * x^260 + 0 * x^261 + 0 * x^262 + 0 * x^263 + 0 * x^264 + 0 * x^265 + 0 * x^266 + 0 * x^267 + 0 * x^268 + 0 * x^269 + 0 * x^270 + 0 * x^271 + 0 * x^272 + 0 * x^273 + 0 * x^274 + 0 * x^275 + 0 * x^276 + 0 * x^277 + 0 * x^278 + 0 * x^279 + 0 * x^280 + 0 * x^281 + 0 * x^282 + 0 * x^283 + 0 * x^284 + 0 * x^285 + 0 * x^286 + 0 * x^287 + 0 * x^288 + 0 * x^289 + 0 * x^290 + 0 * x^291 + 0 * x^292 + 0 * x^293 + 0 * x^294 + 0 * x^295 + 0 * x^296 + 0 * x^297 + 0 * x^298 + 0 * x^299 + 0 * x^300 + 0 * x^301 + 0 * x^302 + 0 * x^303 + 0 * x^304 + 0 * x^305 + 0 * x^306 + 0 * x^307 + 0 * x^308 + 0 * x^309 + 0 * x^310 + 0 * x^311 + 0 * x^312 + 0 * x^313 + 0 * x^314 + 0 * x^315 + 0 * x^316 + 0 * x^317 + 0 * x^318 + 0 * x^319 + 0 * x^320 + 0 * x^321 + 0 * x^322 + 0 * x^323 + 0 * x^324 + 0 * x^325 + 0 * x^326 + 0 * x^327 + 0 * x^328 + 0 * x^329 + 0 * x^330 + 0 * x^331 + 0 * x^332 + 0 * x^333 + 0 * x^334 + 0 * x^335 + 0 * x^336 + 0 * x^337 + 0 * x^338 + 0 * x^339 + 0 * x^340 + 0 * x^341 + 0 * x^342 + 0 * x^343 + 0 * x^344 + 0 * x^345 + 0 * x^346 + 0 * x^347 + 0 * x^348 + 0 * x^349 + 0 * x^350 + 0 * x^351 + 0 * x^352 + 0 * x^353 + 0 * x^354 + 0 * x^355 + 0 * x^356 + 0 * x^357 + 0 * x^358 + 0 * x^359 + 0 * x^360 + 0 * x^361 + 0 * x^362 + 0 * x^363 + 0 * x^364 + 0 * x^365 + 0 * x^366 + 0 * x^367 + 0 * x^368 + 0 * x^369 + 0 * x^370 + 0 * x^371 + 0 * x^372 + 0 * x^373 + 0 * x^374 + 0 * x^375 + 0 * x^376 + 0 * x^377 + 0 * x^378 + 0 * x^379 + 0 * x^380 + 0 * x^381 + 0 * x^382 + 0 * x^383 + 0 * x^384 + 0 * x^385 + 0 * x^386 + 0 * x^387 + 0 * x^388 + 0 * x^389 + 0 * x^390 + 0 * x^391 + 0 * x^392 + 0 * x^393 + 0 * x^394 + 0 * x^395 + 0 * x^396 + 0 * x^397 + 0 * x^398 + 0 * x^399 + 0 * x^400 + 0 * x^401 + 0 * x^402 + 0 * x^403 + 0 * x^404 + 0 * x^405 + 0 * x^406 + 0 * x^407 + 0 * x^408 + 0 * x^409 + 0 * x^410 + 0 * x^411 + 0 * x^412 + 0 * x^413 + 0 * x^414 + 0 * x^415 + 0 * x^416 + 0 * x^417 + 0 * x^418 + 0 * x^419 + 0 * x^420 + 0 * x^421 + 0 * x^422 + 0 * x^423 + 0 * x^424 + 0 * x^425 + 0 * x^426 + 0 * x^427 + 0 * x^428 + 0 * x^429 + 0 * x^430 + 0 * x^431 + 0 * x^432 + 0 * x^433 + 0 * x^434 + 0 * x^435 + 0 * x^436 + 0 * x^437 + 0 * x^438 + 0 * x^439 + 0 * x^440 + 0 * x^441 + 0 * x^442 + 0 * x^443 + 0 * x^444 + 0 * x^445 + 0 * x^446 + 0 * x^447 + 0 * x^448 + 0 * x^449 + 0 * x^450 + 0 * x^451 + 0 * x^452 + 0 * x^453 + 0 * x^454 + 0 * x^455 + 0 * x^456 + 0 * x^457 + 0 * x^458 + 0 * x^459 + 0 * x^460 + 0 * x^461 + 0 * x^462 + 0 * x^463 + 0 * x^464 + 0 * x^465 + 0 * x^466 + 0 * x^467 + 0 * x^468 + 0 * x^469 + 0 * x^470 + 0 * x^471 + 0 * x^472 + 0 * x^473 + 0 * x^474 + 0 * x^475 + 0 * x^476 + 0 * x^477 + 0 * x^478 + 0 * x^479 + 0 * x^480 + 0 * x^481 + 0 * x^482 + 0 * x^483 + 0 * x^484 + 0 * x^485 + 0 * x^486 + 0 * x^487 + 0 * x^488 + 0 * x^489 + 0 * x^490 + 0 * x^491 + 0 * x^492 + 0 * x^493 + 0 * x^494 + 0 * x^495 + 0 * x^496 + 0 * x^497 + 0 * x^498 + 0 * x^499 + 0 * x^500 + 0 * x^501 + 0 * x^502 + 0 * x^503 + 0 * x^504 + 0 * x^505 + 0 * x^506 + 0 * x^507 + 0 * x^508 + 0 * x^509 + 0 * x^510 + 0 * x^511 + 0 * x^512 + 0 * x^513 + 0 * x^514 + 0 * x^515 + 0 * x^516 + 0 * x^517 + 0 * x^518 + 0 * x^519 + 0 * x^520 + 0 * x^521 + 0 * x^522 + 0 * x^523 + 0 * x^524 + 0 * x^525 + 0 * x^526 + 0 * x^527 + 0 * x^528 + 0 * x^529 + 0 * x^530 + 0 * x^531 + 0 * x^532 + 0 * x^533 + 0 * x^534 + 0 * x^535 + 0 * x^536 + 0 * x^537 + 0 * x^538 + 0 * x^539 + 0 * x^540 + 0 * x^541 + 0 * x^542 + 0 * x^543 + 0 * x^544 + 0 * x^545 + 0 * x^546 + 0 * x^547 + 0 * x^548 + 0 * x^549 + 0 * x^550 + 0 * x^551 + 0 * x^552 + 0 * x^553 + 0 * x^554 + 0 * x^555 + 0 * x^556 + 0 * x^557 + 0 * x^558 + 0 * x^559 + 0 * x^560 + 0 * x^561 + 0 * x^562 + 0 * x^563 + 0 * x^564 + 0 * x^565 + 0 * x^566 + 0 * x^567 + 0 * x^568 + 0 * x^569 + 0 * x^570 + 0 * x^571 + 0 * x^572 + 0 * x^573 + 0 * x^574 + 0 * x^575 + 0 * x^576 + 0 * x^577 + 0 * x^578 + 0 * x^579 + 0 * x^580 + 0 * x^581 + 0 * x^582 + 0 * x^583 + 0 * x^584 + 0 * x^585 + 0 * x^586 + 0 * x^587 + 0 * x^588 + 0 * x^589 + 0 * x^590 + 0 * x^591 + 0 * x^592 + 0 * x^593 + 0 * x^594 + 0 * x^595 + 0 * x^596 + 0 * x^597 + 0 * x^598 + 0 * x^599 + 0 * x^600 + 0 * x^601 + 0 * x^602 + 0 * x^603 + 0 * x^604 + 0 * x^605 + 0 * x^606 + 0 * x^607 + 0 * x^608 + 0 * x^609 + 0 * x^610 + 0 * x^611 + 0 * x^612 + 0 * x^613 + 0 * x^614 + 0 * x^615 + 0 * x^616 + 0 * x^617 + 0 * x^618 + 0 * x^619 + 0 * x^620 + 0 * x^621 + 0 * x^622 + 0 * x^623 + 0 * x^624 + 0 * x^625 + 0 * x^626 + 0 * x^627 + 0 * x^628 + 0 * x^629 + 0 * x^630 + 0 * x^631 + 0 * x^632 + 0 * x^633 + 0 * x^634 + 0 * x^635 + 0 * x^636 + 0 * x^637 + 0 * x^638 + 0 * x^639 + 0 * x^640 + 0 * x^641 + 0 * x^642 + 0 * x^643 + 0 * x^644 + 0 * x^645 + 0 * x^646 + 0 * x^647 + 0 * x^648 + 0 * x^649 + 0 * x^650 + 0 * x^651 + 0 * x^652 + 0 * x^653 + 0 * x^654 + 0 * x^655 + 0 * x^656 + 0 * x^657 + 0 * x^658 + 0 * x^659 + 0 * x^660 + 0 * x^661 + 0 * x^662 + 0 * x^663 + 0 * x^664 + 0 * x^665 + 0 * x^666 + 0 * x^667 + 0 * x^668 + 0 * x^669 + 0 * x^670 + 0 * x^671 + 0 * x^672 + 0 * x^673 + 0 * x^674 + 0 * x^675 + 0 * x^676 + 0 * x^677 + 0 * x^678 + 0 * x^679 + 0 * x^680 + 0 * x^681 + 0 * x^682 + 0 * x^683 + 0 * x^684 + 0 * x^685 + 0 * x^686 + 0 * x^687 + 0 * x^688 + 0 * x^689 + 0 * x^690 + 0 * x^691 + 0 * x^692 + 0 * x^693 + 0 * x^694 + 0 * x^695 + 0 * x^696 + 0 * x^697 + 0 * x^698 + 0 * x^699 + 0 * x^700 + 0 * x^701 + 0 * x^702 + 0 * x^703 + 0 * x^704 + 0 * x^705 + 0 * x^706 + 0 * x^707 + 0 * x^708 + 0 * x^709 + 0 * x^710 + 0 * x^711 + 0 * x^712 + 0 * x^713 + 0 * x^714 + 0 * x^715 + 0 * x^716 + 0 * x^717 + 0 * x^718 + 0 * x^719 + 0 * x^720 + 0 * x^721 + 0 * x^722 + 0 * x^723 + 0 * x^724 + 0 * x^725 + 0 * x^726 + 0 * x^727 + 0 * x^728 + 0 * x^729 + 0 * x^730 + 0 * x^731 + 0 * x^732 + 0 * x^733 + 0 * x^734 + 0 * x^735 + 0 * x^736 + 0 * x^737 + 0 * x^738 + 0 * x^739 + 0 * x^740 + 0 * x^741 + 0 * x^742 + 0 * x^743 + 0 * x^744 + 0 * x^745 + 0 * x^746 + 0 * x^747 + 0 * x^748 + 0 * x^749 + 0 * x^750 + 0 * x^751 + 0 * x^752 + 0 * x^753 + 0 * x^754 + 0 * x^755 + 0 * x^756 + 0 * x^757 + 0 * x^758 + 0 * x^759 + 0 * x^760 + 0 * x^761 + 0 * x^762 + 0 * x^763 + 0 * x^764 + 0 * x^765 + 0 * x^766 + 0 * x^767 + 0 * x^768 + 0 * x^769 + 0 * x^770 + 0 * x^771 + 0 * x^772 + 0 * x^773 + 0 * x^774 + 0 * x^775 + 0 * x^776 + 0 * x^777 + 0 * x^778 + 0 * x^779 + 0 * x^780 + 0 * x^781 + 0 * x^782 + 0 * x^783 + 0 * x^784 + 0 * x^785 + 0 * x^786 + 0 * x^787 + 0 * x^788 + 0 * x^789 + 0 * x^790 + 0 * x^791 + 0 * x^792 + 0 * x^793 + 0 * x^794 + 0 * x^795 + 0 * x^796 + 0 * x^797 + 0 * x^798 + 0 * x^799 + 0 * x^800 + 0 * x^801 + 0 * x^802 + 0 * x^803 + 0 * x^804 + 0 * x^805 + 0 * x^806 + 0 * x^807 + 0 * x^808 + 0 * x^809 + 0 * x^810 + 0 * x^811 + 0 * x^812 + 0 * x^813 + 0 * x^814 + 0 * x^815 + 0 * x^816 + 0 * x^817 + 0 * x^818 + 0 * x^819 + 0 * x^820 + 0 * x^821 + 0 * x^822 + 0 * x^823 + 0 * x^824 + 0 * x^825 + 0 * x^826 + 0 * x^827 + 0 * x^828 + 0 * x^829 + 0 * x^830 + 0 * x^831 + 0 * x^832 + 0 * x^833 + 0 * x^834 + 0 * x^835 + 0 * x^836 + 0 * x^837 + 0 * x^838 + 0 * x^839 + 0 * x^840 + 0 * x^841 + 0 * x^842 + 0 * x^843 + 0 * x^844 + 0 * x^845 + 0 * x^846 + 0 * x^847 + 0 * x^848 + 0 * x^849 + 0 * x^850 + 0 * x^851 + 0 * x^852 + 0 * x^853 + 0 * x^854 + 0 * x^855 + 0 * x^856 + 0 * x^857 + 0 * x^858 + 0 * x^859 + 0 * x^860 + 0 * x^861 + 0 * x^862 + 0 * x^863 + 0 * x^864 + 0 * x^865 + 0 * x^866 + 0 * x^867 + 0 * x^868 + 0 * x^869 + 0 * x^870 + 0 * x^871 + 0 * x^872 + 0 * x^873 + 0 * x^874 + 0 * x^875 + 0 * x^876 + 0 * x^877 + 0 * x^878 + 0 * x^879 + 0 * x^880 + 0 * x^881 + 0 * x^882 + 0 * x^883 + 0 * x^884 + 0 * x^885 + 0 * x^886 + 0 * x^887 + 0 * x^888 + 0 * x^889 + 0 * x^890 + 0 * x^891 + 0 * x^892 + 0 * x^893 + 0 * x^894 + 0 * x^895 + 0 * x^896 + 0 * x^897 + 0 * x^898 + 0 * x^899 + 0 * x^900 + 0 * x^901 + 0 * x^902 + 0 * x^903 + 0 * x^904 + 0 * x^905 + 0 * x^906 + 0 * x^907 + 0 * x^908 + 0 * x^909 + 0 * x^910 + 0 * x^911 + 0 * x^912 + 0 * x^913 + 0 * x^914 + 0 * x^915 + 0 * x^916 + 0 * x^917 + 0 * x^918 + 0 * x^919 + 0 * x^920 + 0 * x^921 + 0 * x^922 + 0 * x^923 + 0 * x^924 + 0 * x^925 + 0 * x^926 + 0 * x^927 + 0 * x^928 + 0 * x^929 + 0 * x^930 + 0 * x^931 + 0 * x^932 + 0 * x^933 + 0 * x^934 + 0 * x^935 + 0 * x^936 + 0 * x^937 + 0 * x^938 + 0 * x^939 + 0 * x^940 + 0 * x^941 + 0 * x^942 + 0 * x^943 + 0 * x^944 + 0 * x^945 + 0 * x^946 + 0 * x^947 + 0 * x^948 + 0 * x^949 + 0 * x^950 + 0 * x^951 + 0 * x^952 + 0 * x^953 + 0 * x^954 + 0 * x^955 + 0 * x^956 + 0 * x^957 + 0 * x^958 + 0 * x^959 + 0 * x^960 + 0 * x^961 + 0 * x^962 + 0 * x^963 + 0 * x^964 + 0 * x^965 + 0 * x^966 + 0 * x^967 + 0 * x^968 + 0 * x^969 + 0 * x^970 + 0 * x^971 + 0 * x^972 + 0 * x^973 + 0 * x^974 + 0 * x^975 + 0 * x^976 + 0 * x^977 + 0 * x^978 + 0 * x^979 + 0 * x^980 + 0 * x^981 + 0 * x^982 + 0 * x^983 + 0 * x^984 + 0 * x^985 + 0 * x^986 + 0 * x^987 + 0 * x^988 + 0 * x^989 + 0 * x^990 + 0 * x^991 + 0 * x^992 + 0 * x^993 + 0 * x^994 + 0 * x^995 + 0 * x^996 + 0 * x^997 + 0 * x^998 + 3 * x^999 = 0
|
|
Polynomial degree: 999
|
|
The polynomial degree is strictly greater than 2, I can't solve."
|
|
|
|
run_test \
|
|
"39. degree 2 too big by one" \
|
|
"3x¹⁰⁰⁰ + 2x -7 = 0" \
|
|
"" \
|
|
error
|