?

Average Error: 19.4 → 6.7
Time: 17.5s
Precision: binary64
Cost: 38052

?

\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
\[\begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ t_1 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + t_0}\\ \end{array}\\ t_2 := \frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-a}\\ \end{array}\\ \mathbf{elif}\;t_1 \leq -1 \cdot 10^{-253}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(\left(-b\right) + a \cdot \left(\frac{c}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+295}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (>= b 0.0)
   (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))
   (/ (* 2.0 c) (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))))
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c))))
        (t_1
         (if (>= b 0.0)
           (/ (- (- b) t_0) (* 2.0 a))
           (/ (* 2.0 c) (+ (- b) t_0))))
        (t_2 (/ (- (- b) b) (* 2.0 a))))
   (if (<= t_1 (- INFINITY))
     (if (>= b 0.0) t_2 (/ b (- a)))
     (if (<= t_1 -1e-253)
       t_1
       (if (<= t_1 0.0)
         (if (>= b 0.0)
           (/ (- (- b) (+ (- b) (* c (* (/ a b) 2.0)))) (* 2.0 a))
           (/ (* 2.0 c) (+ (- b) (+ (- b) (* a (* (/ c b) 2.0))))))
         (if (<= t_1 2e+295) t_1 (if (>= b 0.0) t_2 (/ c (- b)))))))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c))));
	}
	return tmp;
}
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (-b - t_0) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + t_0);
	}
	double t_1 = tmp;
	double t_2 = (-b - b) / (2.0 * a);
	double tmp_2;
	if (t_1 <= -((double) INFINITY)) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = t_2;
		} else {
			tmp_3 = b / -a;
		}
		tmp_2 = tmp_3;
	} else if (t_1 <= -1e-253) {
		tmp_2 = t_1;
	} else if (t_1 <= 0.0) {
		double tmp_4;
		if (b >= 0.0) {
			tmp_4 = (-b - (-b + (c * ((a / b) * 2.0)))) / (2.0 * a);
		} else {
			tmp_4 = (2.0 * c) / (-b + (-b + (a * ((c / b) * 2.0))));
		}
		tmp_2 = tmp_4;
	} else if (t_1 <= 2e+295) {
		tmp_2 = t_1;
	} else if (b >= 0.0) {
		tmp_2 = t_2;
	} else {
		tmp_2 = c / -b;
	}
	return tmp_2;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (-b - Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + Math.sqrt(((b * b) - ((4.0 * a) * c))));
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (-b - t_0) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + t_0);
	}
	double t_1 = tmp;
	double t_2 = (-b - b) / (2.0 * a);
	double tmp_2;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = t_2;
		} else {
			tmp_3 = b / -a;
		}
		tmp_2 = tmp_3;
	} else if (t_1 <= -1e-253) {
		tmp_2 = t_1;
	} else if (t_1 <= 0.0) {
		double tmp_4;
		if (b >= 0.0) {
			tmp_4 = (-b - (-b + (c * ((a / b) * 2.0)))) / (2.0 * a);
		} else {
			tmp_4 = (2.0 * c) / (-b + (-b + (a * ((c / b) * 2.0))));
		}
		tmp_2 = tmp_4;
	} else if (t_1 <= 2e+295) {
		tmp_2 = t_1;
	} else if (b >= 0.0) {
		tmp_2 = t_2;
	} else {
		tmp_2 = c / -b;
	}
	return tmp_2;
}
def code(a, b, c):
	tmp = 0
	if b >= 0.0:
		tmp = (-b - math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
	else:
		tmp = (2.0 * c) / (-b + math.sqrt(((b * b) - ((4.0 * a) * c))))
	return tmp
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b >= 0.0:
		tmp = (-b - t_0) / (2.0 * a)
	else:
		tmp = (2.0 * c) / (-b + t_0)
	t_1 = tmp
	t_2 = (-b - b) / (2.0 * a)
	tmp_2 = 0
	if t_1 <= -math.inf:
		tmp_3 = 0
		if b >= 0.0:
			tmp_3 = t_2
		else:
			tmp_3 = b / -a
		tmp_2 = tmp_3
	elif t_1 <= -1e-253:
		tmp_2 = t_1
	elif t_1 <= 0.0:
		tmp_4 = 0
		if b >= 0.0:
			tmp_4 = (-b - (-b + (c * ((a / b) * 2.0)))) / (2.0 * a)
		else:
			tmp_4 = (2.0 * c) / (-b + (-b + (a * ((c / b) * 2.0))))
		tmp_2 = tmp_4
	elif t_1 <= 2e+295:
		tmp_2 = t_1
	elif b >= 0.0:
		tmp_2 = t_2
	else:
		tmp_2 = c / -b
	return tmp_2
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a));
	else
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
	end
	return tmp
