?

Average Error: 19.7 → 6.5
Time: 25.9s
Precision: binary64
Cost: 7820

?

\[\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{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array}\\ \mathbf{if}\;b \leq -1.15 \cdot 10^{+149}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{+113}:\\ \;\;\;\;\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{\sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} - b}{2 \cdot a}\\ \end{array}\\ \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) (/ (* 2.0 c) (- (- b) b)) (+ (- (/ b a)) (/ c b)))))
   (if (<= b -1.15e+149)
     t_0
     (if (<= b 1.35e+113)
       (if (>= b 0.0)
         (/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))))
         (/ (- (sqrt (- (* b b) (* a (* c 4.0)))) b) (* 2.0 a)))
       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 = (2.0 * c) / (-b - b);
	} else {
		tmp = -(b / a) + (c / b);
	}
	double t_0 = tmp;
	double tmp_1;
	if (b <= -1.15e+149) {
		tmp_1 = t_0;
	} else if (b <= 1.35e+113) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
		} else {
			tmp_2 = (sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a);
		}
		tmp_1 = tmp_2;
	} else {
		tmp_1 = t_0;
	}
	return tmp_1;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b >= 0.0d0) then
        tmp = (2.0d0 * c) / (-b - sqrt(((b * b) - ((4.0d0 * a) * c))))
    else
        tmp = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
    end if
    code = tmp
end function
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    real(8) :: tmp_1
    real(8) :: tmp_2
    if (b >= 0.0d0) then
        tmp = (2.0d0 * c) / (-b - b)
    else
        tmp = -(b / a) + (c / b)
    end if
    t_0 = tmp
    if (b <= (-1.15d+149)) then
        tmp_1 = t_0
    else if (b <= 1.35d+113) then
        if (b >= 0.0d0) then
            tmp_2 = (2.0d0 * c) / (-b - sqrt(((b * b) - ((4.0d0 * a) * c))))
        else
            tmp_2 = (sqrt(((b * b) - (a * (c * 4.0d0)))) - b) / (2.0d0 * a)
        end if
        tmp_1 = tmp_2
    else
        tmp_1 = t_0
    end if
    code = tmp_1
