?

Average Accuracy: 55.7% → 91.8%
Time: 21.1s
Precision: binary64
Cost: 54724

?

\[\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} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -150:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{1}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-0.16666666666666666}{a}, \frac{{\left(a \cdot c\right)}^{4} \cdot 6.328125}{{b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.375, a \cdot \left(\frac{c}{b} \cdot \frac{c}{b \cdot b}\right), \frac{{c}^{3} \cdot -0.5625}{\frac{{b}^{5}}{a \cdot a}}\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
 (if (<= (/ (- (sqrt (+ (* b b) (* c (* a -3.0)))) b) (* 3.0 a)) -150.0)
   (* (- (sqrt (fma b b (* a (* c -3.0)))) b) (/ 1.0 (* 3.0 a)))
   (fma
    (/ -0.16666666666666666 a)
    (/ (* (pow (* a c) 4.0) 6.328125) (pow b 7.0))
    (fma
     -0.5
     (/ c b)
     (fma
      -0.375
      (* a (* (/ c b) (/ c (* b b))))
      (/ (* (pow c 3.0) -0.5625) (/ (pow b 5.0) (* a a))))))))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
double code(double a, double b, double c) {
	double tmp;
	if (((sqrt(((b * b) + (c * (a * -3.0)))) - b) / (3.0 * a)) <= -150.0) {
		tmp = (sqrt(fma(b, b, (a * (c * -3.0)))) - b) * (1.0 / (3.0 * a));
	} else {
		tmp = fma((-0.16666666666666666 / a), ((pow((a * c), 4.0) * 6.328125) / pow(b, 7.0)), fma(-0.5, (c / b), fma(-0.375, (a * ((c / b) * (c / (b * b)))), ((pow(c, 3.0) * -0.5625) / (pow(b, 5.0) / (a * a))))));
	}
	return tmp;
}
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
function code(a, b, c)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -3.0)))) - b) / Float64(3.0 * a)) <= -150.0)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(a * Float64(c * -3.0)))) - b) * Float64(1.0 / Float64(3.0 * a)));
	else
		tmp = fma(Float64(-0.16666666666666666 / a), Float64(Float64((Float64(a * c) ^ 4.0) * 6.328125) / (b ^ 7.0)), fma(-0.5, Float64(c / b), fma(-0.375, Float64(a * Float64(Float64(c / b) * Float64(c / Float64(b * b)))), Float64(Float64((c ^ 3.0) * -0.5625) / Float64((b ^ 5.0) / Float64(a * a))))));
	end
	return tmp
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_] := If[LessEqual[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], -150.0], N[(N[(N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(1.0 / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.16666666666666666 / a), $MachinePrecision] * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] * 6.328125), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(c / b), $MachinePrecision] + N[(-0.375 * N[(a * N[(N[(c / b), $MachinePrecision] * N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[c, 3.0], $MachinePrecision] * -0.5625), $MachinePrecision] / N[(N[Power[b, 5.0], $MachinePrecision] / N[(a * a), $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}
\mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -150:\\
\;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{1}{3 \cdot a}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.16666666666666666}{a}, \frac{{\left(a \cdot c\right)}^{4} \cdot 6.328125}{{b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.375, a \cdot \left(\frac{c}{b} \cdot \frac{c}{b \cdot b}\right), \frac{{c}^{3} \cdot -0.5625}{\frac{{b}^{5}}{a \cdot a}}\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)) < -150

    1. Initial program 89.0%

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

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

      [Start]89.0

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

      neg-sub0 [=>]89.0

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

      associate-+l- [=>]89.0

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

      sub0-neg [=>]89.0

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

      neg-mul-1 [=>]89.0

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

      associate-*r/ [<=]89.0

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

      *-commutative [=>]89.0

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

      metadata-eval [<=]89.0

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

      metadata-eval [<=]89.0

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

      times-frac [<=]89.0

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

      *-commutative [<=]89.0

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

      times-frac [=>]89.0

      \[ \color{blue}{\frac{b - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-1} \cdot \frac{--1}{3 \cdot a}} \]
    3. Applied egg-rr89.0%

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

      [Start]89.0

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

      clear-num [=>]89.0

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

      inv-pow [=>]89.0

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

      div-inv [=>]89.0

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

      metadata-eval [=>]89.0

      \[ \left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot {\left(a \cdot \color{blue}{3}\right)}^{-1} \]
    4. Applied egg-rr89.0%

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

      [Start]89.0

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

      unpow-1 [=>]89.0

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

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

    1. Initial program 54.1%

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

      \[\leadsto \frac{\color{blue}{-0.5 \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)}{{b}^{7}} + \left(-1.125 \cdot \frac{{c}^{2} \cdot {a}^{2}}{{b}^{3}} + \left(-1.5 \cdot \frac{c \cdot a}{b} + -1.6875 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)\right)}}{3 \cdot a} \]
    3. Simplified91.6%

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

      [Start]91.5

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

      fma-def [=>]91.5

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

      unpow2 [=>]91.5

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

      unpow2 [=>]91.5

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

      fma-def [=>]91.5

      \[ \frac{\mathsf{fma}\left(-0.5, \frac{{\left(-1.125 \cdot \left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{{b}^{7}}, \color{blue}{\mathsf{fma}\left(-1.125, \frac{{c}^{2} \cdot {a}^{2}}{{b}^{3}}, -1.5 \cdot \frac{c \cdot a}{b} + -1.6875 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)}\right)}{3 \cdot a} \]
    4. Taylor expanded in c around 0 91.9%

      \[\leadsto \color{blue}{-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.16666666666666666 \cdot \frac{{c}^{4} \cdot \left(1.265625 \cdot {a}^{4} + 5.0625 \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)} \]
    5. Simplified91.9%

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

      [Start]91.9

      \[ -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.16666666666666666 \cdot \frac{{c}^{4} \cdot \left(1.265625 \cdot {a}^{4} + 5.0625 \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) \]

      +-commutative [=>]91.9

      \[ \color{blue}{\left(-0.16666666666666666 \cdot \frac{{c}^{4} \cdot \left(1.265625 \cdot {a}^{4} + 5.0625 \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) + -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}} \]

      associate-+l+ [=>]91.9

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

      associate-*r/ [=>]91.9

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

      times-frac [=>]91.9

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

      +-commutative [<=]91.9

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

      fma-def [=>]91.9

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

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

      [Start]91.9

      \[ \mathsf{fma}\left(\frac{-0.16666666666666666}{a}, \frac{{\left(c \cdot a\right)}^{4} \cdot 6.328125}{{b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.375, a \cdot \frac{c \cdot c}{{b}^{3}}, \frac{{c}^{3} \cdot -0.5625}{\frac{{b}^{5}}{a \cdot a}}\right)\right)\right) \]

      unpow3 [=>]91.9

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

      times-frac [=>]91.9

      \[ \mathsf{fma}\left(\frac{-0.16666666666666666}{a}, \frac{{\left(c \cdot a\right)}^{4} \cdot 6.328125}{{b}^{7}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.375, a \cdot \color{blue}{\left(\frac{c}{b \cdot b} \cdot \frac{c}{b}\right)}, \frac{{c}^{3} \cdot -0.5625}{\frac{{b}^{5}}{a \cdot a}}\right)\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.8%

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

Alternatives

Alternative 1
Accuracy91.8%
Cost54596
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -150:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{1}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.375, a \cdot \left(\frac{c}{b} \cdot \frac{c}{b \cdot b}\right), \frac{{\left(a \cdot c\right)}^{4} \cdot -1.0546875}{a \cdot {b}^{7}}\right)\right)\right)\\ \end{array} \]
Alternative 2
Accuracy89.7%
Cost40964
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -3:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{1}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.375, a \cdot \frac{c \cdot c}{{b}^{3}}, \frac{{c}^{3} \cdot -0.5625}{\frac{{b}^{5}}{a \cdot a}}\right)\right)\\ \end{array} \]
Alternative 3
Accuracy89.7%
Cost34756
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -3:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{1}{3 \cdot a}\\ \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.5, \frac{c}{b}, -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\right)\right)\\ \end{array} \]
Alternative 4
Accuracy85.2%
Cost21188
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -0.2:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \left(\frac{1}{a} \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, a \cdot \frac{c \cdot c}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 5
Accuracy85.2%
Cost21188
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -0.2:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{1}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, a \cdot \frac{c \cdot c}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 6
Accuracy85.2%
Cost21124
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -0.2:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, a \cdot \frac{c \cdot c}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 7
Accuracy76.4%
Cost21060
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -1.6 \cdot 10^{-6}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 8
Accuracy76.4%
Cost21060
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -1.6 \cdot 10^{-6}:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 9
Accuracy76.4%
Cost21060
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a} \leq -1.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 10
Accuracy76.3%
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 -1.6 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 11
Accuracy64.1%
Cost320
\[c \cdot \frac{-0.5}{b} \]
Alternative 12
Accuracy64.1%
Cost320
\[\frac{-0.5}{\frac{b}{c}} \]
Alternative 13
Accuracy64.2%
Cost320
\[\frac{c \cdot -0.5}{b} \]

Error

Reproduce?

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