?

Average Error: 34.5 → 9.6
Time: 24.4s
Precision: binary64
Cost: 14796

?

\[\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 -9.5 \cdot 10^{+120}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-75}:\\ \;\;\;\;\frac{\frac{b - \sqrt{-3 \cdot \left(a \cdot c\right) + b \cdot b}}{a}}{-3}\\ \mathbf{elif}\;b \leq 4000:\\ \;\;\;\;\frac{b \cdot \left(b - b\right) + c \cdot \left(a \cdot 3\right)}{\frac{b + \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}{\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 -9.5e+120)
   (/ (/ (* b 2.0) -3.0) a)
   (if (<= b 1.25e-75)
     (/ (/ (- b (sqrt (+ (* -3.0 (* a c)) (* b b)))) a) -3.0)
     (if (<= b 4000.0)
       (/
        (+ (* b (- b b)) (* c (* a 3.0)))
        (/ (+ b (sqrt (fma a (* -3.0 c) (* b b)))) (/ -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 <= -9.5e+120) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 1.25e-75) {
		tmp = ((b - sqrt(((-3.0 * (a * c)) + (b * b)))) / a) / -3.0;
	} else if (b <= 4000.0) {
		tmp = ((b * (b - b)) + (c * (a * 3.0))) / ((b + sqrt(fma(a, (-3.0 * c), (b * b)))) / (-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 <= -9.5e+120)
		tmp = Float64(Float64(Float64(b * 2.0) / -3.0) / a);
	elseif (b <= 1.25e-75)
		tmp = Float64(Float64(Float64(b - sqrt(Float64(Float64(-3.0 * Float64(a * c)) + Float64(b * b)))) / a) / -3.0);
	elseif (b <= 4000.0)
		tmp = Float64(Float64(Float64(b * Float64(b - b)) + Float64(c * Float64(a * 3.0))) / Float64(Float64(b + sqrt(fma(a, Float64(-3.0 * c), Float64(b * b)))) / 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, -9.5e+120], N[(N[(N[(b * 2.0), $MachinePrecision] / -3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.25e-75], N[(N[(N[(b - N[Sqrt[N[(N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 4000.0], N[(N[(N[(b * N[(b - b), $MachinePrecision]), $MachinePrecision] + N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b + N[Sqrt[N[(a * N[(-3.0 * c), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(-0.3333333333333333 / a), $MachinePrecision]), $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 -9.5 \cdot 10^{+120}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\

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

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

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


\end{array}

Error?

Derivation?

  1. Split input into 4 regimes
  2. if b < -9.5e120

    1. Initial program 52.4

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

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

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

      [Start]52.4

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

      *-commutative [<=]52.4

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

      associate-*l/ [=>]52.4

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

      *-lft-identity [=>]52.4

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

      fma-def [<=]52.4

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

      +-commutative [=>]52.4

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

      fma-def [=>]52.4

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

      *-commutative [=>]52.4

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

      \[\leadsto \frac{\frac{\color{blue}{2 \cdot b}}{-3}}{a} \]
    5. Simplified3.8

      \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{-3}}{a} \]
      Proof

      [Start]3.8

      \[ \frac{\frac{2 \cdot b}{-3}}{a} \]

      *-commutative [=>]3.8

      \[ \frac{\frac{\color{blue}{b \cdot 2}}{-3}}{a} \]

    if -9.5e120 < b < 1.24999999999999995e-75

    1. Initial program 12.9

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

      \[\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]12.9

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

      remove-double-neg [<=]12.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 [<=]12.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 [=>]12.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 [=>]12.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/ [<=]12.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 [=>]12.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 [=>]12.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 [<=]12.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 [<=]12.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* [<=]12.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 [<=]12.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 [<=]12.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 [<=]12.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 [=>]12.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-rr13.0

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

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

    if 1.24999999999999995e-75 < b < 4e3

    1. Initial program 39.3

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

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

      [Start]39.3

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

      *-lft-identity [<=]39.3

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

      metadata-eval [<=]39.3

      \[ \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 [<=]39.3

      \[ \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 [<=]39.3

      \[ \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 [=>]39.3

      \[ \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 [=>]39.4

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

      *-commutative [=>]39.4

      \[ \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-rr42.8

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

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

      [Start]42.8

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

      associate-/r* [=>]39.4

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

      associate-*r/ [<=]39.4

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

      associate-/l* [=>]42.8

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

      fma-udef [=>]42.8

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

      associate-*l* [<=]42.8

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

      +-commutative [=>]42.8

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

      associate--r+ [=>]20.5

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

      distribute-lft-out-- [=>]20.5

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

      associate-*l* [=>]20.5

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

      *-commutative [=>]20.5

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

      associate-*l* [=>]20.5

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

    if 4e3 < b

    1. Initial program 56.3

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

      \[\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]56.3

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

      remove-double-neg [<=]56.3

      \[ \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 [<=]56.3

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

      div-sub [=>]57.0

      \[ \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 [=>]57.0

      \[ \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/ [<=]57.8

      \[ \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 [=>]57.8

      \[ \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 [=>]60.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 [<=]60.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 [<=]60.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* [<=]60.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 [<=]60.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 [<=]60.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 [<=]57.8

      \[ \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 [=>]57.8

      \[ \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 5.2

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    4. Applied egg-rr5.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.5 \cdot 10^{+120}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-75}:\\ \;\;\;\;\frac{\frac{b - \sqrt{-3 \cdot \left(a \cdot c\right) + b \cdot b}}{a}}{-3}\\ \mathbf{elif}\;b \leq 4000:\\ \;\;\;\;\frac{b \cdot \left(b - b\right) + c \cdot \left(a \cdot 3\right)}{\frac{b + \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}{\frac{-0.3333333333333333}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternatives

Alternative 1
Error10.7
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{+121}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 0.055:\\ \;\;\;\;\frac{b - \sqrt{-3 \cdot \left(a \cdot c\right) + b \cdot b}}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 2
Error10.7
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -3.1 \cdot 10^{+120}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 0.00122:\\ \;\;\;\;\frac{\frac{b - \sqrt{-3 \cdot \left(a \cdot c\right) + b \cdot b}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 3
Error14.2
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -1.15 \cdot 10^{-53}:\\ \;\;\;\;\frac{\frac{b + \left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}{-3}}{a}\\ \mathbf{elif}\;b \leq 0.008:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a} \cdot 0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 4
Error14.2
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{-55}:\\ \;\;\;\;\frac{\frac{b + \left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}{-3}}{a}\\ \mathbf{elif}\;b \leq 0.00155:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(-3 \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 5
Error14.2
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -6.4 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{b + \left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}{-3}}{a}\\ \mathbf{elif}\;b \leq 0.00122:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(-3 \cdot a\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 6
Error14.2
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{-53}:\\ \;\;\;\;\frac{\frac{b + \left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}{-3}}{a}\\ \mathbf{elif}\;b \leq 0.00122:\\ \;\;\;\;\frac{\frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 7
Error22.9
Cost580
\[\begin{array}{l} \mathbf{if}\;b \leq 1.8 \cdot 10^{-257}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 8
Error22.9
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 1.35 \cdot 10^{-256}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 9
Error22.9
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 1.45 \cdot 10^{-257}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 10
Error22.9
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 10^{-258}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 11
Error22.9
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 5.5 \cdot 10^{-256}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 12
Error39.2
Cost320
\[-0.5 \cdot \frac{c}{b} \]

Error

Reproduce?

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