?

Average Accuracy: 63.4% → 81.4%
Time: 24.1s
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 := \frac{2 \cdot c}{\left(-b\right) - b}\\ t_1 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{b \cdot -2}{2 \cdot a}\\ \end{array}\\ t_2 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\ t_3 := \frac{t_2 - b}{2 \cdot a}\\ t_4 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t_2}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_4 \leq -1 \cdot 10^{-192}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_4 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array}\\ \mathbf{elif}\;t_4 \leq 5 \cdot 10^{+222}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (/ (* 2.0 c) (- (- b) b)))
        (t_1 (if (>= b 0.0) t_0 (/ (* b -2.0) (* 2.0 a))))
        (t_2 (sqrt (- (* b b) (* c (* 4.0 a)))))
        (t_3 (/ (- t_2 b) (* 2.0 a)))
        (t_4 (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_2)) t_3)))
   (if (<= t_4 (- INFINITY))
     t_1
     (if (<= t_4 -1e-192)
       t_4
       (if (<= t_4 0.0)
         (if (>= b 0.0) t_0 t_3)
         (if (<= t_4 5e+222) t_4 t_1))))))
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 = (2.0 * c) / (-b - b);
	double tmp;
	if (b >= 0.0) {
		tmp = t_0;
	} else {
		tmp = (b * -2.0) / (2.0 * a);
	}
	double t_1 = tmp;
	double t_2 = sqrt(((b * b) - (c * (4.0 * a))));
	double t_3 = (t_2 - b) / (2.0 * a);
	double tmp_1;
	if (b >= 0.0) {
		tmp_1 = (2.0 * c) / (-b - t_2);
	} else {
		tmp_1 = t_3;
	}
	double t_4 = tmp_1;
	double tmp_2;
	if (t_4 <= -((double) INFINITY)) {
		tmp_2 = t_1;
	} else if (t_4 <= -1e-192) {
		tmp_2 = t_4;
	} else if (t_4 <= 0.0) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = t_0;
		} else {
			tmp_3 = t_3;
		}
		tmp_2 = tmp_3;
	} else if (t_4 <= 5e+222) {
		tmp_2 = t_4;
	} else {
		tmp_2 = t_1;
	}
	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 t_0 = (2.0 * c) / (-b - b);
	double tmp;
	if (b >= 0.0) {
		tmp = t_0;
	} else {
		tmp = (b * -2.0) / (2.0 * a);
	}
	double t_1 = tmp;
	double t_2 = Math.sqrt(((b * b) - (c * (4.0 * a))));
	double t_3 = (t_2 - b) / (2.0 * a);
	double tmp_1;
	if (b >= 0.0) {
		tmp_1 = (2.0 * c) / (-b - t_2);
	} else {
		tmp_1 = t_3;
	}
	double t_4 = tmp_1;
	double tmp_2;
	if (t_4 <= -Double.POSITIVE_INFINITY) {
		tmp_2 = t_1;
	} else if (t_4 <= -1e-192) {
		tmp_2 = t_4;
	} else if (t_4 <= 0.0) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = t_0;
		} else {
			tmp_3 = t_3;
		}
		tmp_2 = tmp_3;
	} else if (t_4 <= 5e+222) {
		tmp_2 = t_4;
	} else {
		tmp_2 = t_1;
	}
	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):
	t_0 = (2.0 * c) / (-b - b)
	tmp = 0
	if b >= 0.0:
		tmp = t_0
	else:
		tmp = (b * -2.0) / (2.0 * a)
	t_1 = tmp
	t_2 = math.sqrt(((b * b) - (c * (4.0 * a))))
	t_3 = (t_2 - b) / (2.0 * a)
	tmp_1 = 0
	if b >= 0.0:
		tmp_1 = (2.0 * c) / (-b - t_2)
	else:
		tmp_1 = t_3
	t_4 = tmp_1
	tmp_2 = 0
	if t_4 <= -math.inf:
		tmp_2 = t_1
	elif t_4 <= -1e-192:
		tmp_2 = t_4
	elif t_4 <= 0.0:
		tmp_3 = 0
		if b >= 0.0:
			tmp_3 = t_0
		else:
			tmp_3 = t_3
		tmp_2 = tmp_3
	elif t_4 <= 5e+222:
		tmp_2 = t_4
	else:
		tmp_2 = t_1
	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(Float64(2.0 * c) / Float64(Float64(-b) - b))
	tmp = 0.0
	if (b >= 0.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(b * -2.0) / Float64(2.0 * a));
	end
	t_1 = tmp
	t_2 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(4.0 * a))))
	t_3 = Float64(Float64(t_2 - b) / Float64(2.0 * a))
	tmp_1 = 0.0
	if (b >= 0.0)
		tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_2));
	else
		tmp_1 = t_3;
	end
	t_4 = tmp_1
	tmp_2 = 0.0
	if (t_4 <= Float64(-Inf))
		tmp_2 = t_1;
	elseif (t_4 <= -1e-192)
		tmp_2 = t_4;
	elseif (t_4 <= 0.0)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = t_0;
		else
			tmp_3 = t_3;
		end
		tmp_2 = tmp_3;
	elseif (t_4 <= 5e+222)
		tmp_2 = t_4;
	else
		tmp_2 = t_1;
	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)
	t_0 = (2.0 * c) / (-b - b);
	tmp = 0.0;
	if (b >= 0.0)
		tmp = t_0;
	else
		tmp = (b * -2.0) / (2.0 * a);
	end
	t_1 = tmp;
	t_2 = sqrt(((b * b) - (c * (4.0 * a))));
	t_3 = (t_2 - b) / (2.0 * a);
	tmp_2 = 0.0;
	if (b >= 0.0)
		tmp_2 = (2.0 * c) / (-b - t_2);
	else
		tmp_2 = t_3;
	end
	t_4 = tmp_2;
	tmp_3 = 0.0;
	if (t_4 <= -Inf)
		tmp_3 = t_1;
	elseif (t_4 <= -1e-192)
		tmp_3 = t_4;
	elseif (t_4 <= 0.0)
		tmp_4 = 0.0;
		if (b >= 0.0)
			tmp_4 = t_0;
		else
			tmp_4 = t_3;
		end
		tmp_3 = tmp_4;
	elseif (t_4 <= 5e+222)
		tmp_3 = t_4;
	else
		tmp_3 = t_1;
	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 = N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = If[GreaterEqual[b, 0.0], t$95$0, N[(N[(b * -2.0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $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[(t$95$2 - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$2), $MachinePrecision]), $MachinePrecision], t$95$3]}, If[LessEqual[t$95$4, (-Infinity)], t$95$1, If[LessEqual[t$95$4, -1e-192], t$95$4, If[LessEqual[t$95$4, 0.0], If[GreaterEqual[b, 0.0], t$95$0, t$95$3], If[LessEqual[t$95$4, 5e+222], t$95$4, t$95$1]]]]]]]]]
