?

Average Error: 28.8 → 4.8
Time: 27.2s
Precision: binary64
Cost: 54468

?

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(1.125, c \cdot \frac{a \cdot a}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, \frac{3}{{b}^{5}} \cdot \left(a \cdot \left(\left(0.2222222222222222 \cdot \left(\frac{{a}^{4}}{a} \cdot \frac{6.328125}{a}\right) + \left(a \cdot a\right) \cdot -0.84375\right) \cdot \left(c \cdot c\right)\right)\right)\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)) < -19.5

    1. Initial program 8.9

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

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

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

      remove-double-neg [<=]8.9

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

      sub-neg [<=]8.9

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

      div-sub [=>]9.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      [Start]8.4

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

      associate-*l* [=>]8.4

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

      associate-/r* [=>]8.4

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

      fma-def [=>]8.4

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

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

    1. Initial program 30.6

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

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

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

      remove-double-neg [<=]30.6

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

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

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

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

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

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

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

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

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

      \[ \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.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 [=>]31.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. Applied egg-rr30.6

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

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

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

      [Start]4.7

      \[ \frac{1}{\left(a \cdot -3\right) \cdot \left(\left(-1 \cdot \frac{-0.5625 \cdot \left({c}^{2} \cdot {a}^{2}\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}^{2}} + -0.75 \cdot \left(c \cdot \left(\left(-0.375 \cdot \left(c \cdot a\right) + 0.75 \cdot \left(c \cdot a\right)\right) \cdot a\right)\right)\right)}{{b}^{5}} + \left(-1 \cdot \frac{-0.375 \cdot \left(c \cdot a\right) + 0.75 \cdot \left(c \cdot a\right)}{{b}^{3}} + 0.6666666666666666 \cdot \frac{b}{c \cdot a}\right)\right) - 0.5 \cdot \frac{1}{b}\right)} \]
    6. Taylor expanded in c around 0 4.5

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

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

      [Start]4.5

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

      fma-def [=>]4.5

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

      associate-+r+ [=>]4.5

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

      +-commutative [<=]4.5

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

      fma-def [=>]4.5

      \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\mathsf{fma}\left(1.125, \frac{c \cdot {a}^{2}}{{b}^{3}}, 1.5 \cdot \frac{a}{b} + 3 \cdot \frac{{c}^{2} \cdot \left(a \cdot \left(-0.28125 \cdot {a}^{2} + \left(0.2222222222222222 \cdot \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{{a}^{2}} + -0.5625 \cdot {a}^{2}\right)\right)\right)}{{b}^{5}}\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 -19.5:\\ \;\;\;\;\frac{\frac{{b}^{4} - {\left(\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)}^{2}}{a \cdot -3}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right) \cdot \mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(1.125, c \cdot \frac{a \cdot a}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, \frac{3}{{b}^{5}} \cdot \left(a \cdot \left(\left(0.2222222222222222 \cdot \left(\frac{{a}^{4}}{a} \cdot \frac{6.328125}{a}\right) + \left(a \cdot a\right) \cdot -0.84375\right) \cdot \left(c \cdot c\right)\right)\right)\right)\right)\right)}\\ \end{array} \]

Alternatives

Alternative 1
Error4.8
Cost48772
\[\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 -19.5:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \frac{-1}{\frac{{b}^{4} - {t_0}^{2}}{\left(b + \sqrt{t_0}\right) \cdot \left(b \cdot b + t_0\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(1.125, c \cdot \frac{a \cdot a}{{b}^{3}}, \mathsf{fma}\left(1.5, \frac{a}{b}, \frac{3}{{b}^{5}} \cdot \left(a \cdot \left(\left(0.2222222222222222 \cdot \left(\frac{{a}^{4}}{a} \cdot \frac{6.328125}{a}\right) + \left(a \cdot a\right) \cdot -0.84375\right) \cdot \left(c \cdot c\right)\right)\right)\right)\right)\right)}\\ \end{array} \]
Alternative 2
Error6.3
Cost48452
\[\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.05:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \frac{-1}{\frac{{b}^{4} - {t_0}^{2}}{\left(b + \sqrt{t_0}\right) \cdot \left(b \cdot b + t_0\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + \left(1.5 \cdot \frac{a}{b} + 1.125 \cdot \frac{c \cdot {a}^{2}}{{b}^{3}}\right)}\\ \end{array} \]
Alternative 3
Error6.2
Cost28484
\[\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.05:\\ \;\;\;\;\frac{1}{\frac{\frac{a \cdot -3}{b \cdot b - t_0}}{\frac{1}{b + \sqrt{t_0}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + \left(1.5 \cdot \frac{a}{b} + 1.125 \cdot \frac{c \cdot {a}^{2}}{{b}^{3}}\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.05:\\ \;\;\;\;\frac{b \cdot b - t_0}{a} \cdot \frac{-0.3333333333333333}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + \left(1.5 \cdot \frac{a}{b} + 1.125 \cdot \frac{c \cdot {a}^{2}}{{b}^{3}}\right)}\\ \end{array} \]
Alternative 5
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.05:\\ \;\;\;\;\frac{-0.3333333333333333}{\frac{a \cdot \left(b + \sqrt{t_0}\right)}{b \cdot b - t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + \left(1.5 \cdot \frac{a}{b} + 1.125 \cdot \frac{c \cdot {a}^{2}}{{b}^{3}}\right)}\\ \end{array} \]
Alternative 6
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.05:\\ \;\;\;\;\frac{b \cdot b - t_0}{\frac{a \cdot \left(b + \sqrt{t_0}\right)}{-0.3333333333333333}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + \left(1.5 \cdot \frac{a}{b} + 1.125 \cdot \frac{c \cdot {a}^{2}}{{b}^{3}}\right)}\\ \end{array} \]
Alternative 7
Error6.3
Cost21700
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.05:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + \left(1.5 \cdot \frac{a}{b} + 1.125 \cdot \frac{c \cdot {a}^{2}}{{b}^{3}}\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.05:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \left(0.5 \cdot \frac{1}{b} - \left(\frac{\left(a \cdot c\right) \cdot 0.375 + \left(a \cdot c\right) \cdot -0.75}{{b}^{3}} + 0.6666666666666666 \cdot \frac{b}{a \cdot c}\right)\right)}\\ \end{array} \]
Alternative 9
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.05:\\ \;\;\;\;\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(\frac{\left(a \cdot c\right) \cdot 0.375 + \left(a \cdot c\right) \cdot -0.75}{{b}^{3}} + 0.6666666666666666 \cdot \frac{b}{a \cdot c}\right)\right)}\\ \end{array} \]
Alternative 10
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.05:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(3 \cdot a\right) \cdot \left(0.5 \cdot \frac{1}{b} - \left(\frac{\left(a \cdot c\right) \cdot 0.375 + \left(a \cdot c\right) \cdot -0.75}{{b}^{3}} + 0.6666666666666666 \cdot \frac{b}{a \cdot c}\right)\right)}\\ \end{array} \]
Alternative 11
Error9.0
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 -0.0015:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}}\\ \end{array} \]
Alternative 12
Error9.2
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 33:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}}\\ \end{array} \]
Alternative 13
Error9.3
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 32:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}}\\ \end{array} \]
Alternative 14
Error11.3
Cost832
\[\frac{1}{-2 \cdot \frac{b}{c} + 1.5 \cdot \frac{a}{b}} \]
Alternative 15
Error22.7
Cost320
\[-0.5 \cdot \frac{c}{b} \]

Error

Reproduce?

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