Average Error: 28.6 → 5.0
Time: 23.5s
Precision: binary64
Cost: 67588
\[\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)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -8:\\ \;\;\;\;\left(b \cdot b - t_0\right) \cdot \frac{\frac{-0.3333333333333333}{a}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, {a}^{3} \cdot 0.84375\right) \cdot \left(c \cdot c\right)}{{b}^{5}}\right)\right)\right)\right)}^{-1}\\ \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))))
   (if (<= (/ (- (sqrt (+ (* b b) (* c (* a -3.0)))) b) (* 3.0 a)) -8.0)
     (* (- (* b b) t_0) (/ (/ -0.3333333333333333 a) (+ b (sqrt t_0))))
     (pow
      (fma
       -2.0
       (/ b c)
       (fma
        -3.0
        (/ (* (* c (* a a)) -0.375) (pow b 3.0))
        (fma
         1.5
         (/ a b)
         (*
          -3.0
          (/
           (*
            (fma
             -0.2222222222222222
             (/ (* (pow a 4.0) 6.328125) a)
             (* (pow a 3.0) 0.84375))
            (* c c))
           (pow b 5.0))))))
      -1.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 tmp;
	if (((sqrt(((b * b) + (c * (a * -3.0)))) - b) / (3.0 * a)) <= -8.0) {
		tmp = ((b * b) - t_0) * ((-0.3333333333333333 / a) / (b + sqrt(t_0)));
	} else {
		tmp = pow(fma(-2.0, (b / c), fma(-3.0, (((c * (a * a)) * -0.375) / pow(b, 3.0)), fma(1.5, (a / b), (-3.0 * ((fma(-0.2222222222222222, ((pow(a, 4.0) * 6.328125) / a), (pow(a, 3.0) * 0.84375)) * (c * c)) / pow(b, 5.0)))))), -1.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))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -3.0)))) - b) / Float64(3.0 * a)) <= -8.0)
		tmp = Float64(Float64(Float64(b * b) - t_0) * Float64(Float64(-0.3333333333333333 / a) / Float64(b + sqrt(t_0))));
	else
		tmp = fma(-2.0, Float64(b / c), fma(-3.0, Float64(Float64(Float64(c * Float64(a * a)) * -0.375) / (b ^ 3.0)), fma(1.5, Float64(a / b), Float64(-3.0 * Float64(Float64(fma(-0.2222222222222222, Float64(Float64((a ^ 4.0) * 6.328125) / a), Float64((a ^ 3.0) * 0.84375)) * Float64(c * c)) / (b ^ 5.0)))))) ^ -1.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]}, 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], -8.0], N[(N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision] * N[(N[(-0.3333333333333333 / a), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(-2.0 * N[(b / c), $MachinePrecision] + N[(-3.0 * N[(N[(N[(c * N[(a * a), $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(a / b), $MachinePrecision] + N[(-3.0 * N[(N[(N[(-0.2222222222222222 * N[(N[(N[Power[a, 4.0], $MachinePrecision] * 6.328125), $MachinePrecision] / a), $MachinePrecision] + N[(N[Power[a, 3.0], $MachinePrecision] * 0.84375), $MachinePrecision]), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $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)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -8:\\
\;\;\;\;\left(b \cdot b - t_0\right) \cdot \frac{\frac{-0.3333333333333333}{a}}{b + \sqrt{t_0}}\\

\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, {a}^{3} \cdot 0.84375\right) \cdot \left(c \cdot c\right)}{{b}^{5}}\right)\right)\right)\right)}^{-1}\\


\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)) < -8

    1. Initial program 9.8

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

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

      [Start]9.8

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

      *-lft-identity [<=]9.8

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

      metadata-eval [<=]9.8

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

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

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

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

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

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

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

      \[\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)}} \]
    5. Simplified8.9

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

      [Start]8.9

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

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

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

      *-commutative [=>]8.9

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

      associate-*l/ [<=]8.9

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

      *-commutative [=>]8.9

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

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

    1. Initial program 30.4

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

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

      \[\leadsto {\color{blue}{\left(-2 \cdot \frac{b}{c} + \left(-3 \cdot \frac{-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)}{{b}^{3}} + \left(1.5 \cdot \frac{a}{b} + -3 \cdot \frac{-0.75 \cdot \left(c \cdot \left(a \cdot \left(-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)\right)\right)\right) + \left(0.5625 \cdot \left({c}^{2} \cdot {a}^{3}\right) + -0.2222222222222222 \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)}{{c}^{2} \cdot a}\right)}{{b}^{5}}\right)\right)\right)}}^{-1} \]
    4. Simplified4.6

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

      [Start]4.6

      \[ {\left(-2 \cdot \frac{b}{c} + \left(-3 \cdot \frac{-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)}{{b}^{3}} + \left(1.5 \cdot \frac{a}{b} + -3 \cdot \frac{-0.75 \cdot \left(c \cdot \left(a \cdot \left(-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)\right)\right)\right) + \left(0.5625 \cdot \left({c}^{2} \cdot {a}^{3}\right) + -0.2222222222222222 \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)}{{c}^{2} \cdot a}\right)}{{b}^{5}}\right)\right)\right)}^{-1} \]

      fma-def [=>]4.6

      \[ {\color{blue}{\left(\mathsf{fma}\left(-2, \frac{b}{c}, -3 \cdot \frac{-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)}{{b}^{3}} + \left(1.5 \cdot \frac{a}{b} + -3 \cdot \frac{-0.75 \cdot \left(c \cdot \left(a \cdot \left(-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)\right)\right)\right) + \left(0.5625 \cdot \left({c}^{2} \cdot {a}^{3}\right) + -0.2222222222222222 \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)}{{c}^{2} \cdot a}\right)}{{b}^{5}}\right)\right)\right)}}^{-1} \]

      fma-def [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\mathsf{fma}\left(-3, \frac{-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)}{{b}^{3}}, 1.5 \cdot \frac{a}{b} + -3 \cdot \frac{-0.75 \cdot \left(c \cdot \left(a \cdot \left(-0.75 \cdot \left(c \cdot {a}^{2}\right) + 0.375 \cdot \left(c \cdot {a}^{2}\right)\right)\right)\right) + \left(0.5625 \cdot \left({c}^{2} \cdot {a}^{3}\right) + -0.2222222222222222 \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)}{{c}^{2} \cdot a}\right)}{{b}^{5}}\right)}\right)\right)}^{-1} \]
    5. Taylor expanded in c around 0 4.6

      \[\leadsto {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\color{blue}{{c}^{2} \cdot \left(-0.2222222222222222 \cdot \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{a} + \left(0.5625 \cdot {a}^{3} + 0.28125 \cdot {a}^{3}\right)\right)}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]
    6. Simplified4.6

      \[\leadsto {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\color{blue}{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, {a}^{3} \cdot 0.84375\right) \cdot \left(c \cdot c\right)}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]
      Proof

      [Start]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{{c}^{2} \cdot \left(-0.2222222222222222 \cdot \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{a} + \left(0.5625 \cdot {a}^{3} + 0.28125 \cdot {a}^{3}\right)\right)}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]

      *-commutative [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\color{blue}{\left(-0.2222222222222222 \cdot \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{a} + \left(0.5625 \cdot {a}^{3} + 0.28125 \cdot {a}^{3}\right)\right) \cdot {c}^{2}}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]

      fma-def [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\color{blue}{\mathsf{fma}\left(-0.2222222222222222, \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{a}, 0.5625 \cdot {a}^{3} + 0.28125 \cdot {a}^{3}\right)} \cdot {c}^{2}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]

      distribute-rgt-out [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{\color{blue}{{a}^{4} \cdot \left(1.265625 + 5.0625\right)}}{a}, 0.5625 \cdot {a}^{3} + 0.28125 \cdot {a}^{3}\right) \cdot {c}^{2}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]

      metadata-eval [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot \color{blue}{6.328125}}{a}, 0.5625 \cdot {a}^{3} + 0.28125 \cdot {a}^{3}\right) \cdot {c}^{2}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]

      distribute-rgt-out [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, \color{blue}{{a}^{3} \cdot \left(0.5625 + 0.28125\right)}\right) \cdot {c}^{2}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]

      metadata-eval [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, {a}^{3} \cdot \color{blue}{0.84375}\right) \cdot {c}^{2}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]

      unpow2 [=>]4.6

      \[ {\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, {a}^{3} \cdot 0.84375\right) \cdot \color{blue}{\left(c \cdot c\right)}}{{b}^{5}}\right)\right)\right)\right)}^{-1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification5.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -8:\\ \;\;\;\;\left(b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right) \cdot \frac{\frac{-0.3333333333333333}{a}}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(-3, \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot -0.375}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, -3 \cdot \frac{\mathsf{fma}\left(-0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, {a}^{3} \cdot 0.84375\right) \cdot \left(c \cdot c\right)}{{b}^{5}}\right)\right)\right)\right)}^{-1}\\ \end{array} \]

