?

Average Error: 44.75% → 8.04%
Time: 29.9s
Precision: binary64
Cost: 47556

?

\[\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}\;b \leq 0.29:\\ \;\;\;\;\frac{\frac{\sqrt{b \cdot b - t_0}}{\frac{b + \sqrt{t_0}}{\sqrt{3 \cdot \left(a \cdot c\right)}}}}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \left(\frac{{c}^{4}}{{b}^{7}} \cdot -3.1640625\right), \mathsf{fma}\left(-0.5625, c \cdot \left(\frac{c \cdot c}{{b}^{5}} \cdot \left(a \cdot a\right)\right), \mathsf{fma}\left(-0.5, \frac{c}{b}, -0.375 \cdot \left(\frac{c \cdot c}{b} \cdot \frac{a}{b \cdot b}\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 (<= b 0.29)
     (*
      (/
       (/ (sqrt (- (* b b) t_0)) (/ (+ b (sqrt t_0)) (sqrt (* 3.0 (* a c)))))
       a)
      -0.3333333333333333)
     (fma
      0.3333333333333333
      (* (pow a 3.0) (* (/ (pow c 4.0) (pow b 7.0)) -3.1640625))
      (fma
       -0.5625
       (* c (* (/ (* c c) (pow b 5.0)) (* a a)))
       (fma -0.5 (/ c b) (* -0.375 (* (/ (* c c) b) (/ a (* b b))))))))))
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 (b <= 0.29) {
		tmp = ((sqrt(((b * b) - t_0)) / ((b + sqrt(t_0)) / sqrt((3.0 * (a * c))))) / a) * -0.3333333333333333;
	} else {
		tmp = fma(0.3333333333333333, (pow(a, 3.0) * ((pow(c, 4.0) / pow(b, 7.0)) * -3.1640625)), fma(-0.5625, (c * (((c * c) / pow(b, 5.0)) * (a * a))), fma(-0.5, (c / b), (-0.375 * (((c * c) / b) * (a / (b * b)))))));
	}
	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 (b <= 0.29)
		tmp = Float64(Float64(Float64(sqrt(Float64(Float64(b * b) - t_0)) / Float64(Float64(b + sqrt(t_0)) / sqrt(Float64(3.0 * Float64(a * c))))) / a) * -0.3333333333333333);
	else
		tmp = fma(0.3333333333333333, Float64((a ^ 3.0) * Float64(Float64((c ^ 4.0) / (b ^ 7.0)) * -3.1640625)), fma(-0.5625, Float64(c * Float64(Float64(Float64(c * c) / (b ^ 5.0)) * Float64(a * a))), fma(-0.5, Float64(c / b), Float64(-0.375 * Float64(Float64(Float64(c * c) / b) * Float64(a / Float64(b * b)))))));
	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[b, 0.29], N[(N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] / N[(N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(0.3333333333333333 * N[(N[Power[a, 3.0], $MachinePrecision] * N[(N[(N[Power[c, 4.0], $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision] * -3.1640625), $MachinePrecision]), $MachinePrecision] + N[(-0.5625 * N[(c * N[(N[(N[(c * c), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(c / b), $MachinePrecision] + N[(-0.375 * N[(N[(N[(c * c), $MachinePrecision] / b), $MachinePrecision] * N[(a / N[(b * b), $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}\;b \leq 0.29:\\
\;\;\;\;\frac{\frac{\sqrt{b \cdot b - t_0}}{\frac{b + \sqrt{t_0}}{\sqrt{3 \cdot \left(a \cdot c\right)}}}}{a} \cdot -0.3333333333333333\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \left(\frac{{c}^{4}}{{b}^{7}} \cdot -3.1640625\right), \mathsf{fma}\left(-0.5625, c \cdot \left(\frac{c \cdot c}{{b}^{5}} \cdot \left(a \cdot a\right)\right), \mathsf{fma}\left(-0.5, \frac{c}{b}, -0.375 \cdot \left(\frac{c \cdot c}{b} \cdot \frac{a}{b \cdot b}\right)\right)\right)\right)\\


\end{array}

Error?

Derivation?

  1. Split input into 2 regimes
  2. if b < 0.28999999999999998

    1. Initial program 17.73

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

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

      [Start]17.73

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

      *-lft-identity [<=]17.73

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

      metadata-eval [<=]17.73

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

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

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

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

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

      *-commutative [=>]17.74

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

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

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

    if 0.28999999999999998 < b

    1. Initial program 48.62

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

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

      [Start]48.62

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

      *-lft-identity [<=]48.62

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

      metadata-eval [<=]48.62

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

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

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

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

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

      *-commutative [=>]48.62

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

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left({a}^{3} \cdot \left(-2.53125 \cdot \frac{{c}^{4}}{{b}^{7}} + -0.6328125 \cdot \frac{{c}^{4}}{{b}^{7}}\right)\right) + \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)} \]
    5. Simplified7.05

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

      [Start]7.05

      \[ 0.3333333333333333 \cdot \left({a}^{3} \cdot \left(-2.53125 \cdot \frac{{c}^{4}}{{b}^{7}} + -0.6328125 \cdot \frac{{c}^{4}}{{b}^{7}}\right)\right) + \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 [=>]7.05

      \[ \color{blue}{\mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \left(-2.53125 \cdot \frac{{c}^{4}}{{b}^{7}} + -0.6328125 \cdot \frac{{c}^{4}}{{b}^{7}}\right), -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)} \]

      distribute-rgt-out [=>]7.05

      \[ \mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \color{blue}{\left(\frac{{c}^{4}}{{b}^{7}} \cdot \left(-2.53125 + -0.6328125\right)\right)}, -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) \]

      metadata-eval [=>]7.05

      \[ \mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \left(\frac{{c}^{4}}{{b}^{7}} \cdot \color{blue}{-3.1640625}\right), -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 [=>]7.05

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

      associate-/l* [=>]7.05

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

      unpow2 [=>]7.05

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

      fma-def [=>]7.05

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

      associate-/l* [=>]7.05

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

      unpow2 [=>]7.05

      \[ \mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \left(\frac{{c}^{4}}{{b}^{7}} \cdot -3.1640625\right), \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, -0.375 \cdot \frac{\color{blue}{c \cdot c}}{\frac{{b}^{3}}{a}}\right)\right)\right) \]
    6. Applied egg-rr7.05

      \[\leadsto \mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \left(\frac{{c}^{4}}{{b}^{7}} \cdot -3.1640625\right), \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, -0.375 \cdot \color{blue}{\left(\frac{c \cdot c}{b} \cdot \frac{a}{b \cdot b}\right)}\right)\right)\right) \]
    7. Applied egg-rr7.05

      \[\leadsto \mathsf{fma}\left(0.3333333333333333, {a}^{3} \cdot \left(\frac{{c}^{4}}{{b}^{7}} \cdot -3.1640625\right), \mathsf{fma}\left(-0.5625, \color{blue}{\left(\frac{c \cdot c}{{b}^{5}} \cdot \left(a \cdot a\right)\right) \cdot c}, \mathsf{fma}\left(-0.5, \frac{c}{b}, -0.375 \cdot \left(\frac{c \cdot c}{b} \cdot \frac{a}{b \cdot b}\right)\right)\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.04

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

Alternatives

Alternative 1
Error10.25%
Cost34116
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 0.31:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{\frac{\sqrt{3 \cdot \left(a \cdot c\right)}}{\frac{b + \sqrt{t_0}}{\sqrt{b \cdot b - t_0}}}}{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}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 2
Error10.26%
Cost34116
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 0.39:\\ \;\;\;\;\frac{\frac{\sqrt{b \cdot b - t_0}}{\frac{b + \sqrt{t_0}}{\sqrt{3 \cdot \left(a \cdot c\right)}}}}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 3
Error10.41%
Cost33668
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 0.3:\\ \;\;\;\;\frac{\frac{\left(b \cdot b - t_0\right) \cdot -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.5, \frac{c}{b}, \frac{-0.375 \cdot \left(a \cdot \left(c \cdot c\right)\right)}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 4
Error14.84%
Cost20932
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 1.05:\\ \;\;\;\;\frac{b \cdot b - t_0}{a} \cdot \frac{-0.3333333333333333}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 5
Error14.83%
Cost20932
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 1.1:\\ \;\;\;\;\frac{-0.3333333333333333}{\frac{a \cdot \left(b + \sqrt{t_0}\right)}{b \cdot b - t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 6
Error14.83%
Cost20932
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 1.1:\\ \;\;\;\;\frac{\frac{-0.3333333333333333}{a}}{\frac{b + \sqrt{t_0}}{b \cdot b - t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 7
Error14.83%
Cost20932
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;b \leq 1.1:\\ \;\;\;\;\frac{\frac{\left(b \cdot b - t_0\right) \cdot -0.3333333333333333}{a}}{b + \sqrt{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 8
Error23.93%
Cost14788
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{if}\;t_0 \leq -2.2 \cdot 10^{-7}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 9
Error15.09%
Cost13828
\[\begin{array}{l} \mathbf{if}\;b \leq 1.05:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 10
Error15.34%
Cost13764
\[\begin{array}{l} \mathbf{if}\;b \leq 1.05:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \mathsf{fma}\left(\frac{c \cdot c}{b \cdot \frac{b \cdot b}{a}}, 1.125, \frac{c}{\frac{b}{1.5}}\right)\\ \end{array} \]
Alternative 11
Error15.33%
Cost7748
\[\begin{array}{l} \mathbf{if}\;b \leq 1.1:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \mathsf{fma}\left(\frac{c \cdot c}{b \cdot \frac{b \cdot b}{a}}, 1.125, \frac{c}{\frac{b}{1.5}}\right)\\ \end{array} \]
Alternative 12
Error15.33%
Cost7684
\[\begin{array}{l} \mathbf{if}\;b \leq 1.05:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \left(\frac{c \cdot c}{{b}^{3}} \cdot \left(a \cdot 1.125\right) + \frac{c}{b} \cdot 1.5\right)\\ \end{array} \]
Alternative 13
Error26.27%
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 450:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 14
Error26.26%
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 430:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 15
Error35.5%
Cost320
\[c \cdot \frac{-0.5}{b} \]
Alternative 16
Error35.5%
Cost320
\[\frac{-0.5}{\frac{b}{c}} \]
Alternative 17
Error35.43%
Cost320
\[\frac{c \cdot -0.5}{b} \]
Alternative 18
Error96.83%
Cost64
\[0 \]

Error

Reproduce?

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