?

Average Error: 28.9 → 5.0
Time: 1.3min
Precision: binary64
Cost: 60932

?

\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
\[\begin{array}{l} t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\ \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -18:\\ \;\;\;\;\left(\frac{t_0}{4 \cdot a} - \frac{b - t_0}{4 \cdot a}\right) - \frac{b}{4 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + \left({c}^{4} \cdot {a}^{3}\right) \cdot \frac{-5}{{b}^{7}}\right)\\ \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 (sqrt (- (* b b) (* 4.0 (* a c))))))
   (if (<= (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) -18.0)
     (- (- (/ t_0 (* 4.0 a)) (/ (- b t_0) (* 4.0 a))) (/ b (* 4.0 a)))
     (+
      (- 0.0 (+ (/ c b) (/ (* a (pow c 2.0)) (pow b 3.0))))
      (+
       (* (* (pow c 3.0) (pow a 2.0)) (/ -2.0 (pow b 5.0)))
       (* (* (pow c 4.0) (pow a 3.0)) (/ -5.0 (pow b 7.0))))))))
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 = sqrt(((b * b) - (4.0 * (a * c))));
	double tmp;
	if (((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)) <= -18.0) {
		tmp = ((t_0 / (4.0 * a)) - ((b - t_0) / (4.0 * a))) - (b / (4.0 * a));
	} else {
		tmp = (0.0 - ((c / b) + ((a * pow(c, 2.0)) / pow(b, 3.0)))) + (((pow(c, 3.0) * pow(a, 2.0)) * (-2.0 / pow(b, 5.0))) + ((pow(c, 4.0) * pow(a, 3.0)) * (-5.0 / pow(b, 7.0))));
	}
	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) :: tmp
    t_0 = sqrt(((b * b) - (4.0d0 * (a * c))))
    if (((-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)) <= (-18.0d0)) then
        tmp = ((t_0 / (4.0d0 * a)) - ((b - t_0) / (4.0d0 * a))) - (b / (4.0d0 * a))
    else
        tmp = (0.0d0 - ((c / b) + ((a * (c ** 2.0d0)) / (b ** 3.0d0)))) + ((((c ** 3.0d0) * (a ** 2.0d0)) * ((-2.0d0) / (b ** 5.0d0))) + (((c ** 4.0d0) * (a ** 3.0d0)) * ((-5.0d0) / (b ** 7.0d0))))
    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 = Math.sqrt(((b * b) - (4.0 * (a * c))));
	double tmp;
	if (((-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)) <= -18.0) {
		tmp = ((t_0 / (4.0 * a)) - ((b - t_0) / (4.0 * a))) - (b / (4.0 * a));
	} else {
		tmp = (0.0 - ((c / b) + ((a * Math.pow(c, 2.0)) / Math.pow(b, 3.0)))) + (((Math.pow(c, 3.0) * Math.pow(a, 2.0)) * (-2.0 / Math.pow(b, 5.0))) + ((Math.pow(c, 4.0) * Math.pow(a, 3.0)) * (-5.0 / Math.pow(b, 7.0))));
	}
	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 = math.sqrt(((b * b) - (4.0 * (a * c))))
	tmp = 0
	if ((-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)) <= -18.0:
		tmp = ((t_0 / (4.0 * a)) - ((b - t_0) / (4.0 * a))) - (b / (4.0 * a))
	else:
		tmp = (0.0 - ((c / b) + ((a * math.pow(c, 2.0)) / math.pow(b, 3.0)))) + (((math.pow(c, 3.0) * math.pow(a, 2.0)) * (-2.0 / math.pow(b, 5.0))) + ((math.pow(c, 4.0) * math.pow(a, 3.0)) * (-5.0 / math.pow(b, 7.0))))
	return tmp
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))
	tmp = 0.0
	if (Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) <= -18.0)
		tmp = Float64(Float64(Float64(t_0 / Float64(4.0 * a)) - Float64(Float64(b - t_0) / Float64(4.0 * a))) - Float64(b / Float64(4.0 * a)));
	else
		tmp = Float64(Float64(0.0 - Float64(Float64(c / b) + Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0)))) + Float64(Float64(Float64((c ^ 3.0) * (a ^ 2.0)) * Float64(-2.0 / (b ^ 5.0))) + Float64(Float64((c ^ 4.0) * (a ^ 3.0)) * Float64(-5.0 / (b ^ 7.0)))));
	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 = sqrt(((b * b) - (4.0 * (a * c))));
	tmp = 0.0;
	if (((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)) <= -18.0)
		tmp = ((t_0 / (4.0 * a)) - ((b - t_0) / (4.0 * a))) - (b / (4.0 * a));
	else
		tmp = (0.0 - ((c / b) + ((a * (c ^ 2.0)) / (b ^ 3.0)))) + ((((c ^ 3.0) * (a ^ 2.0)) * (-2.0 / (b ^ 5.0))) + (((c ^ 4.0) * (a ^ 3.0)) * (-5.0 / (b ^ 7.0))));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := 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 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[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], -18.0], N[(N[(N[(t$95$0 / N[(4.0 * a), $MachinePrecision]), $MachinePrecision] - N[(N[(b - t$95$0), $MachinePrecision] / N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b / N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.0 - N[(N[(c / b), $MachinePrecision] + N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Power[c, 3.0], $MachinePrecision] * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] * N[(-2.0 / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[c, 4.0], $MachinePrecision] * N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision] * N[(-5.0 / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\begin{array}{l}
t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -18:\\
\;\;\;\;\left(\frac{t_0}{4 \cdot a} - \frac{b - t_0}{4 \cdot a}\right) - \frac{b}{4 \cdot a}\\

\mathbf{else}:\\
\;\;\;\;\left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + \left({c}^{4} \cdot {a}^{3}\right) \cdot \frac{-5}{{b}^{7}}\right)\\


\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 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) < -18

    1. Initial program 9.2

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

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

      [Start]9.2

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

      rational_best-simplify-3 [=>]9.2

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

      rational_best-simplify-9 [<=]9.2

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

      rational_best-simplify-56 [=>]9.2

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

      rational_best-simplify-6 [=>]9.2

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

      rational_best-simplify-1 [=>]9.2

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

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

    if -18 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 30.9

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

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

      [Start]30.9

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

      rational_best-simplify-3 [=>]30.9

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

      rational_best-simplify-9 [<=]30.9

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

      rational_best-simplify-56 [=>]30.9

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

      rational_best-simplify-6 [=>]30.9

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

      rational_best-simplify-1 [=>]30.9

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

      \[\leadsto \color{blue}{-1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + \left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{{a}^{3} \cdot \left(16 \cdot \frac{{c}^{4}}{{b}^{6}} + {\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2}\right)}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right)} \]
    4. Simplified4.6

      \[\leadsto \color{blue}{\left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + \left({a}^{3} \cdot \left({c}^{4} \cdot \frac{16}{{b}^{6}} + 4 \cdot {\left(\frac{{c}^{2}}{{b}^{3}}\right)}^{2}\right)\right) \cdot \frac{-0.25}{b}\right)} \]
      Proof

      [Start]4.6

      \[ -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + \left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{{a}^{3} \cdot \left(16 \cdot \frac{{c}^{4}}{{b}^{6}} + {\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2}\right)}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right) \]

      rational_best-simplify-47 [=>]4.6

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

      rational_best-simplify-3 [<=]4.6

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

      rational_best-simplify-3 [=>]4.6

      \[ \color{blue}{\left(-1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -1 \cdot \frac{c}{b}\right) + \left(-0.25 \cdot \frac{{a}^{3} \cdot \left(16 \cdot \frac{{c}^{4}}{{b}^{6}} + {\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2}\right)}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)} \]
    5. Taylor expanded in c around 0 4.6

      \[\leadsto \left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + \color{blue}{-5 \cdot \frac{{c}^{4} \cdot {a}^{3}}{{b}^{7}}}\right) \]
    6. Simplified4.6

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

      [Start]4.6

      \[ \left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + -5 \cdot \frac{{c}^{4} \cdot {a}^{3}}{{b}^{7}}\right) \]

      rational_best-simplify-55 [=>]4.6

      \[ \left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + \color{blue}{\left({c}^{4} \cdot {a}^{3}\right) \cdot \frac{-5}{{b}^{7}}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification5.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -18:\\ \;\;\;\;\left(\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{4 \cdot a} - \frac{b - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{4 \cdot a}\right) - \frac{b}{4 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + \left({c}^{4} \cdot {a}^{3}\right) \cdot \frac{-5}{{b}^{7}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error5.0
Cost54596
\[\begin{array}{l} t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\ \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -18:\\ \;\;\;\;\left(\frac{t_0}{4 \cdot a} - \frac{b - t_0}{4 \cdot a}\right) - \frac{b}{4 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;{\left(c \cdot a\right)}^{4} \cdot \frac{-5}{a \cdot {b}^{7}} + \left({c}^{3} \cdot \left({a}^{2} \cdot \frac{-2}{{b}^{5}}\right) - \left(\left(\frac{c}{b} - 0\right) + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 2
Error6.9
Cost41028
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -0.03:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{\frac{2}{a}} \cdot \frac{1}{a \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{c}{b}\right) + \left(\left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}} + \left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 3
Error6.9
Cost41028
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -0.03:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{\frac{2}{a}} \cdot \frac{1}{a \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\left(0 - \left(\frac{c}{b} + \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\right) + \left({c}^{3} \cdot {a}^{2}\right) \cdot \frac{-2}{{b}^{5}}\\ \end{array} \]
Alternative 4
Error7.1
Cost34948
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -0.03:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{\frac{2}{a}} \cdot \frac{1}{a \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot \left(\frac{c \cdot a}{b} + \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}}\right) + {\left(c \cdot a\right)}^{3} \cdot \frac{-4}{{b}^{5}}}{a \cdot 2}\\ \end{array} \]
Alternative 5
Error9.1
Cost21060
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -0.015:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{\frac{2}{a}} \cdot \frac{1}{a \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot {c}^{2}}{-{b}^{3}} - \frac{c}{b}\\ \end{array} \]
Alternative 6
Error15.5
Cost15620
\[\begin{array}{l} t_0 := \frac{b \cdot b}{2}\\ \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -1.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{b}{\frac{a}{-0.5}} + 0.5 \cdot \frac{\sqrt{t_0 - \left(c \cdot \left(a \cdot 4\right) - t_0\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]
Alternative 7
Error15.1
Cost15236
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -1.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{\frac{2}{a}} \cdot \frac{1}{a \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]
Alternative 8
Error15.1
Cost15108
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leq -1.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{\left(a \cdot a\right) \cdot \frac{2}{a}}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]
Alternative 9
Error15.1
Cost14852
\[\begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;\frac{\left(-b\right) + t_0}{2 \cdot a} \leq -1.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{t_0 - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]
Alternative 10
Error17.4
Cost7756
\[\begin{array}{l} t_0 := -\frac{c}{b}\\ t_1 := \frac{0.5}{a} \cdot \left(\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b\right)\\ \mathbf{if}\;b \leq 21.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1600:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 2600:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error22.5
Cost256
\[-\frac{c}{b} \]
Alternative 12
Error62.0
Cost64
\[0 \]

Error

Reproduce?

herbie shell --seed 2023099 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))