Cubic Equation

Program mode: CMPLX

Program syntax: Lbl 1: ?→A: ?→B: ?→C: ?→D: -B÷(3A→B: B3-.5A-1(BC+D →M: B2-C÷(3A→X: √(M2-X3M+: If M=0: Then -3√(D→X◢ X◢X◢ Goto 1: IfEnd: 3-1arg(M →D: For 0→A To 2: D+120A: 3√(Abs(M)) (cos(Ans)+i sin(Ans: Ans+X÷Ans+B◢Next: Goto 1 (121 bytes or 130 bytes)

Program description: The syntax highlighted in yellow are wrapping-up syntax, which are not necessary. First, rewrite the cubic equation in the form of ax3+bx2+cx+d=0. For example, x3-3x2-6x+8=0. Then start the program and type the coefficients of x from the highest power to the lowest power. For the above example, you should type [1][EXE][-3][EXE][-6][EXE][8][EXE]. After that, one of the roots will be displayed. Press [EXE] once to see the other roots and one more time to see the remaining root.

Notes: