## Quadratic Formula
(defn qform
"Use the quadratic formula to solve for x. Returns all real solutions."
[a b c]
(def det (- (* b b) (* 4 a c)))
(def factor (/ 0.5 a))
(cond
(neg? det) []
(zero? det) [(* factor (- b))]
(let [root-det (math/sqrt det)]
[(* factor (- (- b) root-det)) (* factor (+ (- b) root-det))])))
(qform 1 4 3) # -> (-3 -1)