Average Error: 33.8 → 10.4
Time: 19.1s
Precision: binary64
Cost: 13896
\[\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 -1.18 \cdot 10^{+145}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666 + \left(c \cdot \frac{a}{b}\right) \cdot 0.5}{a}\\ \mathbf{elif}\;b \leq 6.9 \cdot 10^{-125}:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{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 -1.18e+145)
   (/ (+ (* b -0.6666666666666666) (* (* c (/ a b)) 0.5)) a)
   (if (<= b 6.9e-125)
     (/ (/ (- b (sqrt (fma a (* c -3.0) (* b b)))) a) -3.0)
     (* -0.5 (/ c 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 <= -1.18e+145) {
		tmp = ((b * -0.6666666666666666) + ((c * (a / b)) * 0.5)) / a;
	} else if (b <= 6.9e-125) {
		tmp = ((b - sqrt(fma(a, (c * -3.0), (b * b)))) / a) / -3.0;
	} else {
		tmp = -0.5 * (c / 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 <= -1.18e+145)
		tmp = Float64(Float64(Float64(b * -0.6666666666666666) + Float64(Float64(c * Float64(a / b)) * 0.5)) / a);
	elseif (b <= 6.9e-125)
		tmp = Float64(Float64(Float64(b - sqrt(fma(a, Float64(c * -3.0), Float64(b * b)))) / a) / -3.0);
	else
		tmp = Float64(-0.5 * Float64(c / 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, -1.18e+145], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] + N[(N[(c * N[(a / b), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 6.9e-125], N[(N[(N[(b - N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $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 -1.18 \cdot 10^{+145}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666 + \left(c \cdot \frac{a}{b}\right) \cdot 0.5}{a}\\

\mathbf{elif}\;b \leq 6.9 \cdot 10^{-125}:\\
\;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{a}}{-3}\\

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


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if b < -1.17999999999999998e145

    1. Initial program 60.3

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{3 \cdot a}} \]
      Proof
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c -3)))) b) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c (Rewrite<= metadata-eval (neg.f64 3)))))) b) (*.f64 3 a)): 0 points increase in error, 1 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a c) (neg.f64 3))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 3) (*.f64 a c))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 3 (*.f64 a c)))))) b) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 3 a) c))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) b) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))) (neg.f64 b))) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (neg.f64 b)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) b))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (neg.f64 (Rewrite<= +-commutative_binary64 (+.f64 b (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))))) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (Rewrite<= /-rgt-identity_binary64 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) 1))) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite<= metadata-eval (/.f64 -1 -1)))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1))) (*.f64 3 a)): 3 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 25 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 b)) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (/.f64 -1 (*.f64 3 a)))): 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 -1 (*.f64 3 a)))): 0 points increase in error, 28 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))): 28 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, 28 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, 27 points decrease in error
      (Rewrite=> *-rgt-identity_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))): 28 points increase in error, 0 points decrease in error
    3. Applied egg-rr36.9

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

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

      \[\leadsto \frac{1}{a} \cdot \color{blue}{\mathsf{fma}\left(\frac{c}{b} \cdot \left(a \cdot -3\right), -0.16666666666666666, b \cdot -0.6666666666666666\right)} \]
      Proof
      (*.f64 (/.f64 1 a) (fma.f64 (*.f64 (/.f64 c b) (*.f64 a -3)) -1/6 (*.f64 b -2/3))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 1 a) (fma.f64 (*.f64 (/.f64 c b) (*.f64 a (Rewrite<= rem-square-sqrt_binary64 (*.f64 (sqrt.f64 -3) (sqrt.f64 -3))))) -1/6 (*.f64 b -2/3))): 1 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 1 a) (fma.f64 (*.f64 (/.f64 c b) (*.f64 a (Rewrite<= unpow2_binary64 (pow.f64 (sqrt.f64 -3) 2)))) -1/6 (*.f64 b -2/3))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 1 a) (fma.f64 (Rewrite<= associate-/r/_binary64 (/.f64 c (/.f64 b (*.f64 a (pow.f64 (sqrt.f64 -3) 2))))) -1/6 (*.f64 b -2/3))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 1 a) (fma.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 c (*.f64 a (pow.f64 (sqrt.f64 -3) 2))) b)) -1/6 (*.f64 b -2/3))): 1 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 1 a) (fma.f64 (/.f64 (*.f64 c (*.f64 a (pow.f64 (sqrt.f64 -3) 2))) b) -1/6 (Rewrite<= *-commutative_binary64 (*.f64 -2/3 b)))): 1 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 1 a) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (*.f64 c (*.f64 a (pow.f64 (sqrt.f64 -3) 2))) b) -1/6) (*.f64 -2/3 b)))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 1 a) (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1/6 (/.f64 (*.f64 c (*.f64 a (pow.f64 (sqrt.f64 -3) 2))) b))) (*.f64 -2/3 b))): 0 points increase in error, 0 points decrease in error
    6. Applied egg-rr3.0

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

    if -1.17999999999999998e145 < b < 6.89999999999999973e-125

    1. Initial program 11.2

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right) \cdot \frac{-0.3333333333333333}{a}} \]
      Proof
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c -3)))) b) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c (Rewrite<= metadata-eval (neg.f64 3)))))) b) (*.f64 3 a)): 0 points increase in error, 1 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a c) (neg.f64 3))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 3) (*.f64 a c))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 3 (*.f64 a c)))))) b) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 3 a) c))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) b) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))) (neg.f64 b))) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (neg.f64 b)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) b))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (neg.f64 (Rewrite<= +-commutative_binary64 (+.f64 b (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))))) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (Rewrite<= /-rgt-identity_binary64 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) 1))) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite<= metadata-eval (/.f64 -1 -1)))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1))) (*.f64 3 a)): 3 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 25 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 b)) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (/.f64 -1 (*.f64 3 a)))): 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 -1 (*.f64 3 a)))): 0 points increase in error, 28 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))): 28 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, 28 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, 27 points decrease in error
      (Rewrite=> *-rgt-identity_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))): 28 points increase in error, 0 points decrease in error
    3. Applied egg-rr11.3

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

    if 6.89999999999999973e-125 < b

    1. Initial program 51.3

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right) \cdot \frac{-0.3333333333333333}{a}} \]
      Proof
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c -3)))) b) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (*.f64 a (*.f64 c (Rewrite<= metadata-eval (neg.f64 3)))))) b) (*.f64 3 a)): 0 points increase in error, 1 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a c) (neg.f64 3))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 3) (*.f64 a c))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (Rewrite<= distribute-lft-neg-in_binary64 (neg.f64 (*.f64 3 (*.f64 a c)))))) b) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (fma.f64 b b (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 3 a) c))))) b) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) b) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))) (neg.f64 b))) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (neg.f64 b)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) b))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (neg.f64 (Rewrite<= +-commutative_binary64 (+.f64 b (neg.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))))) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 (Rewrite<= sub-neg_binary64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (*.f64 3 a)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite=> neg-mul-1_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (Rewrite<= /-rgt-identity_binary64 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) 1))) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (Rewrite<= metadata-eval (/.f64 -1 -1)))) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1))) (*.f64 3 a)): 3 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 25 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= neg-mul-1_binary64 (neg.f64 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 b (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))))) -1)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c))))) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 -1 (/.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 b)) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1)) (*.f64 3 a)): 0 points increase in error, 28 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) -1)) (*.f64 3 a)): 28 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) -1) (/.f64 -1 (*.f64 3 a)))): 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 -1 (*.f64 3 a)))): 0 points increase in error, 28 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))): 28 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, 28 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, 27 points decrease in error
      (Rewrite=> *-rgt-identity_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))): 28 points increase in error, 0 points decrease in error
    3. Taylor expanded in b around inf 11.4

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.18 \cdot 10^{+145}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666 + \left(c \cdot \frac{a}{b}\right) \cdot 0.5}{a}\\ \mathbf{elif}\;b \leq 6.9 \cdot 10^{-125}:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error10.4
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -4.1 \cdot 10^{+153}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666 + \left(c \cdot \frac{a}{b}\right) \cdot 0.5}{a}\\ \mathbf{elif}\;b \leq 6.9 \cdot 10^{-125}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + -3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 2
Error10.4
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -6.2 \cdot 10^{+153}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666 + \left(c \cdot \frac{a}{b}\right) \cdot 0.5}{a}\\ \mathbf{elif}\;b \leq 6.9 \cdot 10^{-125}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 3
Error36.6
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 2.3 \cdot 10^{-209}:\\ \;\;\;\;b \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 4
Error23.0
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 1.85 \cdot 10^{-209}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 5
Error23.0
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{-210}:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 6
Error23.0
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{-210}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 7
Error23.0
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 1.2 \cdot 10^{-209}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 8
Error39.7
Cost320
\[-0.5 \cdot \frac{c}{b} \]

Error

Reproduce

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