The quadratic formula (r2)

?

Percentage Accurate: 57.4% → 86.6%
Time: 26.0s
Precision: binary64
Cost: 14160

?

\[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
\[\begin{array}{l} t_0 := \frac{-c}{b}\\ \mathbf{if}\;b \leq -1.85 \cdot 10^{+28}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-37}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{elif}\;b \leq -2.25 \cdot 10^{-119}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 0.0002:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- c) b)))
   (if (<= b -1.85e+28)
     t_0
     (if (<= b -1.2e-37)
       (* -0.5 (/ (+ b (sqrt (- (* b b) (* a (* c 4.0))))) a))
       (if (<= b -2.25e-119)
         t_0
         (if (<= b 0.0002)
           (* -0.5 (/ (+ b (sqrt (fma a (* c -4.0) (* b b)))) a))
           (/ (- b) a)))))))
double code(double a, double b, double c) {
	return (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
double code(double a, double b, double c) {
	double t_0 = -c / b;
	double tmp;
	if (b <= -1.85e+28) {
		tmp = t_0;
	} else if (b <= -1.2e-37) {
		tmp = -0.5 * ((b + sqrt(((b * b) - (a * (c * 4.0))))) / a);
	} else if (b <= -2.25e-119) {
		tmp = t_0;
	} else if (b <= 0.0002) {
		tmp = -0.5 * ((b + sqrt(fma(a, (c * -4.0), (b * b)))) / a);
	} else {
		tmp = -b / a;
	}
	return tmp;
}
function code(a, b, c)
	return Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(2.0 * a))
end
function code(a, b, c)
	t_0 = Float64(Float64(-c) / b)
	tmp = 0.0
	if (b <= -1.85e+28)
		tmp = t_0;
	elseif (b <= -1.2e-37)
		tmp = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 4.0))))) / a));
	elseif (b <= -2.25e-119)
		tmp = t_0;
	elseif (b <= 0.0002)
		tmp = Float64(-0.5 * Float64(Float64(b + sqrt(fma(a, Float64(c * -4.0), Float64(b * b)))) / a));
	else
		tmp = Float64(Float64(-b) / a);
	end
	return tmp
