Average Error: 19.5 → 7.4
Time: 21.0s
Precision: binary64
Cost: 38052
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ t_1 := \left(-b\right) - b\\ t_2 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\ t_3 := \frac{2 \cdot c}{\left(-b\right) - t_2}\\ t_4 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{t_2 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{if}\;t_4 \leq -4 \cdot 10^{+222}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, t_0\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{a}{\mathsf{hypot}\left(b, \sqrt{a \cdot -4} \cdot \sqrt{c}\right) - b}}\\ \end{array}\\ \mathbf{elif}\;t_4 \leq -4 \cdot 10^{-297}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-4 \cdot \left(c \cdot a\right)}{\sqrt{t_0} - b}}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;t_4 \leq 4 \cdot 10^{+263}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{2 \cdot a}\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (>= b 0.0)
   (/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* c (* a -4.0)))
        (t_1 (- (- b) b))
        (t_2 (sqrt (- (* b b) (* c (* 4.0 a)))))
        (t_3 (/ (* 2.0 c) (- (- b) t_2)))
        (t_4 (if (>= b 0.0) t_3 (/ (- t_2 b) (* 2.0 a)))))
   (if (<= t_4 -4e+222)
     (if (>= b 0.0)
       (* c (/ -2.0 (+ b (sqrt (fma b b t_0)))))
       (/ 0.5 (/ a (- (hypot b (* (sqrt (* a -4.0)) (sqrt c))) b))))
     (if (<= t_4 -4e-297)
       t_4
       (if (<= t_4 0.0)
         (if (>= b 0.0)
           (/ (* 2.0 c) t_1)
           (/ (/ (* -4.0 (* c a)) (- (sqrt t_0) b)) (* 2.0 a)))
         (if (<= t_4 4e+263) t_4 (if (>= b 0.0) t_3 (/ t_1 (* 2.0 a)))))))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
	} else {
		tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
	}
	return tmp;
}
double code(double a, double b, double c) {
	double t_0 = c * (a * -4.0);
	double t_1 = -b - b;
	double t_2 = sqrt(((b * b) - (c * (4.0 * a))));
	double t_3 = (2.0 * c) / (-b - t_2);
	double tmp;
	if (b >= 0.0) {
		tmp = t_3;
	} else {
		tmp = (t_2 - b) / (2.0 * a);
	}
	double t_4 = tmp;
	double tmp_2;
	if (t_4 <= -4e+222) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = c * (-2.0 / (b + sqrt(fma(b, b, t_0))));
		} else {
			tmp_3 = 0.5 / (a / (hypot(b, (sqrt((a * -4.0)) * sqrt(c))) - b));
		}
		tmp_2 = tmp_3;
	} else if (t_4 <= -4e-297) {
		tmp_2 = t_4;
	} else if (t_4 <= 0.0) {
		double tmp_4;
		if (b >= 0.0) {
			tmp_4 = (2.0 * c) / t_1;
		} else {
			tmp_4 = ((-4.0 * (c * a)) / (sqrt(t_0) - b)) / (2.0 * a);
		}
		tmp_2 = tmp_4;
	} else if (t_4 <= 4e+263) {
		tmp_2 = t_4;
	} else if (b >= 0.0) {
		tmp_2 = t_3;
	} else {
		tmp_2 = t_1 / (2.0 * a);
	}
	return tmp_2;
}
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
	else
		tmp = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a));
	end
	return tmp
end
function code(a, b, c)
	t_0 = Float64(c * Float64(a * -4.0))
	t_1 = Float64(Float64(-b) - b)
	t_2 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a))))
	t_3 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_2))
	tmp = 0.0
	if (b >= 0.0)
		tmp = t_3;
	else
		tmp = Float64(Float64(t_2 - b) / Float64(2.0 * a));
	end
	t_4 = tmp
	tmp_2 = 0.0
	if (t_4 <= -4e+222)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = Float64(c * Float64(-2.0 / Float64(b + sqrt(fma(b, b, t_0)))));
		else
			tmp_3 = Float64(0.5 / Float64(a / Float64(hypot(b, Float64(sqrt(Float64(a * -4.0)) * sqrt(c))) - b)));
		end
		tmp_2 = tmp_3;
	elseif (t_4 <= -4e-297)
		tmp_2 = t_4;
	elseif (t_4 <= 0.0)
		tmp_4 = 0.0
		if (b >= 0.0)
			tmp_4 = Float64(Float64(2.0 * c) / t_1);
		else
			tmp_4 = Float64(Float64(Float64(-4.0 * Float64(c * a)) / Float64(sqrt(t_0) - b)) / Float64(2.0 * a));
		end
		tmp_2 = tmp_4;
	elseif (t_4 <= 4e+263)
		tmp_2 = t_4;
	elseif (b >= 0.0)
		tmp_2 = t_3;
	else
		tmp_2 = Float64(t_1 / Float64(2.0 * a));
	end
	return tmp_2
