Average Error: 34.1 → 9.8
Time: 15.7s
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.9 \cdot 10^{+123}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot c, \frac{1}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-94}:\\ \;\;\;\;\left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \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.9e+123)
   (fma (* 0.5 c) (/ 1.0 b) (/ -0.6666666666666666 (/ a b)))
   (if (<= b 1.5e-94)
     (* (- b (sqrt (+ (* b b) (* a (* c -3.0))))) (/ -0.3333333333333333 a))
     (/ (* 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.9e+123) {
		tmp = fma((0.5 * c), (1.0 / b), (-0.6666666666666666 / (a / b)));
	} else if (b <= 1.5e-94) {
		tmp = (b - sqrt(((b * b) + (a * (c * -3.0))))) * (-0.3333333333333333 / a);
	} 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.9e+123)
		tmp = fma(Float64(0.5 * c), Float64(1.0 / b), Float64(-0.6666666666666666 / Float64(a / b)));
	elseif (b <= 1.5e-94)
		tmp = Float64(Float64(b - sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -3.0))))) * Float64(-0.3333333333333333 / a));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return 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.9e+123], N[(N[(0.5 * c), $MachinePrecision] * N[(1.0 / b), $MachinePrecision] + N[(-0.6666666666666666 / N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-94], N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $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.9 \cdot 10^{+123}:\\
\;\;\;\;\mathsf{fma}\left(0.5 \cdot c, \frac{1}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\

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

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


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if b < -2.9000000000000001e123

    1. Initial program 53.5

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

      \[\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): 5 points increase in error, 4 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): 7 points increase in error, 2 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))): 12 points increase in error, 29 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 3.3

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    4. Applied egg-rr3.3

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

    if -2.9000000000000001e123 < b < 1.5000000000000001e-94

    1. Initial program 11.4

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

      \[\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)): 10 points increase in error, 2 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)): 5 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)))): 16 points increase in error, 17 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)))): 11 points increase in error, 19 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. Applied egg-rr11.5

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

    if 1.5000000000000001e-94 < b

    1. Initial program 52.7

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

      \[\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): 5 points increase in error, 4 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): 7 points increase in error, 2 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))): 12 points increase in error, 29 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. Applied egg-rr47.6

      \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{a}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}} \]
    4. Taylor expanded in b around inf 64.0

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    5. Simplified10.1

      \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
      Proof
      (/.f64 (*.f64 -1/2 c) b): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (Rewrite<= metadata-eval (*.f64 1/6 -3)) c) b): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 1/6 (*.f64 -3 c))) b): 36 points increase in error, 29 points decrease in error
      (/.f64 (*.f64 1/6 (*.f64 (Rewrite<= rem-square-sqrt_binary64 (*.f64 (sqrt.f64 -3) (sqrt.f64 -3))) c)) b): 245 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 1/6 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 (sqrt.f64 -3) 2)) c)) b): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 1/6 (Rewrite<= *-commutative_binary64 (*.f64 c (pow.f64 (sqrt.f64 -3) 2)))) b): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 1/6 (/.f64 (*.f64 c (pow.f64 (sqrt.f64 -3) 2)) b))): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification9.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{+123}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot c, \frac{1}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-94}:\\ \;\;\;\;\left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error13.2
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -1.6 \cdot 10^{-70}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-94}:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{a \cdot \left(c \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 2
Error22.5
Cost836
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\ \;\;\;\;0.5 \cdot \frac{c}{b} + -0.6666666666666666 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 3
Error22.5
Cost836
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 4
Error36.7
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 4.8 \cdot 10^{-240}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 5
Error22.5
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 1.66 \cdot 10^{-242}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 6
Error22.5
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 4.6 \cdot 10^{-240}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 7
Error22.5
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 4.6 \cdot 10^{-240}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 8
Error40.0
Cost320
\[-0.5 \cdot \frac{c}{b} \]

Error

Reproduce

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