end function
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 = (2.0 * c) / (-b - b);
	} else {
		tmp = -(b / a) + (c / b);
	}
	double t_0 = tmp;
	double tmp_1;
	if (b <= -1.15e+149) {
		tmp_1 = t_0;
	} else if (b <= 1.35e+113) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = (2.0 * c) / (-b - Math.sqrt(((b * b) - ((4.0 * a) * c))));
		} else {
			tmp_2 = (Math.sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a);
		}
		tmp_1 = tmp_2;
	} else {
		tmp_1 = t_0;
	}
	return tmp_1;
}
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 = (2.0 * c) / (-b - b)
	else:
		tmp = -(b / a) + (c / b)
	t_0 = tmp
	tmp_1 = 0
	if b <= -1.15e+149:
		tmp_1 = t_0
	elif b <= 1.35e+113:
		tmp_2 = 0
		if b >= 0.0:
			tmp_2 = (2.0 * c) / (-b - math.sqrt(((b * b) - ((4.0 * a) * c))))
		else:
			tmp_2 = (math.sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a)
		tmp_1 = tmp_2
	else:
		tmp_1 = t_0
	return tmp_1
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(Float64(2.0 * c) / Float64(Float64(-b) - b));
	else
		tmp = Float64(Float64(-Float64(b / a)) + Float64(c / b));
	end
	t_0 = tmp
	tmp_1 = 0.0
	if (b <= -1.15e+149)
		tmp_1 = t_0;
	elseif (b <= 1.35e+113)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))));
		else
			tmp_2 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 4.0)))) - b) / Float64(2.0 * a));
		end
		tmp_1 = tmp_2;
	else
		tmp_1 = t_0;
	end
	return tmp_1
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_4 = code(a, b, c)
	tmp = 0.0;
	if (b >= 0.0)
		tmp = (2.0 * c) / (-b - b);
	else
		tmp = -(b / a) + (c / b);
	end
	t_0 = tmp;
	tmp_2 = 0.0;
	if (b <= -1.15e+149)
		tmp_2 = t_0;
	elseif (b <= 1.35e+113)
		tmp_3 = 0.0;
		if (b >= 0.0)
			tmp_3 = (2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c))));
		else
			tmp_3 = (sqrt(((b * b) - (a * (c * 4.0)))) - b) / (2.0 * a);
		end
		tmp_2 = tmp_3;
	else
		tmp_2 = t_0;
	end
	tmp_4 = 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 = If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - b), $MachinePrecision]), $MachinePrecision], N[((-N[(b / a), $MachinePrecision]) + N[(c / b), $MachinePrecision]), $MachinePrecision]]}, If[LessEqual[b, -1.15e+149], t$95$0, If[LessEqual[b, 1.35e+113], 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[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], 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{2 \cdot c}{\left(-b\right) - b}\\

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


\end{array}\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{+149}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{+113}:\\
\;\;\;\;\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{\sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} - b}{2 \cdot a}\\


\end{array}\\

\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 2 regimes
  2. if b < -1.1499999999999999e149 or 1.35000000000000006e113 < b

    1. Initial program 41.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} \]
    2. Taylor expanded in b around inf 21.9

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

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

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

      [Start]4.9

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

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

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

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

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

      [Start]2.2

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

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

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

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

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

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

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

    if -1.1499999999999999e149 < b < 1.35000000000000006e113

    1. Initial program 8.7

      \[\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-rr8.7

      \[\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{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{2 \cdot a}\\ \end{array} \]
    3. Simplified8.7

      \[\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{\sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} - b}{2 \cdot a}\\ \end{array} \]
      Proof

      [Start]8.7

      \[ \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{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{2 \cdot a}\\ \end{array} \]

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

      \[ \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{\sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} - b}{2 \cdot a}\\ \end{array} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification6.5

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

Alternatives

Alternative 1
Error7.1
Cost38052
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ t_1 := -\frac{b}{a}\\ t_2 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ t_3 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + t_2}{2 \cdot a}\\ \end{array}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array}\\ \mathbf{elif}\;t_3 \leq -2 \cdot 10^{-296}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} + \left(-b\right)}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+206}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 + \frac{c}{b}\\ \end{array} \]
Alternative 2
Error14.9
Cost7756
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ t_1 := \frac{c + c}{-2 \cdot \left(b - \frac{c \cdot a}{b}\right)}\\ \mathbf{if}\;b \leq -5 \cdot 10^{+150}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-238}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{t_1} \cdot \left(t_1 \cdot t_1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{b \cdot -2}{2 \cdot a}\\ \end{array} \]
Alternative 3
Error14.9
Cost7756
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{if}\;b \leq -4.4 \cdot 10^{+148}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.72 \cdot 10^{-214}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{b \cdot -2}{2 \cdot a}\\ \end{array} \]
Alternative 4
Error10.0
Cost7756
\[\begin{array}{l} t_0 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array}\\ \mathbf{if}\;b \leq -5 \cdot 10^{+148}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{-18}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} - b}{2 \cdot a}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error17.9
Cost7432
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{if}\;b \leq -1.95 \cdot 10^{-72}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
Alternative 6
Error18.1
Cost7240
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{if}\;b \leq -9.5 \cdot 10^{-79}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(-4 \cdot a\right)}}{2 \cdot a}\\ \end{array} \]
Alternative 7
Error21.3
Cost7112
\[\begin{array}{l} t_0 := \frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{if}\;b \leq -5 \cdot 10^{-93}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\ \end{array} \]
Alternative 8
Error22.6
Cost644
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b}{a}\right) + \frac{c}{b}\\ \end{array} \]
Alternative 9
Error22.6
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} \]
Alternative 10
Error45.4
Cost388
\[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

Error

Reproduce?

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