?

Average Error: 53.16% → 12.37%
Time: 21.3s
Precision: binary64
Cost: 13964

?

\[\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 \cdot 10^{+124}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-233}:\\ \;\;\;\;\frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a} \cdot -0.5\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{c}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \cdot -2\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \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 -2e+124)
   (- (/ c b) (/ b a))
   (if (<= b 8.5e-233)
     (* (/ (- b (sqrt (+ (* b b) (* a (* c -4.0))))) a) -0.5)
     (if (<= b 2.2e-21)
       (* (/ c (+ b (hypot b (sqrt (* c (* a -4.0)))))) -2.0)
       (/ (- c) b)))))
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 <= -2e+124) {
		tmp = (c / b) - (b / a);
	} else if (b <= 8.5e-233) {
		tmp = ((b - sqrt(((b * b) + (a * (c * -4.0))))) / a) * -0.5;
	} else if (b <= 2.2e-21) {
		tmp = (c / (b + hypot(b, sqrt((c * (a * -4.0)))))) * -2.0;
	} else {
		tmp = -c / b;
	}
	return tmp;
}
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 <= -2e+124) {
		tmp = (c / b) - (b / a);
	} else if (b <= 8.5e-233) {
		tmp = ((b - Math.sqrt(((b * b) + (a * (c * -4.0))))) / a) * -0.5;
	} else if (b <= 2.2e-21) {
		tmp = (c / (b + Math.hypot(b, Math.sqrt((c * (a * -4.0)))))) * -2.0;
	} else {
		tmp = -c / b;
	}
	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 <= -2e+124:
		tmp = (c / b) - (b / a)
	elif b <= 8.5e-233:
		tmp = ((b - math.sqrt(((b * b) + (a * (c * -4.0))))) / a) * -0.5
	elif b <= 2.2e-21:
		tmp = (c / (b + math.hypot(b, math.sqrt((c * (a * -4.0)))))) * -2.0
	else:
		tmp = -c / b
	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 <= -2e+124)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 8.5e-233)
		tmp = Float64(Float64(Float64(b - sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -4.0))))) / a) * -0.5);
	elseif (b <= 2.2e-21)
		tmp = Float64(Float64(c / Float64(b + hypot(b, sqrt(Float64(c * Float64(a * -4.0)))))) * -2.0);
	else
		tmp = Float64(Float64(-c) / b);
	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 <= -2e+124)
		tmp = (c / b) - (b / a);
	elseif (b <= 8.5e-233)
		tmp = ((b - sqrt(((b * b) + (a * (c * -4.0))))) / a) * -0.5;
	elseif (b <= 2.2e-21)
		tmp = (c / (b + hypot(b, sqrt((c * (a * -4.0)))))) * -2.0;
	else
		tmp = -c / b;
	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, -2e+124], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.5e-233], N[(N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[b, 2.2e-21], N[(N[(c / N[(b + N[Sqrt[b ^ 2 + N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[((-c) / b), $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 \cdot 10^{+124}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 8.5 \cdot 10^{-233}:\\
\;\;\;\;\frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a} \cdot -0.5\\

\mathbf{elif}\;b \leq 2.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{c}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \cdot -2\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original53.16%
Target32.98%
Herbie12.37%
\[\begin{array}{l} \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{a \cdot \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 < -1.9999999999999999e124

    1. Initial program 84.03

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

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

      [Start]84.03

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

      /-rgt-identity [<=]84.03

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

      metadata-eval [<=]84.03

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

      *-commutative [=>]84.03

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

      associate-/l* [=>]84.03

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

      associate-/l* [<=]84.03

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

      associate-*r/ [<=]84.09

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

      /-rgt-identity [<=]84.09

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

      metadata-eval [<=]84.09

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

      \[\leadsto \color{blue}{\left(2 \cdot \frac{c \cdot a}{b} + -2 \cdot b\right)} \cdot \frac{0.5}{a} \]
    4. Taylor expanded in c around 0 5.35

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

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

      [Start]5.35

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

      mul-1-neg [=>]5.35

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

      unsub-neg [=>]5.35

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

    if -1.9999999999999999e124 < b < 8.5000000000000005e-233

    1. Initial program 14.46

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

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

      [Start]14.46

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

      associate-/r* [=>]14.43

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

      /-rgt-identity [<=]14.43

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

      metadata-eval [<=]14.43

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

      associate-/l/ [<=]14.43

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

      associate-/l* [<=]14.43

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

      associate-*r/ [<=]14.65

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

      times-frac [<=]14.46

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

      *-commutative [=>]14.46

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

      times-frac [=>]14.49

      \[ \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\frac{a}{-1}} \cdot \frac{-1}{2}} \]
    3. Applied egg-rr14.51

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

    if 8.5000000000000005e-233 < b < 2.2000000000000001e-21

    1. Initial program 39.23

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

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

      [Start]39.23

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

      /-rgt-identity [<=]39.23

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

      metadata-eval [<=]39.23

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

      *-commutative [=>]39.23

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

      associate-/l* [=>]39.23

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

      associate-/l* [<=]39.23

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

      associate-*r/ [<=]39.28

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

      /-rgt-identity [<=]39.28

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

      metadata-eval [<=]39.28

      \[ \frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{\color{blue}{--1}} \cdot \frac{\frac{--1}{2}}{a} \]
    3. Applied egg-rr48.34

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

      \[\leadsto \frac{\color{blue}{-4 \cdot \left(c \cdot a\right)}}{\frac{\left(b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)\right) \cdot a}{0.5}} \]
    5. Applied egg-rr43.74

      \[\leadsto \color{blue}{\frac{-4}{\left(a \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{-4 \cdot \left(c \cdot a\right)}\right)\right)\right) \cdot -2} \cdot \left(-c \cdot a\right)} \]
    6. Simplified18.58

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

      [Start]43.74

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

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

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

      associate-*l/ [=>]42.92

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

      *-commutative [=>]42.92

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

      times-frac [=>]42.92

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

      metadata-eval [=>]42.92

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

      associate-/r* [=>]33.38

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

      associate-/l* [=>]18.6

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

      associate-/l/ [=>]18.6

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

      *-inverses [=>]18.6

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

      *-rgt-identity [=>]18.6

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

      *-commutative [=>]18.6

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

      associate-*l* [=>]18.58

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

    if 2.2000000000000001e-21 < b

    1. Initial program 86.81

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Simplified10.32

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

      [Start]10.32

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

      associate-*r/ [=>]10.32

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

      neg-mul-1 [<=]10.32

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+124}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-233}:\\ \;\;\;\;\frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a} \cdot -0.5\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{c}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \cdot -2\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error12.52%
Cost13964
\[\begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+120}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-208}:\\ \;\;\;\;\frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a} \cdot -0.5\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-21}:\\ \;\;\;\;c \cdot \frac{-2}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 2
Error15.09%
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -3.75 \cdot 10^{+118}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{-57}:\\ \;\;\;\;\frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 3
Error20.43%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-103}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-57}:\\ \;\;\;\;\left(\sqrt{a \cdot \left(c \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 4
Error20.36%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{-103}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-58}:\\ \;\;\;\;-0.5 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 5
Error35.54%
Cost708
\[\begin{array}{l} \mathbf{if}\;b \leq -1.06 \cdot 10^{-266}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \]
Alternative 6
Error35.52%
Cost580
\[\begin{array}{l} \mathbf{if}\;b \leq -9 \cdot 10^{-270}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 7
Error61.63%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq 3.4 \cdot 10^{+15}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \]
Alternative 8
Error35.82%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq 1.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 9
Error88.41%
Cost192
\[\frac{c}{b} \]

Error

Reproduce?

herbie shell --seed 2023103 
(FPCore (a b c)
  :name "quadp (p42, positive)"
  :precision binary64

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

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