end
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a));
	else
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) + t_0));
	end
	t_1 = tmp
	t_2 = Float64(Float64(Float64(-b) - b) / Float64(2.0 * a))
	tmp_2 = 0.0
	if (t_1 <= Float64(-Inf))
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = t_2;
		else
			tmp_3 = Float64(b / Float64(-a));
		end
		tmp_2 = tmp_3;
	elseif (t_1 <= -1e-253)
		tmp_2 = t_1;
	elseif (t_1 <= 0.0)
		tmp_4 = 0.0
		if (b >= 0.0)
			tmp_4 = Float64(Float64(Float64(-b) - Float64(Float64(-b) + Float64(c * Float64(Float64(a / b) * 2.0)))) / Float64(2.0 * a));
		else
			tmp_4 = Float64(Float64(2.0 * c) / Float64(Float64(-b) + Float64(Float64(-b) + Float64(a * Float64(Float64(c / b) * 2.0)))));
		end
		tmp_2 = tmp_4;
	elseif (t_1 <= 2e+295)
		tmp_2 = t_1;
	elseif (b >= 0.0)
		tmp_2 = t_2;
	else
		tmp_2 = Float64(c / Float64(-b));
	end
	return tmp_2
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b >= 0.0)
		tmp = (-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
	else
		tmp = (2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c))));
	end
	tmp_2 = tmp;
end
function tmp_6 = code(a, b, c)
	t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	tmp = 0.0;
	if (b >= 0.0)
		tmp = (-b - t_0) / (2.0 * a);
	else
		tmp = (2.0 * c) / (-b + t_0);
	end
	t_1 = tmp;
	t_2 = (-b - b) / (2.0 * a);
	tmp_3 = 0.0;
	if (t_1 <= -Inf)
		tmp_4 = 0.0;
		if (b >= 0.0)
			tmp_4 = t_2;
		else
			tmp_4 = b / -a;
		end
		tmp_3 = tmp_4;
	elseif (t_1 <= -1e-253)
		tmp_3 = t_1;
	elseif (t_1 <= 0.0)
		tmp_5 = 0.0;
		if (b >= 0.0)
			tmp_5 = (-b - (-b + (c * ((a / b) * 2.0)))) / (2.0 * a);
		else
			tmp_5 = (2.0 * c) / (-b + (-b + (a * ((c / b) * 2.0))));
		end
		tmp_3 = tmp_5;
	elseif (t_1 <= 2e+295)
		tmp_3 = t_1;
	elseif (b >= 0.0)
		tmp_3 = t_2;
	else
		tmp_3 = c / -b;
	end
	tmp_6 = tmp_3;
