?

Average Error: 28.9 → 4.8
Time: 27.1s
Precision: binary64
Cost: 48004

?

\[\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(c, a \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{\frac{b \cdot b - t_0}{\left(-b\right) - \sqrt{t_0}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left(c \cdot \left(c \cdot 0.5625\right)\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{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 c (* a -3.0) (* b b))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a)) -1.8)
     (/ (/ (- (* b b) t_0) (- (- b) (sqrt t_0))) (* 3.0 a))
     (/
      1.0
      (fma
       -2.0
       (/ b c)
       (fma
        3.0
        (* (/ (pow a 3.0) (pow b 5.0)) (* c (* c 0.5625)))
        (fma 1.5 (/ a b) (* 3.0 (/ (* (* c (* a a)) 0.375) (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(c, (a * -3.0), (b * b));
	double tmp;
	if (((sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a)) <= -1.8) {
		tmp = (((b * b) - t_0) / (-b - sqrt(t_0))) / (3.0 * a);
	} else {
		tmp = 1.0 / fma(-2.0, (b / c), fma(3.0, ((pow(a, 3.0) / pow(b, 5.0)) * (c * (c * 0.5625))), fma(1.5, (a / b), (3.0 * (((c * (a * a)) * 0.375) / 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(c, Float64(a * -3.0), Float64(b * b))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c))) - b) / Float64(3.0 * a)) <= -1.8)
		tmp = Float64(Float64(Float64(Float64(b * b) - t_0) / Float64(Float64(-b) - sqrt(t_0))) / Float64(3.0 * a));
	else
		tmp = Float64(1.0 / fma(-2.0, Float64(b / c), fma(3.0, Float64(Float64((a ^ 3.0) / (b ^ 5.0)) * Float64(c * Float64(c * 0.5625))), fma(1.5, Float64(a / b), Float64(3.0 * Float64(Float64(Float64(c * Float64(a * a)) * 0.375) / (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[(c * N[(a * -3.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], -1.8], N[(N[(N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision] / N[((-b) - N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(-2.0 * N[(b / c), $MachinePrecision] + N[(3.0 * N[(N[(N[Power[a, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision] * N[(c * N[(c * 0.5625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(a / b), $MachinePrecision] + N[(3.0 * N[(N[(N[(c * N[(a * a), $MachinePrecision]), $MachinePrecision] * 0.375), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $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(c, a \cdot -3, b \cdot b\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\
\;\;\;\;\frac{\frac{b \cdot b - t_0}{\left(-b\right) - \sqrt{t_0}}}{3 \cdot a}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left(c \cdot \left(c \cdot 0.5625\right)\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{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)) < -1.80000000000000004

    1. Initial program 10.0

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

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

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

      [Start]9.3

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

      associate-/r* [<=]9.3

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

      fma-def [<=]9.1

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

      +-commutative [=>]9.1

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

      fma-def [=>]9.1

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

      distribute-rgt-neg-in [<=]9.1

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

      rem-square-sqrt [=>]9.1

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

      fma-def [<=]9.1

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

      +-commutative [=>]9.1

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

      fma-def [=>]9.1

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

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

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

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

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

      remove-double-neg [<=]31.7

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

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

      div-sub [=>]32.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 [=>]32.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/ [<=]32.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 [=>]32.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 [=>]31.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 [<=]31.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 [<=]31.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* [<=]31.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 [<=]31.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 [<=]31.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 [<=]32.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 [=>]32.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. Applied egg-rr31.7

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

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

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

      [Start]4.2

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

      fma-def [=>]4.2

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

      fma-def [=>]4.2

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

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

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

      [Start]4.2

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

      *-commutative [=>]4.2

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

      distribute-rgt-out [=>]4.2

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

      metadata-eval [=>]4.2

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

      unpow2 [=>]4.2

      \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(-0.5625, {a}^{3} \cdot \left(c \cdot c\right), \mathsf{fma}\left(0.2222222222222222, \frac{\left({a}^{4} \cdot 6.328125\right) \cdot \color{blue}{\left(c \cdot c\right)}}{a}, -0.75 \cdot \left(c \cdot \left(a \cdot \left(\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375\right)\right)\right)\right)\right)}{{b}^{5}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)} \]
    8. Taylor expanded in a around 0 4.2

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

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

      [Start]4.2

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

      associate-/l* [=>]4.2

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

      associate-/r/ [=>]4.2

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

      *-commutative [=>]4.2

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

      distribute-rgt-out [=>]4.2

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

      distribute-lft-out [=>]4.2

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

      metadata-eval [=>]4.2

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

      metadata-eval [=>]4.2

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

      unpow2 [=>]4.2

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

      associate-*l* [=>]4.2

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

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

Alternatives

Alternative 1
Error6.2
Cost28292
\[\begin{array}{l} t_0 := \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{\frac{b \cdot b - t_0}{\left(-b\right) - \sqrt{t_0}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \left(a \cdot a\right) \cdot \left(0.375 \cdot \frac{c}{{b}^{3}}\right), \frac{a \cdot 1.5}{b}\right)\right)}\\ \end{array} \]
Alternative 2
Error6.2
Cost28228
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\left(b \cdot b - t_0\right) \cdot \frac{-0.3333333333333333}{a \cdot \left(b + \sqrt{t_0}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \left(a \cdot a\right) \cdot \left(0.375 \cdot \frac{c}{{b}^{3}}\right), \frac{a \cdot 1.5}{b}\right)\right)}\\ \end{array} \]
Alternative 3
Error6.2
Cost28228
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{b \cdot b - t_0}{\left(a \cdot -3\right) \cdot \left(b + \sqrt{t_0}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \left(a \cdot a\right) \cdot \left(0.375 \cdot \frac{c}{{b}^{3}}\right), \frac{a \cdot 1.5}{b}\right)\right)}\\ \end{array} \]
Alternative 4
Error6.2
Cost28228
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{b \cdot b - t_0}{\frac{b + \sqrt{t_0}}{\frac{-0.3333333333333333}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \left(a \cdot a\right) \cdot \left(0.375 \cdot \frac{c}{{b}^{3}}\right), \frac{a \cdot 1.5}{b}\right)\right)}\\ \end{array} \]
Alternative 5
Error6.3
Cost28036
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \left(a \cdot a\right) \cdot \left(0.375 \cdot \frac{c}{{b}^{3}}\right), \frac{a \cdot 1.5}{b}\right)\right)}\\ \end{array} \]
Alternative 6
Error6.5
Cost21892
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \left(\frac{0.5}{b} - \mathsf{fma}\left(-1, \frac{0.375 \cdot \left(a \cdot c\right)}{{b}^{3}}, \frac{b \cdot 0.6666666666666666}{a \cdot c}\right)\right)}\\ \end{array} \]
Alternative 7
Error6.5
Cost21060
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \left(0.5 \cdot \frac{1}{b} - \left(0.6666666666666666 \cdot \frac{b}{a \cdot c} - \frac{\left(a \cdot c\right) \cdot -0.375 + \left(a \cdot c\right) \cdot 0.75}{{b}^{3}}\right)\right)}\\ \end{array} \]
Alternative 8
Error6.5
Cost21060
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \left(0.5 \cdot \frac{1}{b} - \left(0.6666666666666666 \cdot \frac{b}{a \cdot c} - \frac{\left(a \cdot c\right) \cdot -0.375 + \left(a \cdot c\right) \cdot 0.75}{{b}^{3}}\right)\right)}\\ \end{array} \]
Alternative 9
Error6.5
Cost16004
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -1.8:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \left(0.5 \cdot \frac{1}{b} - \left(0.6666666666666666 \cdot \frac{b}{a \cdot c} - \frac{\left(a \cdot c\right) \cdot -0.375 + \left(a \cdot c\right) \cdot 0.75}{{b}^{3}}\right)\right)}\\ \end{array} \]
Alternative 10
Error9.2
Cost14788
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -1.8:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1.5 \cdot \frac{a}{b} - \frac{b}{c} \cdot 2}\\ \end{array} \]
Alternative 11
Error9.4
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 18:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1.5 \cdot \frac{a}{b} - \frac{b}{c} \cdot 2}\\ \end{array} \]
Alternative 12
Error9.4
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 18:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1.5 \cdot \frac{a}{b} - \frac{b}{c} \cdot 2}\\ \end{array} \]
Alternative 13
Error11.4
Cost832
\[\frac{1}{1.5 \cdot \frac{a}{b} - \frac{b}{c} \cdot 2} \]
Alternative 14
Error56.3
Cost320
\[-0.1111111111111111 \cdot \frac{b}{a} \]
Alternative 15
Error22.6
Cost320
\[c \cdot \frac{-0.5}{b} \]
Alternative 16
Error22.6
Cost320
\[\frac{-0.5}{\frac{b}{c}} \]
Alternative 17
Error22.6
Cost320
\[\frac{c \cdot -0.5}{b} \]

Error

Reproduce?

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