Common Lisp

Work in pairs

The "abc"-formula for solving the quadratic \(ax^2 + bx + c = 0\) is \[ x = { -b \pm \sqrt{b^2 -4ac} \over 2a} \]

The roots are the two values \[ { -b + \sqrt{b^2 -4ac} \over 2a}, { -b - \sqrt{b^2 -4ac} \over 2a} \]

The list expression below returns a list of the three values of a, b, and c, namely (1 2 3).

Write a Lisp expression in place of the a b c which returns a list of the two roots of the quadratic \(x^2 + 3x + 2 = 0\)

(let ((a 1)
      (b 3)
      (c 2))
  (list a b c))

etc

Author: Breanndán Ó Nualláin <o@uva.nl>

Date: 2026-03-05 Thu 13:22