?

Average Error: 19.9 → 8.2
Time: 22.7s
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 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array}\\ t_1 := \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\\ t_2 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-192}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot a\right) \cdot \frac{c}{b} - \left(b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+251}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \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 (if (>= b 0.0) (/ b a) (/ (- b) a)))
        (t_1 (sqrt (+ (* b b) (* c (* a -4.0)))))
        (t_2
         (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_1)) (/ (- t_1 b) (* 2.0 a)))))
   (if (<= t_2 (- INFINITY))
     t_0
     (if (<= t_2 -1e-192)
       t_2
       (if (<= t_2 0.0)
         (if (>= b 0.0)
           (/ (* 2.0 c) (- (* (* 2.0 a) (/ c b)) (+ b b)))
           (/ (/ (* c -2.0) (/ b a)) (* 2.0 a)))
         (if (<= t_2 5e+251) t_2 t_0))))))
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 tmp;
	if (b >= 0.0) {
		tmp = b / a;
	} else {
		tmp = -b / a;
	}
	double t_0 = tmp;
	double t_1 = sqrt(((b * b) + (c * (a * -4.0))));
	double tmp_1;
	if (b >= 0.0) {
		tmp_1 = (2.0 * c) / (-b - t_1);
	} else {
		tmp_1 = (t_1 - b) / (2.0 * a);
	}
	double t_2 = tmp_1;
	double tmp_2;
	if (t_2 <= -((double) INFINITY)) {
		tmp_2 = t_0;
	} else if (t_2 <= -1e-192) {
		tmp_2 = t_2;
	} else if (t_2 <= 0.0) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = (2.0 * c) / (((2.0 * a) * (c / b)) - (b + b));
		} else {
			tmp_3 = ((c * -2.0) / (b / a)) / (2.0 * a);
		}
		tmp_2 = tmp_3;
	} else if (t_2 <= 5e+251) {
		tmp_2 = t_2;
	} else {
		tmp_2 = t_0;
	}
	return tmp_2;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - Math.sqrt(((b * b) - ((4.0 * a) * c))));
	} else {
		tmp = (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = b / a;
	} else {
		tmp = -b / a;
	}
	double t_0 = tmp;
	double t_1 = Math.sqrt(((b * b) + (c * (a * -4.0))));
	double tmp_1;
	if (b >= 0.0) {
		tmp_1 = (2.0 * c) / (-b - t_1);
	} else {
		tmp_1 = (t_1 - b) / (2.0 * a);
	}
	double t_2 = tmp_1;
	double tmp_2;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp_2 = t_0;
	} else if (t_2 <= -1e-192) {
		tmp_2 = t_2;
	} else if (t_2 <= 0.0) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = (2.0 * c) / (((2.0 * a) * (c / b)) - (b + b));
		} else {
			tmp_3 = ((c * -2.0) / (b / a)) / (2.0 * a);
		}
		tmp_2 = tmp_3;
	} else if (t_2 <= 5e+251) {
		tmp_2 = t_2;
	} else {
		tmp_2 = t_0;
	}
	return tmp_2;
}
def code(a, b, c):
	tmp = 0
	if b >= 0.0:
		tmp = (2.0 * c) / (-b - math.sqrt(((b * b) - ((4.0 * a) * c))))
	else:
		tmp = (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
	return tmp
def code(a, b, c):
	tmp = 0
	if b >= 0.0:
		tmp = b / a
	else:
		tmp = -b / a
	t_0 = tmp
	t_1 = math.sqrt(((b * b) + (c * (a * -4.0))))
	tmp_1 = 0
	if b >= 0.0:
		tmp_1 = (2.0 * c) / (-b - t_1)
	else:
		tmp_1 = (t_1 - b) / (2.0 * a)
	t_2 = tmp_1
	tmp_2 = 0
	if t_2 <= -math.inf:
		tmp_2 = t_0
	elif t_2 <= -1e-192:
		tmp_2 = t_2
	elif t_2 <= 0.0:
		tmp_3 = 0
		if b >= 0.0:
			tmp_3 = (2.0 * c) / (((2.0 * a) * (c / b)) - (b + b))
		else:
			tmp_3 = ((c * -2.0) / (b / a)) / (2.0 * a)
		tmp_2 = tmp_3
	elif t_2 <= 5e+251:
		tmp_2 = t_2
	else:
		tmp_2 = t_0
	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)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(b / a);
	else
		tmp = Float64(Float64(-b) / a);
	end
	t_0 = tmp
	t_1 = sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -4.0))))
	tmp_1 = 0.0
	if (b >= 0.0)
		tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_1));
	else
		tmp_1 = Float64(Float64(t_1 - b) / Float64(2.0 * a));
	end
	t_2 = tmp_1
	tmp_2 = 0.0
	if (t_2 <= Float64(-Inf))
		tmp_2 = t_0;
	elseif (t_2 <= -1e-192)
		tmp_2 = t_2;
	elseif (t_2 <= 0.0)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = Float64(Float64(2.0 * c) / Float64(Float64(Float64(2.0 * a) * Float64(c / b)) - Float64(b + b)));
		else
			tmp_3 = Float64(Float64(Float64(c * -2.0) / Float64(b / a)) / Float64(2.0 * a));
		end
		tmp_2 = tmp_3;
	elseif (t_2 <= 5e+251)
		tmp_2 = t_2;
	else
		tmp_2 = t_0;
	end
	return tmp_2
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	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);
	end
	tmp_2 = tmp;
