quad2m (problem 3.2.1, negative)

?

Percentage Accurate: 52.5% → 85.1%
Time: 23.3s
Precision: binary64
Cost: 13704

?

\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -4.2 \cdot 10^{-22}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 3 \cdot 10^{-191}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(\sqrt{-c \cdot a}, b_2\right)}{a}\\ \mathbf{elif}\;b_2 \leq 5.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{-b_2}{a} - \frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -4.2e-22)
   (/ (* -0.5 c) b_2)
   (if (<= b_2 3e-191)
     (/ (- (- b_2) (hypot (sqrt (- (* c a))) b_2)) a)
     (if (<= b_2 5.8e+56)
       (- (/ (- b_2) a) (/ (pow (- (* b_2 b_2) (* c a)) 0.5) a))
       (/ (* b_2 -2.0) a)))))
double code(double a, double b_2, double c) {
	return (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
}
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -4.2e-22) {
		tmp = (-0.5 * c) / b_2;
	} else if (b_2 <= 3e-191) {
		tmp = (-b_2 - hypot(sqrt(-(c * a)), b_2)) / a;
	} else if (b_2 <= 5.8e+56) {
		tmp = (-b_2 / a) - (pow(((b_2 * b_2) - (c * a)), 0.5) / a);
	} else {
		tmp = (b_2 * -2.0) / a;
	}
	return tmp;
}
public static double code(double a, double b_2, double c) {
	return (-b_2 - Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
public static double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -4.2e-22) {
		tmp = (-0.5 * c) / b_2;
	} else if (b_2 <= 3e-191) {
		tmp = (-b_2 - Math.hypot(Math.sqrt(-(c * a)), b_2)) / a;
	} else if (b_2 <= 5.8e+56) {
		tmp = (-b_2 / a) - (Math.pow(((b_2 * b_2) - (c * a)), 0.5) / a);
	} else {
		tmp = (b_2 * -2.0) / a;
	}
	return tmp;
}
def code(a, b_2, c):
	return (-b_2 - math.sqrt(((b_2 * b_2) - (a * c)))) / a
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -4.2e-22:
		tmp = (-0.5 * c) / b_2
	elif b_2 <= 3e-191:
		tmp = (-b_2 - math.hypot(math.sqrt(-(c * a)), b_2)) / a
	elif b_2 <= 5.8e+56:
		tmp = (-b_2 / a) - (math.pow(((b_2 * b_2) - (c * a)), 0.5) / a)
	else:
		tmp = (b_2 * -2.0) / a
	return tmp
function code(a, b_2, c)
	return Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a)
end
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -4.2e-22)
		tmp = Float64(Float64(-0.5 * c) / b_2);
	elseif (b_2 <= 3e-191)
		tmp = Float64(Float64(Float64(-b_2) - hypot(sqrt(Float64(-Float64(c * a))), b_2)) / a);
	elseif (b_2 <= 5.8e+56)
		tmp = Float64(Float64(Float64(-b_2) / a) - Float64((Float64(Float64(b_2 * b_2) - Float64(c * a)) ^ 0.5) / a));
	else
		tmp = Float64(Float64(b_2 * -2.0) / a);
	end
	return tmp
