?

Average Error: 34.5 → 7.2
Time: 28.6s
Precision: binary64
Cost: 13964

?

\[\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.55 \cdot 10^{+95}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, \frac{c}{\frac{b}{a}} \cdot 0.5\right)}{a}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-294}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.85 \cdot 10^{+78}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}\\ \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.55e+95)
   (/ (fma b -0.6666666666666666 (* (/ c (/ b a)) 0.5)) a)
   (if (<= b 4.8e-294)
     (/ (- (sqrt (+ (* b b) (* c (* a -3.0)))) b) (* a 3.0))
     (if (<= b 2.85e+78)
       (/ c (- (- b) (sqrt (fma b b (* a (* c -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.55e+95) {
		tmp = fma(b, -0.6666666666666666, ((c / (b / a)) * 0.5)) / a;
	} else if (b <= 4.8e-294) {
		tmp = (sqrt(((b * b) + (c * (a * -3.0)))) - b) / (a * 3.0);
	} else if (b <= 2.85e+78) {
		tmp = c / (-b - sqrt(fma(b, b, (a * (c * -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.55e+95)
		tmp = Float64(fma(b, -0.6666666666666666, Float64(Float64(c / Float64(b / a)) * 0.5)) / a);
	elseif (b <= 4.8e-294)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -3.0)))) - b) / Float64(a * 3.0));
	elseif (b <= 2.85e+78)
		tmp = Float64(c / Float64(Float64(-b) - sqrt(fma(b, b, Float64(a * Float64(c * -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.55e+95], N[(N[(b * -0.6666666666666666 + N[(N[(c / N[(b / a), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 4.8e-294], 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], If[LessEqual[b, 2.85e+78], N[(c / N[((-b) - N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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.55 \cdot 10^{+95}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, \frac{c}{\frac{b}{a}} \cdot 0.5\right)}{a}\\

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

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

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


\end{array}

Error?

Derivation?

  1. Split input into 4 regimes
  2. if b < -1.5500000000000001e95

    1. Initial program 45.9

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

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

      [Start]45.9

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

      remove-double-neg [<=]45.9

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

      sub-neg [<=]45.9

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

      div-sub [=>]45.9

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

      neg-mul-1 [=>]45.9

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

      associate-*l/ [<=]45.9

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

      distribute-frac-neg [=>]45.9

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

      fma-neg [=>]45.9

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

      /-rgt-identity [<=]45.9

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

      metadata-eval [<=]45.9

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

      associate-/l* [<=]45.9

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

      *-commutative [<=]45.9

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

      neg-mul-1 [<=]45.9

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

      fma-neg [<=]45.9

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

      neg-mul-1 [=>]45.9

      \[ \frac{-1}{3 \cdot a} \cdot \frac{-b}{-1} - \color{blue}{-1 \cdot \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}} \]
    3. Applied egg-rr45.9

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

      \[\leadsto \frac{\color{blue}{0.5 \cdot \frac{c \cdot a}{b} + -0.6666666666666666 \cdot b}}{a} \]
    5. Simplified4.3

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

      [Start]10.6

      \[ \frac{0.5 \cdot \frac{c \cdot a}{b} + -0.6666666666666666 \cdot b}{a} \]

      +-commutative [=>]10.6

      \[ \frac{\color{blue}{-0.6666666666666666 \cdot b + 0.5 \cdot \frac{c \cdot a}{b}}}{a} \]

      *-commutative [=>]10.6

      \[ \frac{\color{blue}{b \cdot -0.6666666666666666} + 0.5 \cdot \frac{c \cdot a}{b}}{a} \]

      fma-def [=>]10.6

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

      *-commutative [=>]10.6

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

      associate-/l* [=>]4.3

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

    if -1.5500000000000001e95 < b < 4.79999999999999994e-294

    1. Initial program 10.4

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

    if 4.79999999999999994e-294 < b < 2.84999999999999993e78

    1. Initial program 30.9

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

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

      [Start]30.9

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

      *-lft-identity [<=]30.9

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

      metadata-eval [<=]30.9

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

      times-frac [<=]30.9

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

      neg-mul-1 [<=]30.9

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

      distribute-rgt-neg-in [=>]30.9

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

      times-frac [=>]31.0

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

      *-commutative [=>]31.0

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

      \[\leadsto \color{blue}{\frac{\left(-\left(b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}}{-\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}} \]
    4. Simplified16.7

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

      [Start]31.0

      \[ \frac{\left(-\left(b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}}{-\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)} \]
    5. Taylor expanded in b around 0 9.0

      \[\leadsto \frac{\color{blue}{c}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right) - b} \]
    6. Applied egg-rr9.0

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

      \[\leadsto \frac{c}{\left(-\sqrt{\color{blue}{{b}^{2} + -3 \cdot \left(c \cdot a\right)}}\right) - b} \]
    8. Simplified9.0

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

      [Start]9.0

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

      unpow2 [=>]9.0

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

      associate-*r* [=>]9.0

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

      *-commutative [<=]9.0

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

      *-commutative [<=]9.0

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

      fma-udef [<=]9.0

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

    if 2.84999999999999993e78 < b

    1. Initial program 58.8

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

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

      [Start]58.8

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

      remove-double-neg [<=]58.8

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

      sub-neg [<=]58.8

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

      div-sub [=>]59.5

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

      neg-mul-1 [=>]59.5

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

      associate-*l/ [<=]60.2

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

      distribute-frac-neg [=>]60.2

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

      fma-neg [=>]62.6

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

      /-rgt-identity [<=]62.6

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

      metadata-eval [<=]62.6

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

      associate-/l* [<=]62.6

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

      *-commutative [<=]62.6

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

      neg-mul-1 [<=]62.6

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

      fma-neg [<=]60.2

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

      neg-mul-1 [=>]60.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.55 \cdot 10^{+95}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, \frac{c}{\frac{b}{a}} \cdot 0.5\right)}{a}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-294}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.85 \cdot 10^{+78}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error7.2
Cost13964
\[\begin{array}{l} \mathbf{if}\;b \leq -1.22 \cdot 10^{+95}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, \frac{c}{\frac{b}{a}} \cdot 0.5\right)}{a}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-294}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 2
Error7.4
Cost7692
\[\begin{array}{l} t_0 := \sqrt{b \cdot b + -3 \cdot \left(c \cdot a\right)}\\ \mathbf{if}\;b \leq -1.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, \frac{c}{\frac{b}{a}} \cdot 0.5\right)}{a}\\ \mathbf{elif}\;b \leq -3.8 \cdot 10^{-298}:\\ \;\;\;\;\frac{b - t_0}{a} \cdot -0.3333333333333333\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{+76}:\\ \;\;\;\;\frac{c}{\left(-b\right) - t_0}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 3
Error7.2
Cost7692
\[\begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{+95}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, \frac{c}{\frac{b}{a}} \cdot 0.5\right)}{a}\\ \mathbf{elif}\;b \leq -1.08 \cdot 10^{-305}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{b \cdot b + -3 \cdot \left(c \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 4
Error10.5
Cost7560
\[\begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{-48}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, \frac{c}{\frac{b}{a}} \cdot 0.5\right)}{a}\\ \mathbf{elif}\;b \leq 10^{+79}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{b \cdot b + -3 \cdot \left(c \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 5
Error14.0
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{-47}:\\ \;\;\;\;c \cdot \frac{0.5}{b} + b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 7.8 \cdot 10^{-84}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -3\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(-2, b, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}\\ \end{array} \]
Alternative 6
Error14.0
Cost7368
\[\begin{array}{l} t_0 := \frac{c}{\frac{b}{a}}\\ \mathbf{if}\;b \leq -1.9 \cdot 10^{-45}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -0.6666666666666666, t_0 \cdot 0.5\right)}{a}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-83}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -3\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(-2, b, t_0 \cdot 1.5\right)}\\ \end{array} \]
Alternative 7
Error14.0
Cost7304
\[\begin{array}{l} \mathbf{if}\;b \leq -1.15 \cdot 10^{-46}:\\ \;\;\;\;c \cdot \frac{0.5}{b} + b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-83}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{-3 \cdot \left(c \cdot a\right)}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 8
Error14.1
Cost7304
\[\begin{array}{l} \mathbf{if}\;b \leq -2.45 \cdot 10^{-48}:\\ \;\;\;\;c \cdot \frac{0.5}{b} + b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-85}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -3\right)}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 9
Error23.2
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 2.1 \cdot 10^{-276}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 10
Error23.1
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 3.6 \cdot 10^{-277}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 11
Error23.1
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 2.42 \cdot 10^{-275}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 12
Error40.1
Cost320
\[-0.5 \cdot \frac{c}{b} \]

Error

Reproduce?

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