end
code[a_, b_, c_] := N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_] := Block[{t$95$0 = N[((-c) / b), $MachinePrecision]}, If[LessEqual[b, -1.85e+28], t$95$0, If[LessEqual[b, -1.2e-37], N[(-0.5 * N[(N[(b + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.25e-119], t$95$0, If[LessEqual[b, 0.0002], N[(-0.5 * N[(N[(b + N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[((-b) / a), $MachinePrecision]]]]]]
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
\begin{array}{l}
t_0 := \frac{-c}{b}\\
\mathbf{if}\;b \leq -1.85 \cdot 10^{+28}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq -1.2 \cdot 10^{-37}:\\
\;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\

\mathbf{elif}\;b \leq -2.25 \cdot 10^{-119}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 0.0002:\\
\;\;\;\;-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{-b}{a}\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 9 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Target

Original57.4%
Target79.2%
Herbie86.6%
\[\begin{array}{l} \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\\ \end{array} \]

Derivation?

  1. Split input into 4 regimes
  2. if b < -1.85e28 or -1.19999999999999995e-37 < b < -2.2500000000000001e-119

    1. Initial program 21.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 88.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Simplified88.8%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
      Step-by-step derivation

      [Start]88.8%

      \[ -1 \cdot \frac{c}{b} \]

      associate-*r/ [=>]88.8%

      \[ \color{blue}{\frac{-1 \cdot c}{b}} \]

      neg-mul-1 [<=]88.8%

      \[ \frac{\color{blue}{-c}}{b} \]

    if -1.85e28 < b < -1.19999999999999995e-37

    1. Initial program 74.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified74.1%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
      Step-by-step derivation

      [Start]74.1%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

      /-rgt-identity [<=]74.1%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]

      metadata-eval [<=]74.1%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]

      associate-/l* [=>]73.8%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]

      associate-/r/ [=>]73.8%

      \[ \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]

      *-commutative [<=]73.8%

      \[ \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]

      metadata-eval [=>]73.8%

      \[ \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      metadata-eval [<=]73.8%

      \[ \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      associate-*l/ [<=]73.8%

      \[ \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      associate-/r/ [<=]73.8%

      \[ \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      times-frac [<=]74.1%

      \[ \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]

      *-commutative [<=]74.1%

      \[ \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]

      times-frac [=>]74.1%

      \[ \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]

      metadata-eval [=>]74.1%

      \[ \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]

      associate-/r/ [=>]74.1%

      \[ -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]

      *-commutative [<=]74.1%

      \[ -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]

      div-sub [=>]74.0%

      \[ -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]
    3. Applied egg-rr74.1%

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
      Step-by-step derivation

      [Start]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a} \]

      fma-udef [=>]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]

      associate-*r* [=>]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]

      metadata-eval [<=]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]

      distribute-rgt-neg-in [<=]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]

      *-commutative [<=]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\left(-\color{blue}{4 \cdot \left(a \cdot c\right)}\right) + b \cdot b}}{a} \]

      +-commutative [=>]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]

      sub-neg [<=]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]

      *-commutative [=>]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{b \cdot b - \color{blue}{\left(a \cdot c\right) \cdot 4}}}{a} \]

      associate-*l* [=>]74.1%

      \[ -0.5 \cdot \frac{b + \sqrt{b \cdot b - \color{blue}{a \cdot \left(c \cdot 4\right)}}}{a} \]

    if -2.2500000000000001e-119 < b < 2.0000000000000001e-4

    1. Initial program 81.7%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified81.7%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
      Step-by-step derivation

      [Start]81.7%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

      /-rgt-identity [<=]81.7%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2 \cdot a}{1}}} \]

      metadata-eval [<=]81.7%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{2 \cdot a}{\color{blue}{--1}}} \]

      associate-/l* [=>]81.5%

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{\frac{2}{\frac{--1}{a}}}} \]

      associate-/r/ [=>]81.5%

      \[ \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \cdot \frac{--1}{a}} \]

      *-commutative [<=]81.5%

      \[ \color{blue}{\frac{--1}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2}} \]

      metadata-eval [=>]81.5%

      \[ \frac{\color{blue}{1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      metadata-eval [<=]81.5%

      \[ \frac{\color{blue}{-1 \cdot -1}}{a} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      associate-*l/ [<=]81.5%

      \[ \color{blue}{\left(\frac{-1}{a} \cdot -1\right)} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      associate-/r/ [<=]81.5%

      \[ \color{blue}{\frac{-1}{\frac{a}{-1}}} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2} \]

      times-frac [<=]81.7%

      \[ \color{blue}{\frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\frac{a}{-1} \cdot 2}} \]

      *-commutative [<=]81.7%

      \[ \frac{-1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right)}{\color{blue}{2 \cdot \frac{a}{-1}}} \]

      times-frac [=>]81.7%

      \[ \color{blue}{\frac{-1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}}} \]

      metadata-eval [=>]81.7%

      \[ \color{blue}{-0.5} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \]

      associate-/r/ [=>]81.7%

      \[ -0.5 \cdot \color{blue}{\left(\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a} \cdot -1\right)} \]

      *-commutative [<=]81.7%

      \[ -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]

      div-sub [=>]81.6%

      \[ -0.5 \cdot \left(-1 \cdot \color{blue}{\left(\frac{-b}{a} - \frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)}\right) \]

    if 2.0000000000000001e-4 < b

    1. Initial program 86.0%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 100.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
      Step-by-step derivation

      [Start]100.0%

      \[ -1 \cdot \frac{b}{a} \]

      associate-*r/ [=>]100.0%

      \[ \color{blue}{\frac{-1 \cdot b}{a}} \]

      mul-1-neg [=>]100.0%

      \[ \frac{\color{blue}{-b}}{a} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.85 \cdot 10^{+28}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-37}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{elif}\;b \leq -2.25 \cdot 10^{-119}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 0.0002:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy86.6%
Cost14160
\[\begin{array}{l} t_0 := \frac{-c}{b}\\ \mathbf{if}\;b \leq -1.85 \cdot 10^{+28}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-37}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{elif}\;b \leq -2.25 \cdot 10^{-119}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 0.0002:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 2
Accuracy86.6%
Cost7888
\[\begin{array}{l} t_0 := \frac{-c}{b}\\ t_1 := -0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{if}\;b \leq -1.85 \cdot 10^{+28}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.82 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2.6 \cdot 10^{-120}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 0.0002:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 3
Accuracy86.3%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-120}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-100}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{-4 \cdot \left(c \cdot a\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 4
Accuracy77.0%
Cost1092
\[\begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{b + \left(b + -2 \cdot \left(c \cdot \frac{a}{b}\right)\right)}{a}\\ \end{array} \]
Alternative 5
Accuracy77.0%
Cost580
\[\begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 6
Accuracy46.4%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq -6 \cdot 10^{+37}:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 7
Accuracy76.8%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq -8 \cdot 10^{-304}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 8
Accuracy1.9%
Cost192
\[\frac{b}{a} \]
Alternative 9
Accuracy9.9%
Cost192
\[\frac{c}{b} \]

Reproduce?

herbie shell --seed 2023277 
(FPCore (a b c)
  :name "The quadratic formula (r2)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))

  (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))