end
function tmp = code(a, b_2, c)
	tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -4.2e-22)
		tmp = (-0.5 * c) / b_2;
	elseif (b_2 <= 3e-191)
		tmp = (-b_2 - hypot(sqrt(-(c * a)), b_2)) / a;
	elseif (b_2 <= 5.8e+56)
		tmp = (-b_2 / a) - ((((b_2 * b_2) - (c * a)) ^ 0.5) / a);
	else
		tmp = (b_2 * -2.0) / a;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -4.2e-22], N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision], If[LessEqual[b$95$2, 3e-191], N[(N[((-b$95$2) - N[Sqrt[N[Sqrt[(-N[(c * a), $MachinePrecision])], $MachinePrecision] ^ 2 + b$95$2 ^ 2], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 5.8e+56], N[(N[((-b$95$2) / a), $MachinePrecision] - N[(N[Power[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(c * a), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision]]]]
\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -4.2 \cdot 10^{-22}:\\
\;\;\;\;\frac{-0.5 \cdot c}{b_2}\\

\mathbf{elif}\;b_2 \leq 3 \cdot 10^{-191}:\\
\;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(\sqrt{-c \cdot a}, b_2\right)}{a}\\

\mathbf{elif}\;b_2 \leq 5.8 \cdot 10^{+56}:\\
\;\;\;\;\frac{-b_2}{a} - \frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5}}{a}\\

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


\end{array}

Local Percentage Accuracy?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 4 regimes
  2. if b_2 < -4.20000000000000016e-22

    1. Initial program 18.6%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Taylor expanded in b_2 around -inf 87.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
    3. Simplified87.2%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]
      Step-by-step derivation

      [Start]87.2

      \[ -0.5 \cdot \frac{c}{b_2} \]

      associate-*r/ [=>]87.2

      \[ \color{blue}{\frac{-0.5 \cdot c}{b_2}} \]

    if -4.20000000000000016e-22 < b_2 < 3.0000000000000001e-191

    1. Initial program 75.0%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr81.6%

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\mathsf{hypot}\left(\sqrt{c \cdot \left(-a\right)}, b_2\right)}}{a} \]
      Step-by-step derivation

      [Start]75.0

      \[ \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]

      sub-neg [=>]75.0

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

      +-commutative [=>]75.0

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

      add-sqr-sqrt [=>]75.0

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

      hypot-def [=>]81.6

      \[ \frac{\left(-b_2\right) - \color{blue}{\mathsf{hypot}\left(\sqrt{-a \cdot c}, b_2\right)}}{a} \]

      *-commutative [=>]81.6

      \[ \frac{\left(-b_2\right) - \mathsf{hypot}\left(\sqrt{-\color{blue}{c \cdot a}}, b_2\right)}{a} \]

      distribute-rgt-neg-in [=>]81.6

      \[ \frac{\left(-b_2\right) - \mathsf{hypot}\left(\sqrt{\color{blue}{c \cdot \left(-a\right)}}, b_2\right)}{a} \]

    if 3.0000000000000001e-191 < b_2 < 5.80000000000000014e56

    1. Initial program 90.3%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr89.9%

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
      Step-by-step derivation

      [Start]90.3

      \[ \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]

      add-sqr-sqrt [=>]89.9

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

      pow2 [=>]89.9

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

      pow1/2 [=>]89.9

      \[ \frac{\left(-b_2\right) - {\left(\sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}\right)}^{2}}{a} \]

      sqrt-pow1 [=>]89.9

      \[ \frac{\left(-b_2\right) - {\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a} \]

      metadata-eval [=>]89.9

      \[ \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\color{blue}{0.25}}\right)}^{2}}{a} \]
    3. Applied egg-rr84.6%

      \[\leadsto \frac{\left(-b_2\right) - {\color{blue}{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}}^{2}}{a} \]
      Step-by-step derivation

      [Start]89.9

      \[ \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}^{2}}{a} \]

      add-exp-log [=>]84.6

      \[ \frac{\left(-b_2\right) - {\color{blue}{\left(e^{\log \left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}\right)}}^{2}}{a} \]

      log-pow [=>]84.6

      \[ \frac{\left(-b_2\right) - {\left(e^{\color{blue}{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}}\right)}^{2}}{a} \]
    4. Applied egg-rr90.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{b_2}{a}, -\frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{0.25}\right)}^{2}}{a}\right)} \]
      Step-by-step derivation

      [Start]84.6

      \[ \frac{\left(-b_2\right) - {\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      div-sub [=>]84.5

      \[ \color{blue}{\frac{-b_2}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a}} \]

      neg-mul-1 [=>]84.5

      \[ \frac{\color{blue}{-1 \cdot b_2}}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      *-un-lft-identity [=>]84.5

      \[ \frac{-1 \cdot b_2}{\color{blue}{1 \cdot a}} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      times-frac [=>]84.5

      \[ \color{blue}{\frac{-1}{1} \cdot \frac{b_2}{a}} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      metadata-eval [=>]84.5

      \[ \color{blue}{-1} \cdot \frac{b_2}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      add-sqr-sqrt [=>]84.6

      \[ -1 \cdot \frac{\color{blue}{\sqrt{b_2} \cdot \sqrt{b_2}}}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      sqrt-prod [<=]84.5

      \[ -1 \cdot \frac{\color{blue}{\sqrt{b_2 \cdot b_2}}}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      sqr-neg [<=]84.5

      \[ -1 \cdot \frac{\sqrt{\color{blue}{\left(-b_2\right) \cdot \left(-b_2\right)}}}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      sqrt-unprod [<=]0.0

      \[ -1 \cdot \frac{\color{blue}{\sqrt{-b_2} \cdot \sqrt{-b_2}}}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      add-sqr-sqrt [<=]54.5

      \[ -1 \cdot \frac{\color{blue}{-b_2}}{a} - \frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a} \]

      fma-neg [=>]54.5

      \[ \color{blue}{\mathsf{fma}\left(-1, \frac{-b_2}{a}, -\frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a}\right)} \]

      add-sqr-sqrt [=>]0.0

      \[ \mathsf{fma}\left(-1, \frac{\color{blue}{\sqrt{-b_2} \cdot \sqrt{-b_2}}}{a}, -\frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a}\right) \]

      sqrt-unprod [=>]84.5

      \[ \mathsf{fma}\left(-1, \frac{\color{blue}{\sqrt{\left(-b_2\right) \cdot \left(-b_2\right)}}}{a}, -\frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a}\right) \]

      sqr-neg [=>]84.5

      \[ \mathsf{fma}\left(-1, \frac{\sqrt{\color{blue}{b_2 \cdot b_2}}}{a}, -\frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a}\right) \]

      sqrt-prod [=>]84.6

      \[ \mathsf{fma}\left(-1, \frac{\color{blue}{\sqrt{b_2} \cdot \sqrt{b_2}}}{a}, -\frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a}\right) \]

      add-sqr-sqrt [<=]84.5

      \[ \mathsf{fma}\left(-1, \frac{\color{blue}{b_2}}{a}, -\frac{{\left(e^{0.25 \cdot \log \left(b_2 \cdot b_2 - a \cdot c\right)}\right)}^{2}}{a}\right) \]
    5. Simplified90.4%

      \[\leadsto \color{blue}{\left(-\frac{b_2}{a}\right) - \frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5}}{a}} \]
      Step-by-step derivation

      [Start]90.0

      \[ \mathsf{fma}\left(-1, \frac{b_2}{a}, -\frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{0.25}\right)}^{2}}{a}\right) \]

      fma-udef [=>]90.0

      \[ \color{blue}{-1 \cdot \frac{b_2}{a} + \left(-\frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{0.25}\right)}^{2}}{a}\right)} \]

      unsub-neg [=>]90.0

      \[ \color{blue}{-1 \cdot \frac{b_2}{a} - \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{0.25}\right)}^{2}}{a}} \]

      mul-1-neg [=>]90.0

      \[ \color{blue}{\left(-\frac{b_2}{a}\right)} - \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{0.25}\right)}^{2}}{a} \]

      unpow2 [=>]90.0

      \[ \left(-\frac{b_2}{a}\right) - \frac{\color{blue}{{\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{0.25}}}{a} \]

      pow-sqr [=>]90.4

      \[ \left(-\frac{b_2}{a}\right) - \frac{\color{blue}{{\left(\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)\right)}^{\left(2 \cdot 0.25\right)}}}{a} \]

      fma-udef [=>]90.4

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

      unpow2 [<=]90.4

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

      distribute-rgt-neg-out [=>]90.4

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

      *-commutative [<=]90.4

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

      unsub-neg [=>]90.4

      \[ \left(-\frac{b_2}{a}\right) - \frac{{\color{blue}{\left({b_2}^{2} - c \cdot a\right)}}^{\left(2 \cdot 0.25\right)}}{a} \]

      unpow2 [=>]90.4

      \[ \left(-\frac{b_2}{a}\right) - \frac{{\left(\color{blue}{b_2 \cdot b_2} - c \cdot a\right)}^{\left(2 \cdot 0.25\right)}}{a} \]

      metadata-eval [=>]90.4

      \[ \left(-\frac{b_2}{a}\right) - \frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\color{blue}{0.5}}}{a} \]

    if 5.80000000000000014e56 < b_2

    1. Initial program 65.1%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Taylor expanded in b_2 around inf 98.4%

      \[\leadsto \frac{\color{blue}{-2 \cdot b_2}}{a} \]
    3. Simplified98.4%

      \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
      Step-by-step derivation

      [Start]98.4

      \[ \frac{-2 \cdot b_2}{a} \]

      *-commutative [=>]98.4

      \[ \frac{\color{blue}{b_2 \cdot -2}}{a} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification88.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -4.2 \cdot 10^{-22}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 3 \cdot 10^{-191}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(\sqrt{-c \cdot a}, b_2\right)}{a}\\ \mathbf{elif}\;b_2 \leq 5.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{-b_2}{a} - \frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy84.9%
