Average Error: 34.1 → 10.3
Time: 23.6s
Precision: binary64
Cost: 7624
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
\[\begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{+148}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \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
 (if (<= b -2.7e+148)
   (* (/ b a) -0.6666666666666666)
   (if (<= b 1.85e-30)
     (/ (- (sqrt (+ (* b b) (* c (* a -3.0)))) b) (* a 3.0))
     (/ (* c -0.5) b))))
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 tmp;
	if (b <= -2.7e+148) {
		tmp = (b / a) * -0.6666666666666666;
	} else if (b <= 1.85e-30) {
		tmp = (sqrt(((b * b) + (c * (a * -3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	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) :: tmp
    if (b <= (-2.7d+148)) then
        tmp = (b / a) * (-0.6666666666666666d0)
    else if (b <= 1.85d-30) then
        tmp = (sqrt(((b * b) + (c * (a * (-3.0d0))))) - b) / (a * 3.0d0)
    else
        tmp = (c * (-0.5d0)) / b
    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 tmp;
	if (b <= -2.7e+148) {
		tmp = (b / a) * -0.6666666666666666;
	} else if (b <= 1.85e-30) {
		tmp = (Math.sqrt(((b * b) + (c * (a * -3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	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):
	tmp = 0
	if b <= -2.7e+148:
		tmp = (b / a) * -0.6666666666666666
	elif b <= 1.85e-30:
		tmp = (math.sqrt(((b * b) + (c * (a * -3.0)))) - b) / (a * 3.0)
	else:
		tmp = (c * -0.5) / b
	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)
	tmp = 0.0
	if (b <= -2.7e+148)
		tmp = Float64(Float64(b / a) * -0.6666666666666666);
	elseif (b <= 1.85e-30)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	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)
	tmp = 0.0;
	if (b <= -2.7e+148)
		tmp = (b / a) * -0.6666666666666666;
	elseif (b <= 1.85e-30)
		tmp = (sqrt(((b * b) + (c * (a * -3.0)))) - b) / (a * 3.0);
	else
		tmp = (c * -0.5) / b;
	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_] := If[LessEqual[b, -2.7e+148], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 1.85e-30], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{+148}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\

\mathbf{elif}\;b \leq 1.85 \cdot 10^{-30}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if b < -2.70000000000000019e148

    1. Initial program 61.6

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{-0.3333333333333333}{a}} \]
      Proof
      (*.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c -3))))) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c (Rewrite<= metadata-eval (neg.f64 3))))))) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a c) (neg.f64 3)))))) (/.f64 -1/3 a)): 4 points increase in error, 10 points decrease in error
      (*.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (*.f64 a c) 3)))))) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 3 (*.f64 a c))))))) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 3 a) c)))))) (/.f64 -1/3 a)): 8 points increase in error, 6 points decrease in error
      (*.f64 (-.f64 b (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= /-rgt-identity_binary64 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) 1)) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite<= metadata-eval (/.f64 -1 -1))) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1)) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))) -1) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 b)) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (/.f64 -1/3 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (/.f64 (Rewrite<= metadata-eval (/.f64 -1 3)) a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (Rewrite<= associate-/r*_binary64 (/.f64 -1 (*.f64 3 a)))): 20 points increase in error, 22 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (*.f64 -1 (*.f64 3 a)))): 6 points increase in error, 22 points decrease in error
      (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 3 a) -1))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> times-frac_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) (/.f64 -1 -1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) (Rewrite=> metadata-eval 1)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) (Rewrite<= metadata-eval (neg.f64 -1))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (/.f64 (*.f64 3 a) (neg.f64 -1)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (/.f64 (*.f64 3 a) (Rewrite=> metadata-eval 1))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite=> /-rgt-identity_binary64 (*.f64 3 a))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in b around -inf 2.3

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    4. Simplified2.3

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      Proof
      (*.f64 (/.f64 b a) -2/3): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 -2/3 (/.f64 b a))): 0 points increase in error, 0 points decrease in error

    if -2.70000000000000019e148 < b < 1.8500000000000002e-30

    1. Initial program 14.3

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

    if 1.8500000000000002e-30 < b

    1. Initial program 55.0

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

      \[\leadsto \color{blue}{\frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a} \cdot -0.3333333333333333} \]
      Proof
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c -3))))) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c (Rewrite<= metadata-eval (neg.f64 3))))))) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a c) (neg.f64 3)))))) a) -1/3): 4 points increase in error, 6 points decrease in error
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (*.f64 a c) 3)))))) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 3 (*.f64 a c))))))) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (fma.f64 b b (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 3 a) c)))))) a) -1/3): 5 points increase in error, 6 points decrease in error
      (*.f64 (/.f64 (-.f64 b (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (Rewrite<= /-rgt-identity_binary64 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) 1)) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite<= metadata-eval (/.f64 -1 -1))) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1)) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (/.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (/.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))) -1) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (/.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 b)) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) a) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= associate-/r*_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 -1 a))) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite<= neg-mul-1_binary64 (neg.f64 a))) -1/3): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (neg.f64 a)) (Rewrite<= metadata-eval (/.f64 -1 3))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (*.f64 (neg.f64 a) 3))): 15 points increase in error, 35 points decrease in error
      (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 a 3)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 3 a)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (*.f64 3 a)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 3 a) -1))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> times-frac_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) (/.f64 -1 -1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) (Rewrite=> metadata-eval 1)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) (Rewrite<= metadata-eval (neg.f64 -1))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (/.f64 (*.f64 3 a) (neg.f64 -1)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (/.f64 (*.f64 3 a) (Rewrite=> metadata-eval 1))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite=> /-rgt-identity_binary64 (*.f64 3 a))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in b around inf 6.9

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    4. Simplified6.9

      \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
      Proof
      (/.f64 (*.f64 c -1/2) b): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 c b) -1/2)): 2 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 -1/2 (/.f64 c b))): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification10.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{+148}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-30}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error10.4
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{+148}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 2
Error13.9
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{-122}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-54}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 3
Error13.9
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{-122}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-52}:\\ \;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -3\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 4
Error13.9
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{-122}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 10^{-50}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 5
Error13.9
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{-122}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 1.65 \cdot 10^{-49}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 6
Error53.7
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 1.75 \cdot 10^{+25}:\\ \;\;\;\;\frac{b}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 7
Error39.7
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 7 \cdot 10^{+25}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 8
Error22.6
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-297}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
Alternative 9
Error22.6
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-297}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
Alternative 10
Error22.6
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 1.35 \cdot 10^{-297}:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
Alternative 11
Error22.6
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-297}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
Alternative 12
Error22.5
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 5 \cdot 10^{-297}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 13
Error59.2
Cost320
\[\frac{b}{a} \cdot -0.3333333333333333 \]

Error

Reproduce

herbie shell --seed 2022329 
(FPCore (a b c)
  :name "Cubic critical"
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))