end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-b) - b), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = If[GreaterEqual[b, 0.0], t$95$3, N[(N[(t$95$2 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]}, If[LessEqual[t$95$4, -4e+222], If[GreaterEqual[b, 0.0], N[(c * N[(-2.0 / N[(b + N[Sqrt[N[(b * b + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(a / N[(N[Sqrt[b ^ 2 + N[(N[Sqrt[N[(a * -4.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[c], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], If[LessEqual[t$95$4, -4e-297], t$95$4, If[LessEqual[t$95$4, 0.0], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[(-4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[t$95$0], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], If[LessEqual[t$95$4, 4e+263], t$95$4, If[GreaterEqual[b, 0.0], t$95$3, N[(t$95$1 / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\


\end{array}
\begin{array}{l}
t_0 := c \cdot \left(a \cdot -4\right)\\
t_1 := \left(-b\right) - b\\
t_2 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\
t_3 := \frac{2 \cdot c}{\left(-b\right) - t_2}\\
t_4 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;\frac{t_2 - b}{2 \cdot a}\\


\end{array}\\
\mathbf{if}\;t_4 \leq -4 \cdot 10^{+222}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, t_0\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{a}{\mathsf{hypot}\left(b, \sqrt{a \cdot -4} \cdot \sqrt{c}\right) - b}}\\


\end{array}\\

\mathbf{elif}\;t_4 \leq -4 \cdot 10^{-297}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{t_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{-4 \cdot \left(c \cdot a\right)}{\sqrt{t_0} - b}}{2 \cdot a}\\


\end{array}\\

\mathbf{elif}\;t_4 \leq 4 \cdot 10^{+263}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;\frac{t_1}{2 \cdot a}\\


\end{array}

Error

Derivation

  1. Split input into 4 regimes
  2. if (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -4.0000000000000002e222

    1. Initial program 48.4

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Simplified48.3

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b\right) \cdot \frac{0.5}{a}\\ } \end{array}} \]
      Proof
      (if (>=.f64 b 0) (*.f64 c (/.f64 -2 (+.f64 b (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (Rewrite<= metadata-eval (/.f64 2 -1)) (+.f64 b (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (+.f64 b (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a (Rewrite<= metadata-eval (neg.f64 4))))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (+.f64 b (sqrt.f64 (fma.f64 b b (*.f64 c (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a 4))))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (+.f64 b (sqrt.f64 (fma.f64 b b (*.f64 c (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 4 a))))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (+.f64 b (sqrt.f64 (fma.f64 b b (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 (*.f64 4 a)) c))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 37 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (+.f64 b (sqrt.f64 (fma.f64 b b (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (+.f64 b (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (+.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 1 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (neg.f64 (Rewrite<= distribute-neg-out_binary64 (+.f64 (neg.f64 b) (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 2 -1) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (Rewrite=> associate-/r*_binary64 (/.f64 (/.f64 (/.f64 2 -1) -1) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (/.f64 (Rewrite=> metadata-eval -2) -1) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 (Rewrite=> metadata-eval 2) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 2 (Rewrite=> sub-neg_binary64 (+.f64 (neg.f64 b) (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 2 (Rewrite=> distribute-neg-out_binary64 (neg.f64 (+.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 2 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (+.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (Rewrite=> associate-/r*_binary64 (/.f64 (/.f64 2 -1) (+.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (Rewrite<= associate-/r*_binary64 (/.f64 2 (*.f64 -1 (+.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 2 (Rewrite<= neg-mul-1_binary64 (neg.f64 (+.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 2 (Rewrite<= distribute-neg-out_binary64 (+.f64 (neg.f64 b) (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 6 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (*.f64 c (/.f64 2 (Rewrite<= sub-neg_binary64 (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 c 2) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 2 c)) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a -4)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (*.f64 a (Rewrite<= metadata-eval (neg.f64 4)))))) b) (/.f64 1/2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a 4)))))) b) (/.f64 1/2 a))): 1 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 c (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 4 a)))))) b) (/.f64 1/2 a))): 42 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 (*.f64 4 a)) c)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 (*.f64 4 a) c))))) b) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (-.f64 (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) b) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))) (neg.f64 b))) (/.f64 1/2 a))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 1/2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (Rewrite<= metadata-eval (/.f64 1 2)) a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (/.f64 (Rewrite<= metadata-eval (neg.f64 -1)) 2) a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (Rewrite<= associate-/r*_binary64 (/.f64 (neg.f64 -1) (*.f64 2 a))))): 23 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (Rewrite=> *-commutative_binary64 (*.f64 (/.f64 (neg.f64 -1) (*.f64 2 a)) (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (Rewrite<= associate-/r/_binary64 (/.f64 (neg.f64 -1) (/.f64 (*.f64 2 a) (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (neg.f64 -1) (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (*.f64 2 a)))): 43 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (Rewrite=> *-commutative_binary64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (neg.f64 -1))) (*.f64 2 a))): 0 points increase in error, 43 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (Rewrite=> associate-/l*_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (*.f64 2 a) (neg.f64 -1))))): 23 points increase in error, 6 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (*.f64 2 a) (Rewrite=> metadata-eval 1)))): 0 points increase in error, 23 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (Rewrite=> /-rgt-identity_binary64 (*.f64 2 a)))): 43 points increase in error, 0 points decrease in error
    3. Applied egg-rr35.7

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{a}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right) - b}}\\ \end{array} \]
    4. Applied egg-rr22.0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{a}{\mathsf{hypot}\left(b, \sqrt{a \cdot -4} \cdot \sqrt{c}\right) - b}}\\ \end{array} \]

    if -4.0000000000000002e222 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -4.00000000000000016e-297 or -0.0 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < 4.00000000000000006e263

    1. Initial program 2.5

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]

    if -4.00000000000000016e-297 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))) < -0.0

    1. Initial program 37.0

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Taylor expanded in b around inf 9.7

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    3. Taylor expanded in b around 0 9.7

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{-4 \cdot \left(c \cdot a\right)}}{2 \cdot a}\\ \end{array} \]
    4. Simplified9.7

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{c \cdot \left(-4 \cdot a\right)}}{2 \cdot a}\\ \end{array} \]
      Proof
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (*.f64 c (*.f64 -4 a)))) (*.f64 2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (*.f64 c (Rewrite<= *-commutative_binary64 (*.f64 a -4))))) (*.f64 2 a))): 0 points increase in error, 6 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 a -4) c)))) (*.f64 2 a))): 6 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (*.f64 (Rewrite=> *-commutative_binary64 (*.f64 -4 a)) c))) (*.f64 2 a))): 0 points increase in error, 6 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -4 (*.f64 a c))))) (*.f64 2 a))): 0 points increase in error, 6 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (*.f64 -4 (Rewrite<= *-commutative_binary64 (*.f64 c a))))) (*.f64 2 a))): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr9.7

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b \cdot b}{b - \sqrt{c \cdot \left(-4 \cdot a\right)}} - \frac{c \cdot \left(-4 \cdot a\right)}{b - \sqrt{c \cdot \left(-4 \cdot a\right)}}}{2 \cdot a}\\ \end{array} \]
    6. Simplified9.7

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot \left(a \cdot -4\right) - b \cdot b}{\sqrt{c \cdot \left(a \cdot -4\right)} - b}}{2 \cdot a}\\ \end{array} \]
      Proof
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (*.f64 a -4)) (*.f64 b b)) (-.f64 (sqrt.f64 (*.f64 c (*.f64 a -4))) b)) (*.f64 2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (Rewrite<= *-commutative_binary64 (*.f64 -4 a))) (*.f64 b b)) (-.f64 (sqrt.f64 (*.f64 c (*.f64 a -4))) b)) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (*.f64 -4 a)) (*.f64 b b)) (-.f64 (sqrt.f64 (*.f64 c (Rewrite<= *-commutative_binary64 (*.f64 -4 a)))) b)) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (*.f64 -4 a)) (*.f64 b b)) (Rewrite=> sub-neg_binary64 (+.f64 (sqrt.f64 (*.f64 c (*.f64 -4 a))) (neg.f64 b)))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (*.f64 -4 a)) (*.f64 b b)) (+.f64 (sqrt.f64 (*.f64 c (*.f64 -4 a))) (Rewrite<= sub0-neg_binary64 (-.f64 0 b)))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (*.f64 -4 a)) (*.f64 b b)) (Rewrite<= +-commutative_binary64 (+.f64 (-.f64 0 b) (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (*.f64 -4 a)) (*.f64 b b)) (Rewrite<= associate--r-_binary64 (-.f64 0 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a))))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (-.f64 (*.f64 c (*.f64 -4 a)) (*.f64 b b)) (Rewrite=> sub0-neg_binary64 (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a))))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (Rewrite=> sub-neg_binary64 (+.f64 (*.f64 c (*.f64 -4 a)) (neg.f64 (*.f64 b b)))) (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 (*.f64 b b)) (*.f64 c (*.f64 -4 a)))) (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 b b))) (*.f64 c (*.f64 -4 a))) (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 7 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (Rewrite<= associate--r-_binary64 (-.f64 0 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a))))) (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a))))) (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (neg.f64 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a)))))) (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (Rewrite=> associate-/l*_binary64 (/.f64 1 (/.f64 (neg.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a))))) (neg.f64 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a))))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 1 (/.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (neg.f64 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 1 (/.f64 (*.f64 -1 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a))))) (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a))))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 1 (Rewrite=> times-frac_binary64 (*.f64 (/.f64 -1 -1) (/.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))) (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a))))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 1 (*.f64 (Rewrite=> metadata-eval 1) (/.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))) (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (Rewrite=> associate-/r*_binary64 (/.f64 (/.f64 1 1) (/.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))) (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (Rewrite=> metadata-eval 1) (/.f64 (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))) (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 1 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a)))) (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a)))))) (*.f64 2 a))): 0 points increase in error, 24 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (/.f64 (Rewrite=> *-lft-identity_binary64 (-.f64 (*.f64 b b) (*.f64 c (*.f64 -4 a)))) (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a))))) (*.f64 2 a))): 0 points increase in error, 0 points decrease in error
      (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) b)) (/.f64 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (*.f64 b b) (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a))))) (/.f64 (*.f64 c (*.f64 -4 a)) (-.f64 b (sqrt.f64 (*.f64 c (*.f64 -4 a))))))) (*.f64 2 a))): 24 points increase in error, 0 points decrease in error
    7. Taylor expanded in c around inf 9.7

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-4 \cdot \left(c \cdot a\right)}{\sqrt{c \cdot \left(a \cdot -4\right)} - b}}{2 \cdot a}\\ \end{array} \]

    if 4.00000000000000006e263 < (if (>=.f64 b 0) (/.f64 (*.f64 2 c) (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)))

    1. Initial program 58.2

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Taylor expanded in b around -inf 19.0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + -1 \cdot b}{2 \cdot a}\\ \end{array} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification7.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array} \leq -4 \cdot 10^{+222}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{a}{\mathsf{hypot}\left(b, \sqrt{a \cdot -4} \cdot \sqrt{c}\right) - b}}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array} \leq -4 \cdot 10^{-297}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array} \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-4 \cdot \left(c \cdot a\right)}{\sqrt{c \cdot \left(a \cdot -4\right)} - b}}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array} \leq 4 \cdot 10^{+263}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]

