Hidden WordScanner
Private scans · No account required

DuckieDai Cubic Zero Solver

Test one supplied zero of a cubic, then solve the resulting quadratic quotient when that zero is confirmed.

Using the full toolkit? Read the step-by-step Polynomial Toolkit guide for quartic, cubic, and quadratic workflows, worked examples, and a reminder to keep every root you find.

algebra · MIT License

Overview

Test one supplied zero of a cubic, then solve the resulting quadratic quotient when that zero is confirmed.

  • Owner-tested on a TI calculator
  • Version 1.0.0
  • 3934 bytes
  • Uses math

Before you run it

  • TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
  • TI Connect CE .py transfer to the Python App; the owner's transfer details were not recorded
  • Inputs represent a non-degenerate cubic and a valid numeric or p/q zero.
  • The solver only continues after the supplied candidate is confirmed as a zero.
  • Remainders with magnitude below 1e-7 are treated as zero.

Try the DuckieDai calculator screen

Follow the program's prompts and result flow before downloading.

JavaScript is required for the optional browser simulation. Source viewing and downloading remain available without it.

Simulation boundary: This preview uses a reviewed browser adapter. It does not execute the downloaded Python and does not prove TI-Python or calculator compatibility.

Exact reviewed bytes

Source code

Download .py

View source below, copy it when JavaScript is available, or download the exact .py bytes.

  1. """DuckieDai Cubic Zero Solver for TI-84 Plus CE Python."""
  2. from math import sqrt
  3. def duckiedai_intro(program_name, wait=True):
  4. title = program_name[:16]
  5. empty = 16 - len(title)
  6. left = empty // 2
  7. right = empty - left
  8. print("+----------------------+")
  9. print("| " + " " * left + title + " " * right + " |")
  10. print("| |")
  11. print("| __ |")
  12. print("| ___(o )> quack! |")
  13. print("| \\ <_. ) |")
  14. print("| `---' |")
  15. print("| by DuckieDai |")
  16. print("| hiddenwordscanner.com|")
  17. print("+----------------------+")
  18. print("Loading...")
  19. if wait:
  20. input("Press enter to start ")
  21. print("\n" * 8)
  22. def clear_screen():
  23. print("\n" * 8)
  24. def clean_num(n):
  25. if abs(n - round(n)) < 0.0000001:
  26. return int(round(n))
  27. return round(n, 6)
  28. def quadratic_solver(a, b, c):
  29. disc = b * b - 4 * a * c
  30. # SCREEN 3
  31. clear_screen()
  32. print("QUADRATIC")
  33. print("---------")
  34. print(clean_num(a), "x^2")
  35. print(clean_num(b), "x")
  36. print(clean_num(c))
  37. print("")
  38. print("Discriminant:")
  39. print(clean_num(disc))
  40. input("\nPress enter ")
  41. # SCREEN 4
  42. clear_screen()
  43. print("OTHER ROOTS")
  44. print("-----------")
  45. if abs(disc) < 0.0000001:
  46. x = -b / (2 * a)
  47. print("One repeated root:")
  48. print(clean_num(x))
  49. elif disc > 0:
  50. x1 = (-b + sqrt(disc)) / (2 * a)
  51. x2 = (-b - sqrt(disc)) / (2 * a)
  52. print("x1 =", clean_num(x1))
  53. print("x2 =", clean_num(x2))
  54. print("")
  55. print("Exact form:")
  56. print(clean_num(-b), "+/-")
  57. print("sqrt(", clean_num(disc), ")")
  58. print("over", clean_num(2 * a))
  59. else:
  60. real = -b / (2 * a)
  61. imag = sqrt(-disc) / abs(2 * a)
  62. print("Complex roots:")
  63. print(clean_num(real), "+")
  64. print(clean_num(imag), "i")
  65. print("")
  66. print(clean_num(real), "-")
  67. print(clean_num(imag), "i")
  68. input("\nPress enter ")
  69. def number(prompt):
  70. text = input(prompt)
  71. if "/" in text:
  72. parts = text.split("/")
  73. return float(parts[0]) / float(parts[1])
  74. return float(text)
  75. def run_test():
  76. clear_screen()
  77. print("ENTER CUBIC")
  78. print("ax^3+bx^2+cx+d")
  79. print("")
  80. a = float(input("x^3: "))
  81. b = float(input("x^2: "))
  82. c = float(input("x: "))
  83. d = float(input("Const: "))
  84. print("")
  85. print("Test zero")
  86. print("Use decimal if frac")
  87. zero = number("Zero: ")
  88. first = a
  89. second = b + first * zero
  90. third = c + second * zero
  91. remainder = d + third * zero
  92. # Fix tiny floating errors
  93. if abs(remainder) < 0.0000001:
  94. remainder = 0
  95. # SCREEN 1
  96. clear_screen()
  97. print("ZERO TEST")
  98. print("---------")
  99. print("Test:", clean_num(zero))
  100. print("R:", clean_num(remainder))
  101. print("")
  102. if remainder == 0:
  103. print("TRUE!")
  104. print("IT IS A ZERO")
  105. else:
  106. print("FALSE")
  107. print("NOT A ZERO")
  108. input("\nPress enter ")
  109. # If false, stop here
  110. if remainder != 0:
  111. return
  112. # SCREEN 2
  113. clear_screen()
  114. print("QUOTIENT")
  115. print("--------")
  116. print(clean_num(first), "x^2")
  117. print(clean_num(second), "x")
  118. print(clean_num(third))
  119. print("")
  120. print("Next:")
  121. print("Quadratic formula")
  122. input("\nPress enter ")
  123. # AUTOMATICALLY SOLVE QUADRATIC
  124. quadratic_solver(first, second, third)
  125. # FINAL SCREEN
  126. clear_screen()
  127. print("ALL ROOTS")
  128. print("---------")
  129. print("First root:")
  130. print(clean_num(zero))
  131. print("")
  132. print("Other 2 shown")
  133. print("on last screen")
  134. duckiedai_intro("Cubic Solver")
  135. while True:
  136. run_test()
  137. print("")
  138. again = input("Again? y/n: ")
  139. if again.lower() != "y":
  140. break
  141. clear_screen()
  142. print("DuckieDai says: done!")
