?

Average Error: 34.2 → 6.7
Time: 26.6s
Precision: binary64
Cost: 7948

?

\[\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 \cdot 10^{+154}:\\ \;\;\;\;\frac{\mathsf{fma}\left(1.5, \frac{c}{b} \cdot a, b \cdot -2\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq -1.7 \cdot 10^{-283}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 10^{+88}:\\ \;\;\;\;\frac{\frac{c}{\frac{a}{-a}}}{b + \sqrt{b \cdot b + \left(c \cdot a\right) \cdot -3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \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 -2e+154)
   (/ (fma 1.5 (* (/ c b) a) (* b -2.0)) (* a 3.0))
   (if (<= b -1.7e-283)
     (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
     (if (<= b 1e+88)
       (/ (/ c (/ a (- a))) (+ b (sqrt (+ (* b b) (* (* c a) -3.0)))))
       (* (/ c b) -0.5)))))
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 <= -2e+154) {
		tmp = fma(1.5, ((c / b) * a), (b * -2.0)) / (a * 3.0);
	} else if (b <= -1.7e-283) {
		tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	} else if (b <= 1e+88) {
		tmp = (c / (a / -a)) / (b + sqrt(((b * b) + ((c * a) * -3.0))));
	} else {
		tmp = (c / b) * -0.5;
	}
	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 <= -2e+154)
		tmp = Float64(fma(1.5, Float64(Float64(c / b) * a), Float64(b * -2.0)) / Float64(a * 3.0));
	elseif (b <= -1.7e-283)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0));
	elseif (b <= 1e+88)
		tmp = Float64(Float64(c / Float64(a / Float64(-a))) / Float64(b + sqrt(Float64(Float64(b * b) + Float64(Float64(c * a) * -3.0)))));
	else
		tmp = Float64(Float64(c / b) * -0.5);
	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, -2e+154], N[(N[(1.5 * N[(N[(c / b), $MachinePrecision] * a), $MachinePrecision] + N[(b * -2.0), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.7e-283], 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, 1e+88], N[(N[(c / N[(a / (-a)), $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(N[(c * a), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $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 \cdot 10^{+154}:\\
\;\;\;\;\frac{\mathsf{fma}\left(1.5, \frac{c}{b} \cdot a, b \cdot -2\right)}{a \cdot 3}\\

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

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

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


\end{array}

Error?

Derivation?

  1. Split input into 4 regimes
  2. if b < -2.00000000000000007e154

    1. Initial program 64.0

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around -inf 12.9

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{c \cdot a}{b} + -2 \cdot b}}{3 \cdot a} \]
    3. Simplified3.6

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

      [Start]12.9

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

      fma-def [=>]12.9

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

      associate-/l* [=>]3.6

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

      associate-/r/ [=>]3.6

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

      *-commutative [=>]3.6

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

    if -2.00000000000000007e154 < b < -1.6999999999999999e-283

    1. Initial program 8.1

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

    if -1.6999999999999999e-283 < b < 9.99999999999999959e87

    1. Initial program 31.7

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

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

      [Start]31.7

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

      *-lft-identity [<=]31.7

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

      metadata-eval [<=]31.7

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

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

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

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

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

      *-commutative [=>]31.8

      \[ \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-rr36.3

      \[\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. Simplified17.2

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

      [Start]36.3

      \[ \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)} \]

      *-commutative [=>]36.3

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

      times-frac [=>]31.8

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

      fma-udef [=>]31.8

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

      associate-*l* [<=]31.8

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

      +-commutative [=>]31.8

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

      associate--r+ [=>]17.2

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

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

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

      *-commutative [<=]17.2

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

      associate-*l* [=>]17.2

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

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

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

      [Start]17.2

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

      div0 [=>]17.2

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

      +-rgt-identity [=>]17.2

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

      +-inverses [=>]17.2

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

      mul0-rgt [=>]17.2

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

      neg-sub0 [<=]17.2

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

      associate-*r* [=>]17.2

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

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

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

      metadata-eval [=>]17.2

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-0.3333333333333333}{a} \cdot \frac{\left(c \cdot a\right) \cdot 3}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}\right)} - 1} \]
    8. Simplified9.5

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

      [Start]50.4

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

      expm1-def [=>]28.5

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

      expm1-log1p [=>]17.2

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

      associate-*l/ [=>]17.2

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

      *-commutative [=>]17.2

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

      associate-/l* [=>]17.4

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

      associate-*r/ [=>]17.3

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

      metadata-eval [=>]17.3

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

      associate-/l* [<=]17.1

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

      associate-/r* [<=]21.8

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

      associate-/l/ [<=]16.4

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

      mul-1-neg [=>]16.4

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

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

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

      associate-/l* [=>]9.5

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

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

    if 9.99999999999999959e87 < b

    1. Initial program 58.5

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

      \[\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.5

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

      remove-double-neg [<=]58.5

      \[ \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.5

      \[ \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.2

      \[ \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.2

      \[ \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.1

      \[ \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.1

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

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

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

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

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

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

      \[ \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.1

      \[ \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.1

      \[ \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.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+154}:\\ \;\;\;\;\frac{\mathsf{fma}\left(1.5, \frac{c}{b} \cdot a, b \cdot -2\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq -1.7 \cdot 10^{-283}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 10^{+88}:\\ \;\;\;\;\frac{\frac{c}{\frac{a}{-a}}}{b + \sqrt{b \cdot b + \left(c \cdot a\right) \cdot -3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]

Alternatives

Alternative 1
Error10.3
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{\mathsf{fma}\left(1.5, \frac{c}{b} \cdot a, b \cdot -2\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-110}:\\ \;\;\;\;\left(b - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 2
Error10.2
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+154}:\\ \;\;\;\;\frac{\mathsf{fma}\left(1.5, \frac{c}{b} \cdot a, b \cdot -2\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.45 \cdot 10^{-110}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 3
Error14.2
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -0.000115:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 3.4 \cdot 10^{-112}:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 4
Error14.1
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{-7}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-114}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 5
Error14.1
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{-7}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 2.45 \cdot 10^{-110}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 6
Error14.1
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{-7}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-117}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 7
Error14.1
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -4.3 \cdot 10^{-7}:\\ \;\;\;\;\frac{\mathsf{fma}\left(1.5, \frac{c}{b} \cdot a, b \cdot -2\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-110}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 8
Error22.6
Cost580
\[\begin{array}{l} \mathbf{if}\;b \leq 1.25 \cdot 10^{-248}:\\ \;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 9
Error22.6
Cost452
\[\begin{array}{l} \mathbf{if}\;b \leq 6 \cdot 10^{-248}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
Alternative 10
Error39.9
Cost320
\[\frac{c}{b} \cdot -0.5 \]

Error

Reproduce?

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