\[\begin{cases} \frac{2 \cdot c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}} & \text{when } b \ge 0 \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{otherwise} \end{cases}\]
Test:
jeff quadratic root 2
Bits:
128 bits
Bits error versus a
Bits error versus b
Bits error versus c
Time: 10.9 s
Input Error: 9.3
Output Error: 9.4
Log:
Profile: 🕒
\(\begin{cases} \frac{2 \cdot c}{\left(-b\right) - {\left(\sqrt{\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}\right)}^2} & \text{when } b \ge 0 \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{otherwise} \end{cases}\)
  1. Started with
    \[\begin{cases} \frac{2 \cdot c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}} & \text{when } b \ge 0 \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{otherwise} \end{cases}\]
    9.3
  2. Using strategy rm
    9.3
  3. Applied add-sqr-sqrt to get
    \[\begin{cases} \frac{2 \cdot c}{\left(-b\right) - \color{red}{\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}} & \text{when } b \ge 0 \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{otherwise} \end{cases} \leadsto \begin{cases} \frac{2 \cdot c}{\left(-b\right) - \color{blue}{{\left(\sqrt{\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}\right)}^2}} & \text{when } b \ge 0 \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{otherwise} \end{cases}\]
    9.4

Original test:


(lambda ((a default) (b default) (c default))
  #:name "jeff quadratic root 2"
  (if (>= b 0) (/ (* 2 c) (- (- b) (sqrt (- (sqr b) (* (* 4 a) c))))) (/ (+ (- b) (sqrt (- (sqr b) (* (* 4 a) c)))) (* 2 a))))