?

Average Error: 28.5 → 5.4
Time: 25.5s
Precision: binary64
Cost: 61700

?

\[\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(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
\[\begin{array}{l} t_0 := {\left(c \cdot a\right)}^{4}\\ \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \leq -2:\\ \;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\right) + \left({a}^{2} \cdot \left(\frac{{c}^{3}}{{b}^{5}} \cdot -0.5625\right) + -0.16666666666666666 \cdot \frac{1.265625 \cdot t_0 + 5.0625 \cdot t_0}{a \cdot {b}^{7}}\right)\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (pow (* c a) 4.0)))
   (if (<= (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)) -2.0)
     (* (+ (- b) (sqrt (- (* b b) (* c (* a 3.0))))) (/ 0.3333333333333333 a))
     (+
      (+ (* -0.5 (/ c b)) (* a (* (/ (pow c 2.0) (pow b 3.0)) -0.375)))
      (+
       (* (pow a 2.0) (* (/ (pow c 3.0) (pow b 5.0)) -0.5625))
       (*
        -0.16666666666666666
        (/ (+ (* 1.265625 t_0) (* 5.0625 t_0)) (* a (pow b 7.0)))))))))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
double code(double a, double b, double c) {
	double t_0 = pow((c * a), 4.0);
	double tmp;
	if (((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)) <= -2.0) {
		tmp = (-b + sqrt(((b * b) - (c * (a * 3.0))))) * (0.3333333333333333 / a);
	} else {
		tmp = ((-0.5 * (c / b)) + (a * ((pow(c, 2.0) / pow(b, 3.0)) * -0.375))) + ((pow(a, 2.0) * ((pow(c, 3.0) / pow(b, 5.0)) * -0.5625)) + (-0.16666666666666666 * (((1.265625 * t_0) + (5.0625 * t_0)) / (a * 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) - ((3.0d0 * a) * c)))) / (3.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 = (c * a) ** 4.0d0
    if (((-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)) <= (-2.0d0)) then
        tmp = (-b + sqrt(((b * b) - (c * (a * 3.0d0))))) * (0.3333333333333333d0 / a)
    else
        tmp = (((-0.5d0) * (c / b)) + (a * (((c ** 2.0d0) / (b ** 3.0d0)) * (-0.375d0)))) + (((a ** 2.0d0) * (((c ** 3.0d0) / (b ** 5.0d0)) * (-0.5625d0))) + ((-0.16666666666666666d0) * (((1.265625d0 * t_0) + (5.0625d0 * t_0)) / (a * (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) - ((3.0 * a) * c)))) / (3.0 * a);
}
public static double code(double a, double b, double c) {
	double t_0 = Math.pow((c * a), 4.0);
	double tmp;
	if (((-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)) <= -2.0) {
		tmp = (-b + Math.sqrt(((b * b) - (c * (a * 3.0))))) * (0.3333333333333333 / a);
	} else {
		tmp = ((-0.5 * (c / b)) + (a * ((Math.pow(c, 2.0) / Math.pow(b, 3.0)) * -0.375))) + ((Math.pow(a, 2.0) * ((Math.pow(c, 3.0) / Math.pow(b, 5.0)) * -0.5625)) + (-0.16666666666666666 * (((1.265625 * t_0) + (5.0625 * t_0)) / (a * Math.pow(b, 7.0)))));
	}
	return tmp;
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
def code(a, b, c):
	t_0 = math.pow((c * a), 4.0)
	tmp = 0
	if ((-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)) <= -2.0:
		tmp = (-b + math.sqrt(((b * b) - (c * (a * 3.0))))) * (0.3333333333333333 / a)
	else:
		tmp = ((-0.5 * (c / b)) + (a * ((math.pow(c, 2.0) / math.pow(b, 3.0)) * -0.375))) + ((math.pow(a, 2.0) * ((math.pow(c, 3.0) / math.pow(b, 5.0)) * -0.5625)) + (-0.16666666666666666 * (((1.265625 * t_0) + (5.0625 * t_0)) / (a * math.pow(b, 7.0)))))
	return tmp
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
function code(a, b, c)
	t_0 = Float64(c * a) ^ 4.0
	tmp = 0.0
	if (Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) <= -2.0)
		tmp = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0))))) * Float64(0.3333333333333333 / a));
	else
		tmp = Float64(Float64(Float64(-0.5 * Float64(c / b)) + Float64(a * Float64(Float64((c ^ 2.0) / (b ^ 3.0)) * -0.375))) + Float64(Float64((a ^ 2.0) * Float64(Float64((c ^ 3.0) / (b ^ 5.0)) * -0.5625)) + Float64(-0.16666666666666666 * Float64(Float64(Float64(1.265625 * t_0) + Float64(5.0625 * t_0)) / Float64(a * (b ^ 7.0))))));
	end
	return tmp
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
end
function tmp_2 = code(a, b, c)
	t_0 = (c * a) ^ 4.0;
	tmp = 0.0;
	if (((-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)) <= -2.0)
		tmp = (-b + sqrt(((b * b) - (c * (a * 3.0))))) * (0.3333333333333333 / a);
	else
		tmp = ((-0.5 * (c / b)) + (a * (((c ^ 2.0) / (b ^ 3.0)) * -0.375))) + (((a ^ 2.0) * (((c ^ 3.0) / (b ^ 5.0)) * -0.5625)) + (-0.16666666666666666 * (((1.265625 * t_0) + (5.0625 * t_0)) / (a * (b ^ 7.0)))));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_] := Block[{t$95$0 = N[Power[N[(c * a), $MachinePrecision], 4.0], $MachinePrecision]}, If[LessEqual[N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], -2.0], N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision] * -0.5625), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * N[(N[(N[(1.265625 * t$95$0), $MachinePrecision] + N[(5.0625 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(a * N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\begin{array}{l}
t_0 := {\left(c \cdot a\right)}^{4}\\
\mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \leq -2:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{0.3333333333333333}{a}\\

\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\right) + \left({a}^{2} \cdot \left(\frac{{c}^{3}}{{b}^{5}} \cdot -0.5625\right) + -0.16666666666666666 \cdot \frac{1.265625 \cdot t_0 + 5.0625 \cdot t_0}{a \cdot {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 3 a) c)))) (*.f64 3 a)) < -2

    1. Initial program 10.6

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Simplified10.6

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

      [Start]10.6

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

      rational.json-simplify-2 [=>]10.6

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

      rational.json-simplify-43 [=>]10.6

      \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Applied egg-rr10.6

      \[\leadsto \color{blue}{\left(\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}\right) \cdot \frac{0.3333333333333333}{a} + 0} \]
    4. Simplified10.6

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

      [Start]10.6

      \[ \left(\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}\right) \cdot \frac{0.3333333333333333}{a} + 0 \]

      rational.json-simplify-4 [=>]10.6

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

      rational.json-simplify-2 [=>]10.6

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

      rational.json-simplify-43 [=>]10.6

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

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

    1. Initial program 30.9

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

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

      [Start]30.9

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

      rational.json-simplify-2 [=>]30.9

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

      rational.json-simplify-2 [=>]30.9

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

      rational.json-simplify-43 [=>]30.9

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

      \[\leadsto \color{blue}{-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\right)} \]
    4. Simplified4.7

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\right) + \left({a}^{2} \cdot \left(\frac{{c}^{3}}{{b}^{5}} \cdot -0.5625\right) + -0.16666666666666666 \cdot \frac{1.265625 \cdot {\left(c \cdot a\right)}^{4} + 5.0625 \cdot {\left(c \cdot a\right)}^{4}}{a \cdot {b}^{7}}\right)} \]
      Proof

      [Start]4.7

      \[ -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\right) \]

      rational.json-simplify-41 [<=]4.7

      \[ \color{blue}{\left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right) + \left(-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + -0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}}\right)} \]

      rational.json-simplify-49 [=>]4.7

      \[ \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \color{blue}{\left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)}\right) + \left(-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + -0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}}\right) \]

      rational.json-simplify-43 [=>]4.7

      \[ \left(-0.5 \cdot \frac{c}{b} + \color{blue}{a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)}\right) + \left(-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + -0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}}\right) \]

      rational.json-simplify-49 [=>]4.7

      \[ \left(-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\right) + \left(-0.5625 \cdot \color{blue}{\left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right)} + -0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}}\right) \]

      rational.json-simplify-43 [=>]4.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \leq -2:\\ \;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\right) + \left({a}^{2} \cdot \left(\frac{{c}^{3}}{{b}^{5}} \cdot -0.5625\right) + -0.16666666666666666 \cdot \frac{1.265625 \cdot {\left(c \cdot a\right)}^{4} + 5.0625 \cdot {\left(c \cdot a\right)}^{4}}{a \cdot {b}^{7}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error5.4
Cost54724
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \leq -2:\\ \;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + \left({a}^{2} \cdot \left(-0.5625 \cdot \frac{{c}^{3}}{{b}^{5}}\right) + \left(a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right) + -1.0546875 \cdot \frac{{\left(c \cdot a\right)}^{4}}{a \cdot {b}^{7}}\right)\right)\\ \end{array} \]
Alternative 2
Error5.6
Cost48644
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \leq -2:\\ \;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{a} \cdot \left(-0.5 \cdot \frac{c \cdot a}{b} + \left(-0.375 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + \left(-0.5625 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}} + -0.16666666666666666 \cdot \frac{{\left(c \cdot a\right)}^{4} \cdot 6.328125}{{b}^{7}}\right)\right)\right)\\ \end{array} \]
Alternative 3
Error10.3
Cost36236
\[\begin{array}{l} t_0 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ t_1 := -0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\\ \mathbf{if}\;t_0 \leq -0.1:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a} \cdot 0.3333333333333333\\ \mathbf{elif}\;t_0 \leq -0.00025:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error10.3
Cost36236
\[\begin{array}{l} t_0 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -0.1:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a} \cdot 0.3333333333333333\\ \mathbf{elif}\;t_0 \leq -0.00025:\\ \;\;\;\;0.16666666666666666 \cdot \frac{c \cdot \left(\frac{a}{b} \cdot -3\right) + \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} \cdot -2.25}{a}\\ \mathbf{elif}\;t_0 \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\\ \end{array} \]
Alternative 5
Error10.3
Cost36236
\[\begin{array}{l} t_0 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -0.1:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a} \cdot 0.3333333333333333\\ \mathbf{elif}\;t_0 \leq -0.00025:\\ \;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot -1.5\right) + -1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}}}{3 \cdot a}\\ \mathbf{elif}\;t_0 \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\\ \end{array} \]
Alternative 6
Error10.3
Cost36236
\[\begin{array}{l} t_0 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -0.1:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a} \cdot 0.3333333333333333\\ \mathbf{elif}\;t_0 \leq -0.00025:\\ \;\;\;\;-\frac{\left(a \cdot \left(-1.5 \cdot \frac{c}{b}\right) + -1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}}\right) \cdot -0.3333333333333333}{a}\\ \mathbf{elif}\;t_0 \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\\ \end{array} \]
Alternative 7
Error6.9
Cost33796
\[\begin{array}{l} \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.6666666666666666\right) \cdot 1.5}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\\ \end{array} \]
Alternative 8
Error6.9
Cost33796
\[\begin{array}{l} \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.6666666666666666\right) \cdot 1.5}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + \left(a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right) + {a}^{2} \cdot \left(\frac{{c}^{3}}{{b}^{5}} \cdot -0.5625\right)\right)\\ \end{array} \]
Alternative 9
Error7.1
Cost27716
\[\begin{array}{l} \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.6666666666666666\right) \cdot 1.5}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{c}{b} \cdot \left(-1.5 \cdot a\right) + \left(-1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + -1.6875 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}}\right)}{a}\\ \end{array} \]
Alternative 10
Error7.1
Cost27716
\[\begin{array}{l} \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\left(\left(\left(-b\right) + \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}\right) \cdot 0.6666666666666666\right) \cdot 1.5}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{a} \cdot \left(-0.5 \cdot \frac{c \cdot a}{b} + \left(-0.375 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + -0.5625 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}}\right)\right)\\ \end{array} \]
Alternative 11
Error15.4
Cost14916
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \leq -3.1 \cdot 10^{-8}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 12
Error16.4
Cost7556
\[\begin{array}{l} \mathbf{if}\;b \leq 985:\\ \;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 13
Error16.4
Cost7556
\[\begin{array}{l} \mathbf{if}\;b \leq 985:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a} \cdot 0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 14
Error22.9
Cost320
\[-0.5 \cdot \frac{c}{b} \]

Error

Reproduce?

herbie shell --seed 2023068 
(FPCore (a b c)
  :name "Cubic critical, 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) (* (* 3.0 a) c)))) (* 3.0 a)))