?

Average Error: 34.7 → 10.8
Time: 10.2s
Precision: binary64
Cost: 14028

?

\[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
\[\begin{array}{l} t_0 := -\frac{c}{b}\\ t_1 := \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}\\ \mathbf{if}\;b \leq -0.0125:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -6.4 \cdot 10^{-37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -4 \cdot 10^{-101}:\\ \;\;\;\;t_0 + \left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{+82}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (- (/ c b)))
        (t_1 (/ (+ b (sqrt (+ (* b b) (* (* a c) -4.0)))) (* a -2.0))))
   (if (<= b -0.0125)
     t_0
     (if (<= b -6.4e-37)
       t_1
       (if (<= b -4e-101)
         (+ t_0 (- (/ (* a (pow c 2.0)) (pow b 3.0))))
         (if (<= b 4.9e+82) t_1 (- (/ c b) (/ b a))))))))
double code(double a, double b, double c) {
	return (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
double code(double a, double b, double c) {
	double t_0 = -(c / b);
	double t_1 = (b + sqrt(((b * b) + ((a * c) * -4.0)))) / (a * -2.0);
	double tmp;
	if (b <= -0.0125) {
		tmp = t_0;
	} else if (b <= -6.4e-37) {
		tmp = t_1;
	} else if (b <= -4e-101) {
		tmp = t_0 + -((a * pow(c, 2.0)) / pow(b, 3.0));
	} else if (b <= 4.9e+82) {
		tmp = t_1;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b - sqrt(((b * b) - (4.0d0 * (a * c))))) / (2.0d0 * a)
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) :: t_1
    real(8) :: tmp
    t_0 = -(c / b)
    t_1 = (b + sqrt(((b * b) + ((a * c) * (-4.0d0))))) / (a * (-2.0d0))
    if (b <= (-0.0125d0)) then
        tmp = t_0
    else if (b <= (-6.4d-37)) then
        tmp = t_1
    else if (b <= (-4d-101)) then
        tmp = t_0 + -((a * (c ** 2.0d0)) / (b ** 3.0d0))
    else if (b <= 4.9d+82) then
        tmp = t_1
    else
        tmp = (c / b) - (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	return (-b - Math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
public static double code(double a, double b, double c) {
	double t_0 = -(c / b);
	double t_1 = (b + Math.sqrt(((b * b) + ((a * c) * -4.0)))) / (a * -2.0);
	double tmp;
	if (b <= -0.0125) {
		tmp = t_0;
	} else if (b <= -6.4e-37) {
		tmp = t_1;
	} else if (b <= -4e-101) {
		tmp = t_0 + -((a * Math.pow(c, 2.0)) / Math.pow(b, 3.0));
	} else if (b <= 4.9e+82) {
		tmp = t_1;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	return (-b - math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a)
def code(a, b, c):
	t_0 = -(c / b)
	t_1 = (b + math.sqrt(((b * b) + ((a * c) * -4.0)))) / (a * -2.0)
	tmp = 0
	if b <= -0.0125:
		tmp = t_0
	elif b <= -6.4e-37:
		tmp = t_1
	elif b <= -4e-101:
		tmp = t_0 + -((a * math.pow(c, 2.0)) / math.pow(b, 3.0))
	elif b <= 4.9e+82:
		tmp = t_1
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	return Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(2.0 * a))
end
function code(a, b, c)
	t_0 = Float64(-Float64(c / b))
	t_1 = Float64(Float64(b + sqrt(Float64(Float64(b * b) + Float64(Float64(a * c) * -4.0)))) / Float64(a * -2.0))
	tmp = 0.0
	if (b <= -0.0125)
		tmp = t_0;
	elseif (b <= -6.4e-37)
		tmp = t_1;
	elseif (b <= -4e-101)
		tmp = Float64(t_0 + Float64(-Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))));
	elseif (b <= 4.9e+82)
		tmp = t_1;
	else
		tmp = Float64(Float64(c / b) - Float64(b / a));
	end
	return tmp
end
function tmp = code(a, b, c)
	tmp = (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
end
function tmp_2 = code(a, b, c)
	t_0 = -(c / b);
	t_1 = (b + sqrt(((b * b) + ((a * c) * -4.0)))) / (a * -2.0);
	tmp = 0.0;
	if (b <= -0.0125)
		tmp = t_0;
	elseif (b <= -6.4e-37)
		tmp = t_1;
	elseif (b <= -4e-101)
		tmp = t_0 + -((a * (c ^ 2.0)) / (b ^ 3.0));
	elseif (b <= 4.9e+82)
		tmp = t_1;
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_] := Block[{t$95$0 = (-N[(c / b), $MachinePrecision])}, Block[{t$95$1 = N[(N[(b + N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -0.0125], t$95$0, If[LessEqual[b, -6.4e-37], t$95$1, If[LessEqual[b, -4e-101], N[(t$95$0 + (-N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[b, 4.9e+82], t$95$1, N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]]]]
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
\begin{array}{l}
t_0 := -\frac{c}{b}\\
t_1 := \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}\\
\mathbf{if}\;b \leq -0.0125:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq -6.4 \cdot 10^{-37}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -4 \cdot 10^{-101}:\\
\;\;\;\;t_0 + \left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\

\mathbf{elif}\;b \leq 4.9 \cdot 10^{+82}:\\
\;\;\;\;t_1\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original34.7
Target21.3
Herbie10.8
\[\begin{array}{l} \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\\ \end{array} \]

Derivation?

  1. Split input into 4 regimes
  2. if b < -0.012500000000000001

    1. Initial program 56.3

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified56.3

      \[\leadsto \color{blue}{\frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}} \]
      Proof

      [Start]56.3

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

      rational_best-simplify-65 [=>]56.3

      \[ \frac{\color{blue}{-\left(\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)\right)}}{2 \cdot a} \]

      rational_best-simplify-54 [=>]56.3

      \[ \color{blue}{\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)}{-2 \cdot a}} \]

      rational_best-simplify-63 [=>]56.3

      \[ \frac{\color{blue}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{-2 \cdot a} \]

      rational_best-simplify-61 [=>]56.3

      \[ \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]56.3

      \[ \frac{b + \sqrt{b \cdot b + \color{blue}{\left(a \cdot c\right) \cdot \left(-4\right)}}}{-2 \cdot a} \]

      metadata-eval [=>]56.3

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot \color{blue}{-4}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]56.3

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{\color{blue}{a \cdot \left(-2\right)}} \]

      metadata-eval [=>]56.3

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot \color{blue}{-2}} \]
    3. Taylor expanded in b around -inf 5.7

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Simplified5.7

      \[\leadsto \color{blue}{-\frac{c}{b}} \]
      Proof

      [Start]5.7

      \[ -1 \cdot \frac{c}{b} \]

      rational_best-simplify-3 [=>]5.7

      \[ \color{blue}{\frac{c}{b} \cdot -1} \]

      rational_best-simplify-17 [=>]5.7

      \[ \color{blue}{-\frac{c}{b}} \]

    if -0.012500000000000001 < b < -6.3999999999999998e-37 or -4.00000000000000021e-101 < b < 4.9000000000000001e82

    1. Initial program 14.4

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified14.4

      \[\leadsto \color{blue}{\frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}} \]
      Proof

      [Start]14.4

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

      rational_best-simplify-65 [=>]14.4

      \[ \frac{\color{blue}{-\left(\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)\right)}}{2 \cdot a} \]

      rational_best-simplify-54 [=>]14.4

      \[ \color{blue}{\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)}{-2 \cdot a}} \]

      rational_best-simplify-63 [=>]14.4

      \[ \frac{\color{blue}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{-2 \cdot a} \]

      rational_best-simplify-61 [=>]14.4

      \[ \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]14.4

      \[ \frac{b + \sqrt{b \cdot b + \color{blue}{\left(a \cdot c\right) \cdot \left(-4\right)}}}{-2 \cdot a} \]

      metadata-eval [=>]14.4

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot \color{blue}{-4}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]14.4

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{\color{blue}{a \cdot \left(-2\right)}} \]

      metadata-eval [=>]14.4

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot \color{blue}{-2}} \]

    if -6.3999999999999998e-37 < b < -4.00000000000000021e-101

    1. Initial program 35.8

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified35.8

      \[\leadsto \color{blue}{\frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}} \]
      Proof

      [Start]35.8

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

      rational_best-simplify-65 [=>]35.8

      \[ \frac{\color{blue}{-\left(\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)\right)}}{2 \cdot a} \]

      rational_best-simplify-54 [=>]35.8

      \[ \color{blue}{\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)}{-2 \cdot a}} \]

      rational_best-simplify-63 [=>]35.8

      \[ \frac{\color{blue}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{-2 \cdot a} \]

      rational_best-simplify-61 [=>]35.8

      \[ \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]35.8

      \[ \frac{b + \sqrt{b \cdot b + \color{blue}{\left(a \cdot c\right) \cdot \left(-4\right)}}}{-2 \cdot a} \]

      metadata-eval [=>]35.8

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot \color{blue}{-4}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]35.8

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{\color{blue}{a \cdot \left(-2\right)}} \]

      metadata-eval [=>]35.8

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot \color{blue}{-2}} \]
    3. Taylor expanded in b around -inf 32.8

      \[\leadsto \color{blue}{-1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -1 \cdot \frac{c}{b}} \]
    4. Simplified32.8

      \[\leadsto \color{blue}{\left(-\frac{c}{b}\right) + \left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
      Proof

      [Start]32.8

      \[ -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -1 \cdot \frac{c}{b} \]

      rational_best-simplify-1 [=>]32.8

      \[ \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]

      rational_best-simplify-3 [=>]32.8

      \[ \color{blue}{\frac{c}{b} \cdot -1} + -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} \]

      rational_best-simplify-17 [=>]32.8

      \[ \color{blue}{\left(-\frac{c}{b}\right)} + -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} \]

      rational_best-simplify-3 [=>]32.8

      \[ \left(-\frac{c}{b}\right) + \color{blue}{\frac{{c}^{2} \cdot a}{{b}^{3}} \cdot -1} \]

      rational_best-simplify-17 [=>]32.8

      \[ \left(-\frac{c}{b}\right) + \color{blue}{\left(-\frac{{c}^{2} \cdot a}{{b}^{3}}\right)} \]

      rational_best-simplify-3 [=>]32.8

      \[ \left(-\frac{c}{b}\right) + \left(-\frac{\color{blue}{a \cdot {c}^{2}}}{{b}^{3}}\right) \]

    if 4.9000000000000001e82 < b

    1. Initial program 44.3

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified44.3

      \[\leadsto \color{blue}{\frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}} \]
      Proof

      [Start]44.3

      \[ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]

      rational_best-simplify-65 [=>]44.3

      \[ \frac{\color{blue}{-\left(\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)\right)}}{2 \cdot a} \]

      rational_best-simplify-54 [=>]44.3

      \[ \color{blue}{\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - \left(-b\right)}{-2 \cdot a}} \]

      rational_best-simplify-63 [=>]44.3

      \[ \frac{\color{blue}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{-2 \cdot a} \]

      rational_best-simplify-61 [=>]44.3

      \[ \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]44.3

      \[ \frac{b + \sqrt{b \cdot b + \color{blue}{\left(a \cdot c\right) \cdot \left(-4\right)}}}{-2 \cdot a} \]

      metadata-eval [=>]44.3

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot \color{blue}{-4}}}{-2 \cdot a} \]

      rational_best-simplify-52 [=>]44.3

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{\color{blue}{a \cdot \left(-2\right)}} \]

      metadata-eval [=>]44.3

      \[ \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot \color{blue}{-2}} \]
    3. Taylor expanded in b around inf 5.0

      \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
    4. Simplified5.0

      \[\leadsto \color{blue}{\left(-\frac{b}{a}\right) + \frac{c}{b}} \]
      Proof

      [Start]5.0

      \[ \frac{c}{b} + -1 \cdot \frac{b}{a} \]

      rational_best-simplify-1 [=>]5.0

      \[ \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]

      rational_best-simplify-3 [=>]5.0

      \[ \color{blue}{\frac{b}{a} \cdot -1} + \frac{c}{b} \]

      rational_best-simplify-17 [=>]5.0

      \[ \color{blue}{\left(-\frac{b}{a}\right)} + \frac{c}{b} \]
    5. Taylor expanded in b around 0 5.0

      \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
    6. Simplified5.0

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
      Proof

      [Start]5.0

      \[ \frac{c}{b} + -1 \cdot \frac{b}{a} \]

      rational_best-simplify-3 [=>]5.0

      \[ \frac{c}{b} + \color{blue}{\frac{b}{a} \cdot -1} \]

      rational_best-simplify-18 [<=]5.0

      \[ \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]

      rational_best-simplify-61 [<=]5.0

      \[ \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification10.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.0125:\\ \;\;\;\;-\frac{c}{b}\\ \mathbf{elif}\;b \leq -6.4 \cdot 10^{-37}:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}\\ \mathbf{elif}\;b \leq -4 \cdot 10^{-101}:\\ \;\;\;\;\left(-\frac{c}{b}\right) + \left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{+82}:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternatives

Alternative 1
Error11.0
Cost7888
\[\begin{array}{l} t_0 := -\frac{c}{b}\\ t_1 := \frac{b + \sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4}}{a \cdot -2}\\ \mathbf{if}\;b \leq -0.011:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -3.5 \cdot 10^{-82}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2.4 \cdot 10^{-102}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+82}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 2
Error13.7
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-101}:\\ \;\;\;\;-\frac{c}{b}\\ \mathbf{elif}\;b \leq 1.72 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} + b}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 3
Error13.9
Cost7240
\[\begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{-101}:\\ \;\;\;\;-\frac{c}{b}\\ \mathbf{elif}\;b \leq 1.72 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt{-4 \cdot \left(a \cdot c\right)}}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 4
Error20.0
Cost7112
\[\begin{array}{l} \mathbf{if}\;b \leq -6.2 \cdot 10^{-156}:\\ \;\;\;\;-\frac{c}{b}\\ \mathbf{elif}\;b \leq 4 \cdot 10^{-126}:\\ \;\;\;\;-0.5 \cdot \sqrt{\frac{c}{a} \cdot -4}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 5
Error40.1
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+37}:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
Alternative 6
Error23.0
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{-243}:\\ \;\;\;\;-\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
Alternative 7
Error56.5
Cost192
\[\frac{c}{b} \]

Error

Reproduce?

herbie shell --seed 2023104 
(FPCore (a b c)
  :name "quadm (p42, negative)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))

  (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))