?

Average Accuracy: 47.4% → 89.9%
Time: 21.5s
Precision: binary64
Cost: 7820

?

\[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
\[\begin{array}{l} \mathbf{if}\;b \leq -2.75 \cdot 10^{+89}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-158}:\\ \;\;\;\;\frac{c \cdot -2}{b - \sqrt{c \cdot \left(a \cdot -4\right) + b \cdot b}}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+127}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\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
 (if (<= b -2.75e+89)
   (/ (- c) b)
   (if (<= b 3.9e-158)
     (/ (* c -2.0) (- b (sqrt (+ (* c (* a -4.0)) (* b b)))))
     (if (<= b 4.8e+127)
       (/ (- (- b) (sqrt (+ (* b b) (* -4.0 (* c a))))) (* a 2.0))
       (/ (- 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 tmp;
	if (b <= -2.75e+89) {
		tmp = -c / b;
	} else if (b <= 3.9e-158) {
		tmp = (c * -2.0) / (b - sqrt(((c * (a * -4.0)) + (b * b))));
	} else if (b <= 4.8e+127) {
		tmp = (-b - sqrt(((b * b) + (-4.0 * (c * a))))) / (a * 2.0);
	} else {
		tmp = -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) :: tmp
    if (b <= (-2.75d+89)) then
        tmp = -c / b
    else if (b <= 3.9d-158) then
        tmp = (c * (-2.0d0)) / (b - sqrt(((c * (a * (-4.0d0))) + (b * b))))
    else if (b <= 4.8d+127) then
        tmp = (-b - sqrt(((b * b) + ((-4.0d0) * (c * a))))) / (a * 2.0d0)
    else
        tmp = -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 tmp;
	if (b <= -2.75e+89) {
		tmp = -c / b;
	} else if (b <= 3.9e-158) {
		tmp = (c * -2.0) / (b - Math.sqrt(((c * (a * -4.0)) + (b * b))));
	} else if (b <= 4.8e+127) {
		tmp = (-b - Math.sqrt(((b * b) + (-4.0 * (c * a))))) / (a * 2.0);
	} else {
		tmp = -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):
	tmp = 0
	if b <= -2.75e+89:
		tmp = -c / b
	elif b <= 3.9e-158:
		tmp = (c * -2.0) / (b - math.sqrt(((c * (a * -4.0)) + (b * b))))
	elif b <= 4.8e+127:
		tmp = (-b - math.sqrt(((b * b) + (-4.0 * (c * a))))) / (a * 2.0)
	else:
		tmp = -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)
	tmp = 0.0
	if (b <= -2.75e+89)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= 3.9e-158)
		tmp = Float64(Float64(c * -2.0) / Float64(b - sqrt(Float64(Float64(c * Float64(a * -4.0)) + Float64(b * b)))));
	elseif (b <= 4.8e+127)
		tmp = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) + Float64(-4.0 * Float64(c * a))))) / Float64(a * 2.0));
	else
		tmp = Float64(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)
	tmp = 0.0;
	if (b <= -2.75e+89)
		tmp = -c / b;
	elseif (b <= 3.9e-158)
		tmp = (c * -2.0) / (b - sqrt(((c * (a * -4.0)) + (b * b))));
	elseif (b <= 4.8e+127)
		tmp = (-b - sqrt(((b * b) + (-4.0 * (c * a))))) / (a * 2.0);
	else
		tmp = -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_] := If[LessEqual[b, -2.75e+89], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 3.9e-158], N[(N[(c * -2.0), $MachinePrecision] / N[(b - N[Sqrt[N[(N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.8e+127], N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(-4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-b) / a), $MachinePrecision]]]]
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \leq -2.75 \cdot 10^{+89}:\\
\;\;\;\;\frac{-c}{b}\\

\mathbf{elif}\;b \leq 3.9 \cdot 10^{-158}:\\
\;\;\;\;\frac{c \cdot -2}{b - \sqrt{c \cdot \left(a \cdot -4\right) + b \cdot b}}\\

\mathbf{elif}\;b \leq 4.8 \cdot 10^{+127}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original47.4%
Target67.9%
Herbie89.9%
\[\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 < -2.74999999999999988e89

    1. Initial program 8.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Simplified95.5%

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

      [Start]95.5

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

      associate-*r/ [=>]95.5

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

      neg-mul-1 [<=]95.5

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

    if -2.74999999999999988e89 < b < 3.8999999999999997e-158

    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{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}\right)} \]
      Proof

      [Start]56.3

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

      *-lft-identity [<=]56.3

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

      metadata-eval [<=]56.3

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

      associate-*r/ [=>]56.3

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

      associate-*l/ [<=]56.3

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

      distribute-neg-frac [<=]56.3

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

      distribute-lft-neg-in [<=]56.3

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

      distribute-rgt-neg-out [<=]56.3

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

      associate-/r* [=>]56.3

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

      metadata-eval [=>]56.3

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

      sub-neg [=>]56.3

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

      distribute-neg-out [=>]56.3

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

      remove-double-neg [=>]56.3

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

      sub-neg [=>]56.3

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

      +-commutative [=>]56.3

      \[ \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Applied egg-rr55.8%

      \[\leadsto \color{blue}{\frac{\frac{-0.5}{a} \cdot \left(b \cdot b - \mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)\right)}{b - \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}} \]
    4. Taylor expanded in a around 0 83.5%

      \[\leadsto \frac{\color{blue}{-2 \cdot c}}{b - \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \]
    5. Simplified83.5%

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

      [Start]83.5

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

      *-commutative [=>]83.5

      \[ \frac{\color{blue}{c \cdot -2}}{b - \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \]
    6. Applied egg-rr83.5%

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

    if 3.8999999999999997e-158 < b < 4.8000000000000004e127

    1. Initial program 92.0%

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

    if 4.8000000000000004e127 < b

    1. Initial program 14.6%

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

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

      [Start]14.6

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

      *-lft-identity [<=]14.6

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

      metadata-eval [<=]14.6

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

      associate-*r/ [=>]14.6

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

      associate-*l/ [<=]14.6

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

      distribute-neg-frac [<=]14.6

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

      distribute-lft-neg-in [<=]14.6

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

      distribute-rgt-neg-out [<=]14.6

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

      associate-/r* [=>]14.6

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

      metadata-eval [=>]14.6

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

      sub-neg [=>]14.6

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

      distribute-neg-out [=>]14.6

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

      remove-double-neg [=>]14.6

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

      sub-neg [=>]14.6

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

      +-commutative [=>]14.6

      \[ \frac{-0.5}{a} \cdot \left(b + \sqrt{\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b}}\right) \]
    3. Taylor expanded in a around 0 95.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    4. Simplified95.0%

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

      [Start]95.0

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

      associate-*r/ [=>]95.0

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

      mul-1-neg [=>]95.0

      \[ \frac{\color{blue}{-b}}{a} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.75 \cdot 10^{+89}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-158}:\\ \;\;\;\;\frac{c \cdot -2}{b - \sqrt{c \cdot \left(a \cdot -4\right) + b \cdot b}}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+127}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b + -4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy89.8%
