Here is a programming challenge for the RPN addicts.

Write a program that takes as input in the stack:

z: a

y: b

x: c

and outputs

y: (-b - sqrt(b^2 - 4ac))/(2a)

x: (-b + sqrt(b^2 - 4ac))/(2a)

(the solutions to the 2nd degree equation, assuming that they are real).

The program should use only the stack and the Last_x register, but no other registers.

The solution should be developed for the 11C or 15C or 32SII architecture (i.e., no HP48 extensions allowed, and in particular, no PICK instructions).

I have a 35-ish step solution that uses Last_x.

The solution is not particularily optimized, and I am not sure that Last_x is really needed.

The contest is open for the shortest solution,

and for a solution without Last_x!

Luca