Filename
synthD.py
Size
3934 bytes
SHA-256
f4c36ab4cc6940021758957bcd5cb9c3e2beefa62bd56aac0fa11b74e9eb73c6

Usage

Inputs

  • Numeric coefficients a, b, c, and d for ax^3 + bx^2 + cx + d
  • One decimal or p/q-form proposed zero

Outputs

  • True or false zero result
  • Quadratic quotient
  • Remaining real, repeated, or complex roots when the tested zero is true

Units: Polynomial coefficients; no physical units.

Assumptions and limitations

Assumptions

  • Inputs represent a non-degenerate cubic and a valid numeric or p/q zero.

Constraints

  • The solver only continues after the supplied candidate is confirmed as a zero.
  • Remainders with magnitude below 1e-7 are treated as zero.

Known failures

  • Malformed fractions and zero denominators use the calculator Python input error path.
  • A zero leading coefficient can create invalid quadratic-formula arithmetic.

Compatibility and review

Review status
Owner-tested on a TI calculator
Tested on
Owner reports personally testing this program on a TI-84 Plus CE Python calculator; the test date, OS version, and Python App version were not recorded
What happened
Owner reported pass on the calculator. The published file is the owner's tested source.
Dependencies
math
Suggested calculator name
SYNTHD — you can give it another valid, unique name when you transfer it
Desktop test cases
Not available for this interactive-only source

This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.

Transfer and launch

  1. Confirm that your calculator is the Python-capable model named above. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.
  2. Download the .py source above and verify its SHA-256 digest if your computer provides that option.
  3. Use TI Connect CE to send the Python file to a compatible calculator. SYNTHD is a suggested name; you may choose another valid, unique calculator name.
  4. Open the Python App, select the program, and check sample inputs before relying on other results.

Read the complete installation, launch, troubleshooting, and removal guide.

Availability does not mean a teacher, school, or exam permits this program. Follow the applicable rules.

Version history

Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.

Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.

Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.