Alternatives

Alternative 1
Error5.1
Cost61828
\[\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 -8:\\ \;\;\;\;\left(b \cdot b - t_0\right) \cdot \frac{\frac{-0.3333333333333333}{a}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left(\left(a \cdot a\right) \cdot \left(c \cdot c\right)\right) \cdot -1.125\right)}^{2} + 5.0625 \cdot {\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{a \cdot \left(c \cdot c\right)}{b \cdot b} \cdot \frac{-0.375}{b}\right)\right)\right)\\ \end{array} \]
Alternative 2
Error6.9
Cost27076
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 48:\\ \;\;\;\;\left(b \cdot b - t_0\right) \cdot \frac{\frac{-0.3333333333333333}{a}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(1.5, \frac{a}{b}, \frac{-3}{\frac{{b}^{3}}{c \cdot \left(\left(a \cdot a\right) \cdot -0.375\right)}}\right)\right)\right)}^{-1}\\ \end{array} \]
Alternative 3
Error7.0
Cost20932
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 48:\\ \;\;\;\;\left(b \cdot b - t_0\right) \cdot \frac{\frac{-0.3333333333333333}{a}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.3333333333333333}{\mathsf{fma}\left(0.5, \frac{a}{b}, \frac{b}{c} \cdot -0.6666666666666666\right) + \frac{\left(a \cdot a\right) \cdot \left(c \cdot 0.375\right)}{{b}^{3}}}\\ \end{array} \]
Alternative 4
Error6.3
Cost14340
\[\begin{array}{l} \mathbf{if}\;b \leq 0.44:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.3333333333333333}{\mathsf{fma}\left(0.5, \frac{a}{b}, \frac{b}{c} \cdot -0.6666666666666666\right) + \frac{\left(a \cdot a\right) \cdot \left(c \cdot 0.375\right)}{{b}^{3}}}\\ \end{array} \]
Alternative 5
Error9.3
Cost13764
\[\begin{array}{l} \mathbf{if}\;b \leq 51:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a}\\ \mathbf{else}:\\ \;\;\;\;{\left(-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}\right)}^{-1}\\ \end{array} \]
Alternative 6
Error9.3
Cost13764
\[\begin{array}{l} \mathbf{if}\;b \leq 51:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;{\left(-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}\right)}^{-1}\\ \end{array} \]
Alternative 7
Error9.3
Cost13764
\[\begin{array}{l} \mathbf{if}\;b \leq 51:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;{\left(-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}\right)}^{-1}\\ \end{array} \]
Alternative 8
Error9.3
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 51:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}\right)}^{-1}\\ \end{array} \]
Alternative 9
Error9.4
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 56:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;{\left(-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}\right)}^{-1}\\ \end{array} \]
Alternative 10
Error11.5
Cost7168
\[{\left(-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}\right)}^{-1} \]
Alternative 11
Error11.5
Cost832
\[\frac{0.3333333333333333}{\frac{b}{c} \cdot -0.6666666666666666 + \frac{a}{b} \cdot 0.5} \]
Alternative 12
Error22.8
Cost320
\[c \cdot \frac{-0.5}{b} \]
Alternative 13
Error22.8
Cost320
\[\frac{-0.5}{\frac{b}{c}} \]
Alternative 14
Error22.8
Cost320
\[\frac{c \cdot -0.5}{b} \]

Error

Reproduce

herbie shell --seed 2023011 
(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)))