end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], 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], 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]]
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = If[GreaterEqual[b, 0.0], N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) + t$95$0), $MachinePrecision]), $MachinePrecision]]}, Block[{t$95$2 = N[(N[((-b) - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], If[GreaterEqual[b, 0.0], t$95$2, N[(b / (-a)), $MachinePrecision]], If[LessEqual[t$95$1, -1e-253], t$95$1, If[LessEqual[t$95$1, 0.0], If[GreaterEqual[b, 0.0], N[(N[((-b) - N[((-b) + N[(c * N[(N[(a / b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) + N[((-b) + N[(a * N[(N[(c / b), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], If[LessEqual[t$95$1, 2e+295], t$95$1, If[GreaterEqual[b, 0.0], t$95$2, N[(c / (-b)), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\

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


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

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


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

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


\end{array}\\

\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-253}:\\
\;\;\;\;t_1\\

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

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


\end{array}\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+295}:\\
\;\;\;\;t_1\\

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

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

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

    1. Initial program 64.0

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

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

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

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

      [Start]19.7

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

      rational.json-simplify-2 [=>]19.7

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

      rational.json-simplify-9 [=>]19.7

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

      rational.json-simplify-10 [=>]19.7

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

      rational.json-simplify-47 [=>]19.7

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

      rational.json-simplify-9 [=>]19.7

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

    if -inf.0 < (if (>=.f64 b 0) (/.f64 (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) (/.f64 (*.f64 2 c) (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))) < -1.0000000000000001e-253 or -0.0 < (if (>=.f64 b 0) (/.f64 (-.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) (/.f64 (*.f64 2 c) (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))))) < 2e295

    1. Initial program 2.4

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

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

    1. Initial program 35.7

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

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

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

      [Start]12.2

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

      rational.json-simplify-1 [=>]12.2

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

      rational.json-simplify-2 [=>]12.2

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

      rational.json-simplify-8 [<=]12.2

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

      rational.json-simplify-49 [=>]10.5

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

      rational.json-simplify-43 [=>]10.5

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

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

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

      [Start]11.1

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

      rational.json-simplify-1 [=>]11.1

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

      rational.json-simplify-2 [=>]11.1

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

      rational.json-simplify-8 [<=]11.1

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

      rational.json-simplify-2 [<=]11.1

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

      rational.json-simplify-49 [=>]11.1

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

      rational.json-simplify-43 [=>]11.1

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

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

    1. Initial program 62.4

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

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

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

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

      [Start]15.0

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

      rational.json-simplify-2 [=>]15.0

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

      rational.json-simplify-9 [=>]15.0

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

      rational.json-simplify-10 [=>]15.0

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

      rational.json-simplify-47 [=>]15.0

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

      rational.json-simplify-8 [<=]15.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-a}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \leq -1 \cdot 10^{-253}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(\left(-b\right) + a \cdot \left(\frac{c}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \leq 2 \cdot 10^{+295}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]

Alternatives

Alternative 1
Error6.6
Cost7952
\[\begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(\left(-b\right) + a \cdot \left(\frac{c}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + t_0}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{+87}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-1 + \left(1 - \frac{c \cdot -2}{2 \cdot \left(\left(-b\right) + c \cdot \frac{a}{b}\right)}\right)\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \end{array} \]
Alternative 2
Error10.0
Cost7888
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \mathbf{if}\;b \leq -1.05 \cdot 10^{-81}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(\left(-b\right) + a \cdot \left(\frac{c}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\sqrt{c \cdot \left(a \cdot -4\right)} + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 2.05 \cdot 10^{+93}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\right) \cdot \frac{-0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error10.0
Cost7888
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \mathbf{if}\;b \leq -5.6 \cdot 10^{-83}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(\left(-b\right) + a \cdot \left(\frac{c}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\sqrt{c \cdot \left(a \cdot -4\right)} + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+91}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{\frac{a}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error6.6
Cost7888
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \mathbf{if}\;b \leq -8 \cdot 10^{+153}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(\left(-b\right) + a \cdot \left(\frac{c}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+93}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{\frac{a}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error13.2
Cost7632
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ t_1 := \sqrt{c \cdot \left(a \cdot -4\right)}\\ \mathbf{if}\;b \leq -5.5 \cdot 10^{-82}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(\left(-b\right) + a \cdot \left(\frac{c}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{t_1 + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-79}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(t_1 + b\right) \cdot \frac{-0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error17.9
Cost7368
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \mathbf{if}\;b \leq 1.5 \cdot 10^{-78}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\sqrt{c \cdot \left(a \cdot -4\right)} + b\right) \cdot \frac{-0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error18.2
Cost7304
\[\begin{array}{l} \mathbf{if}\;b \leq 5.2 \cdot 10^{-75}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-\sqrt{c \cdot \left(a \cdot -4\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-1}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \end{array} \]
Alternative 8
Error18.0
Cost7304
\[\begin{array}{l} \mathbf{if}\;b \leq 4.8 \cdot 10^{-81}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-\sqrt{c \cdot \left(a \cdot -4\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(-b\right) + \left(\left(-b\right) + c \cdot \left(\frac{a}{b} \cdot 2\right)\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \end{array} \]
Alternative 9
Error21.7
Cost7112
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \mathbf{if}\;b \leq 1.4 \cdot 10^{-201}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \sqrt{\frac{c}{a} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error23.0
Cost772
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + -1 \cdot b}\\ \end{array} \]
Alternative 11
Error45.4
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-a}\\ \end{array} \]
Alternative 12
Error22.9
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]

Error

Reproduce?

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