end
function tmp_5 = code(a, b, c)
	tmp = 0.0;
	if (b >= 0.0)
		tmp = b / a;
	else
		tmp = -b / a;
	end
	t_0 = tmp;
	t_1 = sqrt(((b * b) + (c * (a * -4.0))));
	tmp_2 = 0.0;
	if (b >= 0.0)
		tmp_2 = (2.0 * c) / (-b - t_1);
	else
		tmp_2 = (t_1 - b) / (2.0 * a);
	end
	t_2 = tmp_2;
	tmp_3 = 0.0;
	if (t_2 <= -Inf)
		tmp_3 = t_0;
	elseif (t_2 <= -1e-192)
		tmp_3 = t_2;
	elseif (t_2 <= 0.0)
		tmp_4 = 0.0;
		if (b >= 0.0)
			tmp_4 = (2.0 * c) / (((2.0 * a) * (c / b)) - (b + b));
		else
			tmp_4 = ((c * -2.0) / (b / a)) / (2.0 * a);
		end
		tmp_3 = tmp_4;
	elseif (t_2 <= 5e+251)
		tmp_3 = t_2;
	else
		tmp_3 = t_0;
	end
	tmp_5 = tmp_3;
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 = If[GreaterEqual[b, 0.0], N[(b / a), $MachinePrecision], N[((-b) / a), $MachinePrecision]]}, Block[{t$95$1 = N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]}, If[LessEqual[t$95$2, (-Infinity)], t$95$0, If[LessEqual[t$95$2, -1e-192], t$95$2, If[LessEqual[t$95$2, 0.0], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(N[(N[(2.0 * a), $MachinePrecision] * N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(b + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c * -2.0), $MachinePrecision] / N[(b / a), $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], If[LessEqual[t$95$2, 5e+251], t$95$2, t$95$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}
\begin{array}{l}
t_0 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{b}{a}\\

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


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

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


\end{array}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_0\\

\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-192}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(2 \cdot a\right) \cdot \frac{c}{b} - \left(b + b\right)}\\

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


\end{array}\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+251}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 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))) < -inf.0 or 5.0000000000000005e251 < (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 59.3

      \[\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 59.8

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

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

      [Start]59.8

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

      *-commutative [=>]59.8

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

      associate-/l* [=>]57.4

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

      associate-*l/ [=>]57.4

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
    6. Simplified19.9

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
      Proof

      [Start]19.9

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]

      mul-1-neg [=>]19.9

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

      distribute-neg-frac [=>]19.9

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

    if -inf.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))) < -1.0000000000000001e-192 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))) < 5.0000000000000005e251

    1. Initial program 2.9

      \[\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. Applied egg-rr16.0

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

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

      [Start]16.0

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

      swap-sqr [=>]21.7

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \color{blue}{\left(c \cdot c\right) \cdot \left(\left(a \cdot -4\right) \cdot \left(a \cdot -4\right)\right)}}{b \cdot b - c \cdot \left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    4. Applied egg-rr2.9

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

    if -1.0000000000000001e-192 < (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 31.9

      \[\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 12.6

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

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

      [Start]12.6

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

      *-commutative [=>]12.6

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

      associate-/l* [=>]10.5

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

      associate-*l/ [=>]10.5

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

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

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

      [Start]12.4

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

      *-commutative [=>]12.4

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

      associate-/l* [=>]12.4

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

      associate-*l/ [=>]12.4

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(0 - e^{\mathsf{log1p}\left(b + \mathsf{fma}\left(c \cdot -2, \frac{a}{b}, b\right)\right)}\right) + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{2 \cdot a}\\ \end{array} \]
    7. Simplified12.4

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

      [Start]16.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(0 - e^{\mathsf{log1p}\left(b + \mathsf{fma}\left(c \cdot -2, \frac{a}{b}, b\right)\right)}\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{2 \cdot a}\\ \end{array} \]

      associate-+l- [=>]16.4

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{0 - \left(e^{\mathsf{log1p}\left(b + \mathsf{fma}\left(c \cdot -2, \frac{a}{b}, b\right)\right)} - 1\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{2 \cdot a}\\ \end{array} \]

      expm1-def [=>]15.1

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{0 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(b + \mathsf{fma}\left(c \cdot -2, \frac{a}{b}, b\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{2 \cdot a}\\ \end{array} \]

      expm1-log1p [=>]12.4

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

      +-commutative [<=]12.4

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

      fma-udef [=>]12.4

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

      associate-+r+ [<=]12.4

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

      associate--r+ [=>]12.4

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

      sub0-neg [=>]12.4

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

      distribute-lft-neg-in [=>]12.4

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

      associate-*r/ [=>]14.6

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

      *-commutative [=>]14.6

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

      distribute-lft-neg-in [=>]14.6

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

      metadata-eval [=>]14.6

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

      associate-*r* [<=]14.6

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

      associate-*r/ [<=]14.6

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

      *-commutative [=>]14.6

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

      associate-*l/ [<=]12.4

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

      associate-*l* [=>]12.4

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

      *-commutative [=>]12.4

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

    \[\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(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{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(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq -1 \cdot 10^{-192}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + 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(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(2 \cdot a\right) \cdot \frac{c}{b} - \left(b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{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(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \leq 5 \cdot 10^{+251}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternatives

Alternative 1
Error15.3
Cost7756
\[\begin{array}{l} \mathbf{if}\;b \leq -9.6 \cdot 10^{+88}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-198}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;2 \cdot \frac{1}{\frac{b + \mathsf{fma}\left(2 \cdot c, \frac{a}{b}, b\right)}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(c \cdot \left(2 \cdot \frac{a}{b}\right) - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{2 \cdot a}\\ \end{array} \]
Alternative 2
Error15.5
Cost7756
\[\begin{array}{l} \mathbf{if}\;b \leq -9.6 \cdot 10^{+88}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{-162}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(c \cdot \left(2 \cdot \frac{a}{b}\right) - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot -2}{\frac{b}{a}}}{2 \cdot a}\\ \end{array} \]
Alternative 3
Error15.4
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -9.6 \cdot 10^{+88}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \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(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \]
Alternative 4
Error18.5
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -2.6 \cdot 10^{-99}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{2 \cdot a}\\ \end{array} \]
Alternative 5
Error23.2
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 6
Error45.1
Cost580
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 7
Error45.1
Cost388
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Error

Reproduce?

herbie shell --seed 2023027 
(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))))