?

Average Error: 28.9 → 4.6
Time: 26.8s
Precision: binary64
Cost: 61572

?

\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ t_1 := {\left(a \cdot c\right)}^{4}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -2.5:\\ \;\;\;\;\frac{\frac{\sqrt[3]{\left(c \cdot c\right) \cdot \left(a \cdot a\right)} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{t_0}}{\sqrt[3]{b \cdot b - t_0}}}}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5625, \left(c \cdot c\right) \cdot \left(c \cdot \frac{a}{\frac{{b}^{5}}{a}}\right), \mathsf{fma}\left(-0.16666666666666666, \frac{t_1 \cdot 1.265625 + t_1 \cdot 5.0625}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right)\\ \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
 (let* ((t_0 (fma a (* c -3.0) (* b b))) (t_1 (pow (* a c) 4.0)))
   (if (<= (/ (- (sqrt (+ (* b b) (* c (* a -3.0)))) b) (* 3.0 a)) -2.5)
     (*
      (/
       (/
        (* (cbrt (* (* c c) (* a a))) (cbrt 9.0))
        (/ (+ b (sqrt t_0)) (cbrt (- (* b b) t_0))))
       a)
      -0.3333333333333333)
     (fma
      -0.5625
      (* (* c c) (* c (/ a (/ (pow b 5.0) a))))
      (fma
       -0.16666666666666666
       (/ (+ (* t_1 1.265625) (* t_1 5.0625)) (* a (pow b 7.0)))
       (fma -0.5 (/ c b) (/ (* -0.375 (* a (* c c))) (pow b 3.0))))))))
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 t_0 = fma(a, (c * -3.0), (b * b));
	double t_1 = pow((a * c), 4.0);
	double tmp;
	if (((sqrt(((b * b) + (c * (a * -3.0)))) - b) / (3.0 * a)) <= -2.5) {
		tmp = (((cbrt(((c * c) * (a * a))) * cbrt(9.0)) / ((b + sqrt(t_0)) / cbrt(((b * b) - t_0)))) / a) * -0.3333333333333333;
	} else {
		tmp = fma(-0.5625, ((c * c) * (c * (a / (pow(b, 5.0) / a)))), fma(-0.16666666666666666, (((t_1 * 1.265625) + (t_1 * 5.0625)) / (a * pow(b, 7.0))), fma(-0.5, (c / b), ((-0.375 * (a * (c * c))) / pow(b, 3.0)))));
	}
	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)
	t_0 = fma(a, Float64(c * -3.0), Float64(b * b))
	t_1 = Float64(a * c) ^ 4.0
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -3.0)))) - b) / Float64(3.0 * a)) <= -2.5)
		tmp = Float64(Float64(Float64(Float64(cbrt(Float64(Float64(c * c) * Float64(a * a))) * cbrt(9.0)) / Float64(Float64(b + sqrt(t_0)) / cbrt(Float64(Float64(b * b) - t_0)))) / a) * -0.3333333333333333);
	else
		tmp = fma(-0.5625, Float64(Float64(c * c) * Float64(c * Float64(a / Float64((b ^ 5.0) / a)))), fma(-0.16666666666666666, Float64(Float64(Float64(t_1 * 1.265625) + Float64(t_1 * 5.0625)) / Float64(a * (b ^ 7.0))), fma(-0.5, Float64(c / b), Float64(Float64(-0.375 * Float64(a * Float64(c * c))) / (b ^ 3.0)))));
	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_] := Block[{t$95$0 = N[(a * N[(c * -3.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], -2.5], N[(N[(N[(N[(N[Power[N[(N[(c * c), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[9.0, 1/3], $MachinePrecision]), $MachinePrecision] / N[(N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] / N[Power[N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(-0.5625 * N[(N[(c * c), $MachinePrecision] * N[(c * N[(a / N[(N[Power[b, 5.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * N[(N[(N[(t$95$1 * 1.265625), $MachinePrecision] + N[(t$95$1 * 5.0625), $MachinePrecision]), $MachinePrecision] / N[(a * N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(c / b), $MachinePrecision] + N[(N[(-0.375 * N[(a * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\
t_1 := {\left(a \cdot c\right)}^{4}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -2.5:\\
\;\;\;\;\frac{\frac{\sqrt[3]{\left(c \cdot c\right) \cdot \left(a \cdot a\right)} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{t_0}}{\sqrt[3]{b \cdot b - t_0}}}}{a} \cdot -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5625, \left(c \cdot c\right) \cdot \left(c \cdot \frac{a}{\frac{{b}^{5}}{a}}\right), \mathsf{fma}\left(-0.16666666666666666, \frac{t_1 \cdot 1.265625 + t_1 \cdot 5.0625}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right)\\


\end{array}

Error?

Derivation?

  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -2.5

    1. Initial program 10.0

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

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

      [Start]10.0

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

      *-lft-identity [<=]10.0

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

      metadata-eval [<=]10.0

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

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

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

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

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

      *-commutative [=>]10.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-rr9.2

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)} \cdot \sqrt[3]{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)}}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}}}{a} \cdot -0.3333333333333333 \]
    4. Taylor expanded in b around 0 8.1

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

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

      [Start]8.1

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

      unpow1/3 [=>]8.0

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

      unpow2 [=>]8.0

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

      *-lft-identity [=>]8.0

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

      unpow2 [=>]8.0

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

    if -2.5 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))

    1. Initial program 31.3

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Simplified31.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]31.3

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

      remove-double-neg [<=]31.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 [<=]31.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 [=>]31.8

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

      \[ \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/ [<=]31.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 [=>]31.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 [=>]31.2

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

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

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

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

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

      \[ \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 [<=]31.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 [=>]31.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 4.2

      \[\leadsto \color{blue}{-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\right)} \]
    4. Simplified4.2

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right)} \]
      Proof

      [Start]4.2

      \[ -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\right) \]

      fma-def [=>]4.2

      \[ \color{blue}{\mathsf{fma}\left(-0.5625, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}, -0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\right)} \]

      associate-/l* [=>]4.2

      \[ \mathsf{fma}\left(-0.5625, \color{blue}{\frac{{c}^{3}}{\frac{{b}^{5}}{{a}^{2}}}}, -0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\right) \]

      unpow2 [=>]4.2

      \[ \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{\color{blue}{a \cdot a}}}, -0.16666666666666666 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\right) \]

      fma-def [=>]4.2

      \[ \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \color{blue}{\mathsf{fma}\left(-0.16666666666666666, \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{a \cdot {b}^{7}}, -0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)}\right) \]
    5. Applied egg-rr4.7

      \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({\left(c \cdot a\right)}^{4}\right)} - 1\right)}}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right) \]
    6. Simplified4.2

      \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot \color{blue}{{\left(c \cdot a\right)}^{4}}}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right) \]
      Proof

      [Start]4.7

      \[ \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot \left(e^{\mathsf{log1p}\left({\left(c \cdot a\right)}^{4}\right)} - 1\right)}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right) \]

      expm1-def [=>]4.2

      \[ \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(c \cdot a\right)}^{4}\right)\right)}}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right) \]

      expm1-log1p [=>]4.2

      \[ \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot \color{blue}{{\left(c \cdot a\right)}^{4}}}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right) \]
    7. Applied egg-rr4.2

      \[\leadsto \mathsf{fma}\left(-0.5625, \color{blue}{\left(c \cdot c\right) \cdot \left(c \cdot \frac{a}{\frac{{b}^{5}}{a}}\right)}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot {\left(c \cdot a\right)}^{4}}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right) \]
    8. Applied egg-rr4.2

      \[\leadsto \mathsf{fma}\left(-0.5625, \left(c \cdot c\right) \cdot \left(c \cdot \frac{a}{\frac{{b}^{5}}{a}}\right), \mathsf{fma}\left(-0.16666666666666666, \frac{\color{blue}{{\left(c \cdot a\right)}^{4} \cdot 1.265625} + 5.0625 \cdot {\left(c \cdot a\right)}^{4}}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification4.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -2.5:\\ \;\;\;\;\frac{\frac{\sqrt[3]{\left(c \cdot c\right) \cdot \left(a \cdot a\right)} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5625, \left(c \cdot c\right) \cdot \left(c \cdot \frac{a}{\frac{{b}^{5}}{a}}\right), \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4} \cdot 1.265625 + {\left(a \cdot c\right)}^{4} \cdot 5.0625}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error6.5
Cost48068
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -0.0038:\\ \;\;\;\;\frac{\frac{\sqrt[3]{\left(c \cdot c\right) \cdot \left(a \cdot a\right)} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{t_0}}{\sqrt[3]{b \cdot b - t_0}}}}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 2
Error6.9
Cost40964
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -0.0038:\\ \;\;\;\;\frac{b \cdot b - t_0}{a} \cdot \frac{-0.3333333333333333}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 3
Error9.0
Cost28228
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -0.0038:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{\frac{b \cdot b - t_0}{a}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 4
Error9.0
Cost28228
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -0.0038:\\ \;\;\;\;\frac{b \cdot b - t_0}{a} \cdot \frac{-0.3333333333333333}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 5
Error9.2
Cost21124
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -3\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{3 \cdot a} \leq -0.0038:\\ \;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, t_0\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 6
Error9.4
Cost21060
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -3\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{3 \cdot a} \leq -0.0038:\\ \;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, t_0\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1.5, a \cdot \frac{c}{b}, \frac{\left(c \cdot c\right) \cdot -1.125}{b \cdot \frac{b \cdot b}{a \cdot a}}\right)}{3 \cdot a}\\ \end{array} \]
Alternative 7
Error9.4
Cost15428
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -0.0038:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1.5, a \cdot \frac{c}{b}, \frac{\left(c \cdot c\right) \cdot -1.125}{b \cdot \frac{b \cdot b}{a \cdot a}}\right)}{3 \cdot a}\\ \end{array} \]
Alternative 8
Error15.5
Cost14788
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -0.0001:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 9
Error16.7
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 210:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 10
Error16.7
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 210:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
Alternative 11
Error22.5
Cost320
\[-0.5 \cdot \frac{c}{b} \]

Error

Reproduce?

herbie shell --seed 2023034 
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :precision binary64
  :pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))