Alternatives

Alternative 1
Error6.6
Cost38052
\[\begin{array}{l} t_0 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\ t_1 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ \mathbf{elif}\;t_1 \leq -4 \cdot 10^{-297}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{a}{b + \sqrt{c \cdot \left(a \cdot -4\right)}}}\\ \end{array}\\ \mathbf{elif}\;t_1 \leq 10^{+282}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;c \cdot \left(\left(b \cdot b\right) \cdot 4\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot -2\right) \cdot \frac{0.5}{a}\\ \end{array} \]
Alternative 2
Error6.6
Cost38052
\[\begin{array}{l} t_0 := \left(-b\right) - b\\ t_1 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\ t_2 := \frac{2 \cdot c}{\left(-b\right) - t_1}\\ t_3 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq -4 \cdot 10^{-297}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{\frac{a}{b + \sqrt{c \cdot \left(a \cdot -4\right)}}}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq 4 \cdot 10^{+263}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{2 \cdot a}\\ \end{array} \]
Alternative 3
Error6.6
Cost38052
\[\begin{array}{l} t_0 := \left(-b\right) - b\\ t_1 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\ t_2 := \frac{2 \cdot c}{\left(-b\right) - t_1}\\ t_3 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq -4 \cdot 10^{-297}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-4 \cdot \left(c \cdot a\right)}{\sqrt{c \cdot \left(a \cdot -4\right)} - b}}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq 4 \cdot 10^{+263}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{2 \cdot a}\\ \end{array} \]
Alternative 4
Error14.3
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{+152}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array} \]
Alternative 5
Error17.6
Cost7368
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{if}\;b \leq -4.8 \cdot 10^{-89}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -4\right)}\right) \cdot \frac{-0.5}{a}\\ \end{array} \]
Alternative 6
Error17.6
Cost7368
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{if}\;b \leq -4.4 \cdot 10^{-89}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \]
Alternative 7
Error22.5
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 8
Error45.6
Cost580
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \left(\left(b \cdot b\right) \cdot 4\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot -2\right) \cdot \frac{0.5}{a}\\ \end{array} \]
Alternative 9
Error22.7
Cost580
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot -2\right) \cdot \frac{0.5}{a}\\ \end{array} \]
Alternative 10
Error22.7
Cost580
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{-b}}\\ \end{array} \]
Alternative 11
Error22.6
Cost580
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 12
Error22.6
Cost580
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\frac{c \cdot -2}{2}}{b}\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot -2\right) \cdot \frac{0.5}{a}\\ \end{array} \]

Error

Reproduce

herbie shell --seed 2022341 
(FPCore (a b c)
  :name "jeff quadratic root 2"
  :precision binary64
  (if (>= b 0.0) (/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c))))) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))