Cost7756
\[\begin{array}{l} t_0 := \sqrt{c \cdot \left(a \cdot -4\right) + b \cdot b}\\ \mathbf{if}\;b \leq -2.7 \cdot 10^{+89}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 3.4 \cdot 10^{-157}:\\ \;\;\;\;\frac{c \cdot -2}{b - t_0}\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{+127}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + t_0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 2
Accuracy76.1%
Cost7632
\[\begin{array}{l} t_0 := \frac{-0.5}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{if}\;b \leq -1.95 \cdot 10^{+31}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 1.98 \cdot 10^{-146}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-108}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{-45}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 3
Accuracy77.0%
Cost7632
\[\begin{array}{l} t_0 := \sqrt{c \cdot \left(a \cdot -4\right)}\\ \mathbf{if}\;b \leq -1.95 \cdot 10^{+31}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 1.98 \cdot 10^{-146}:\\ \;\;\;\;\frac{c \cdot -2}{b - t_0}\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-108}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 4.4 \cdot 10^{-49}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + t_0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 4
Accuracy77.0%
Cost7632
\[\begin{array}{l} t_0 := \sqrt{c \cdot \left(a \cdot -4\right)}\\ \mathbf{if}\;b \leq -1.95 \cdot 10^{+31}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 1.98 \cdot 10^{-146}:\\ \;\;\;\;\frac{c \cdot -2}{b - t_0}\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-108}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 1.65 \cdot 10^{-46}:\\ \;\;\;\;\frac{b + t_0}{-2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]
Alternative 5
Accuracy82.5%
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{+31}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 4 \cdot 10^{+127}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -4\right) + b \cdot b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 6
Accuracy39.0%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-303}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 7
Accuracy64.8%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq -7.4 \cdot 10^{-221}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
Alternative 8
Accuracy12.5%
Cost64
\[0 \]

Error

Reproduce?

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