\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 := \frac{2 \cdot c}{\left(-b\right) - b}\\
t_1 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t_0\\

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


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

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}\\

\mathbf{elif}\;t_4 \leq 5 \cdot 10^{+222}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\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.00000000000000023e222 < (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 8.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 9.8%

      \[\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 -inf 46.9%

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

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

      [Start]46.9

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

      *-commutative [=>]46.9

      \[ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b \cdot -2}{2 \cdot 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.00000000000000023e222

    1. Initial program 98.1%

      \[\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 -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 49.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 86.8%

      \[\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. Recombined 3 regimes into one program.
  4. Final simplification83.3%

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

Alternatives

Alternative 1
Accuracy82.5%
Cost7952
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ t_1 := \sqrt{b \cdot b - c \cdot \left(4 \cdot a\right)}\\ \mathbf{if}\;b \leq -5 \cdot 10^{+149}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1 - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{+95}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot \frac{c \cdot a}{b}}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 2
Accuracy70.4%
Cost7624
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{if}\;b \leq -2 \cdot 10^{+148}:\\ \;\;\;\;\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{b \cdot b - c \cdot \left(4 \cdot a\right)} - b}{2 \cdot a}\\ \end{array} \]
Alternative 3
Accuracy59.5%
Cost1220
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\frac{-1}{\frac{\frac{b}{a}}{c \cdot -2}} - b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 4
Accuracy59.1%
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 5
Accuracy59.1%
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b \cdot -2}{2 \cdot a}\\ \end{array} \]

Error

Reproduce?

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