Cost7624
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -7 \cdot 10^{-23}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 5.8 \cdot 10^{+56}:\\ \;\;\;\;\frac{-b_2}{a} - \frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]
Alternative 2
Accuracy84.9%
Cost7432
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -2.2 \cdot 10^{-23}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 5 \cdot 10^{+56}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]
Alternative 3
Accuracy80.3%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -2.9 \cdot 10^{-23}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 6.8 \cdot 10^{-21}:\\ \;\;\;\;\frac{\sqrt{-c \cdot a}}{-a} - \frac{b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2}{a} \cdot -2 + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]
Alternative 4
Accuracy80.3%
Cost7240
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -2 \cdot 10^{-22}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 1.22 \cdot 10^{-18}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{-c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2}{a} \cdot -2 + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]
Alternative 5
Accuracy80.1%
Cost7176
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.4 \cdot 10^{-23}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{elif}\;b_2 \leq 2.05 \cdot 10^{-38}:\\ \;\;\;\;\frac{b_2 - \sqrt{-c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2}{a} \cdot -2 + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]
Alternative 6
Accuracy67.7%
Cost836
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2}{a} \cdot -2 + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]
Alternative 7
Accuracy44.1%
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -2.7 \cdot 10^{-284}:\\ \;\;\;\;\frac{0}{a}\\ \mathbf{else}:\\ \;\;\;\;b_2 \cdot \frac{-2}{a}\\ \end{array} \]
Alternative 8
Accuracy44.1%
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.7 \cdot 10^{-284}:\\ \;\;\;\;\frac{0}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\ \end{array} \]
Alternative 9
Accuracy67.4%
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.8 \cdot 10^{-284}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\ \end{array} \]
Alternative 10
Accuracy67.5%
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.7 \cdot 10^{-284}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]
Alternative 11
Accuracy23.9%
Cost388
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.75 \cdot 10^{-284}:\\ \;\;\;\;\frac{0}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b_2}{a}\\ \end{array} \]
Alternative 12
Accuracy11.1%
Cost192
\[\frac{0}{a} \]

Error

Reproduce?

herbie shell --seed 2023159 
(FPCore (a b_2 c)
  :name "quad2m (problem 3.2.1, negative)"
  :precision binary64
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))