Cubic critical, medium range

?

Percentage Accurate: 31.5% → 95.4%
Time: 27.3s
Precision: binary64
Cost: 48128

?

\[\left(\left(1.1102230246251565 \cdot 10^{-16} < a \land a < 9007199254740992\right) \land \left(1.1102230246251565 \cdot 10^{-16} < b \land b < 9007199254740992\right)\right) \land \left(1.1102230246251565 \cdot 10^{-16} < c \land c < 9007199254740992\right)\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
\[\mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{c \cdot -0.5}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left(\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot {b}^{-6}\right)\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(FPCore (a b c)
 :precision binary64
 (+
  (fma
   -1.125
   (* (/ (* c c) (/ (pow b 3.0) a)) 0.3333333333333333)
   (/ (* c -0.5) b))
  (fma
   -0.5
   (*
    (/ (pow c 4.0) a)
    (*
     (/ 0.3333333333333333 b)
     (* (* (* a a) (* (* a a) (pow b -6.0))) 6.328125)))
   (/
    (* -1.6875 (pow c 3.0))
    (/ (pow b 5.0) (* a (* a 0.3333333333333333)))))))
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) {
	return fma(-1.125, (((c * c) / (pow(b, 3.0) / a)) * 0.3333333333333333), ((c * -0.5) / b)) + fma(-0.5, ((pow(c, 4.0) / a) * ((0.3333333333333333 / b) * (((a * a) * ((a * a) * pow(b, -6.0))) * 6.328125))), ((-1.6875 * pow(c, 3.0)) / (pow(b, 5.0) / (a * (a * 0.3333333333333333)))));
}
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)
	return Float64(fma(-1.125, Float64(Float64(Float64(c * c) / Float64((b ^ 3.0) / a)) * 0.3333333333333333), Float64(Float64(c * -0.5) / b)) + fma(-0.5, Float64(Float64((c ^ 4.0) / a) * Float64(Float64(0.3333333333333333 / b) * Float64(Float64(Float64(a * a) * Float64(Float64(a * a) * (b ^ -6.0))) * 6.328125))), Float64(Float64(-1.6875 * (c ^ 3.0)) / Float64((b ^ 5.0) / Float64(a * Float64(a * 0.3333333333333333))))))
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_] := N[(N[(-1.125 * N[(N[(N[(c * c), $MachinePrecision] / N[(N[Power[b, 3.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(N[(N[Power[c, 4.0], $MachinePrecision] / a), $MachinePrecision] * N[(N[(0.3333333333333333 / b), $MachinePrecision] * N[(N[(N[(a * a), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * N[Power[b, -6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 6.328125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.6875 * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[b, 5.0], $MachinePrecision] / N[(a * N[(a * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{c \cdot -0.5}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left(\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot {b}^{-6}\right)\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right)

Local Percentage Accuracy?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Derivation?

  1. Initial program 33.4%

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

    \[\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}} \]
    Step-by-step derivation

    [Start]33.4

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

    neg-sub0 [=>]33.4

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

    associate-+l- [=>]33.4

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

    sub0-neg [=>]33.4

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

    neg-mul-1 [=>]33.4

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

    associate-*r/ [<=]33.4

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

    *-commutative [=>]33.4

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

    metadata-eval [<=]33.4

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

    metadata-eval [<=]33.4

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

    times-frac [<=]33.4

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

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

    \[ \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-rr33.5%

    \[\leadsto \left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \color{blue}{{\left(\sqrt{\frac{0.3333333333333333}{a}}\right)}^{2}} \]
    Step-by-step derivation

    [Start]33.5

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

    add-sqr-sqrt [=>]33.5

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

    pow2 [=>]33.5

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

    \[\leadsto \color{blue}{-1.125 \cdot \frac{{c}^{2} \cdot \left(a \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{{b}^{3}} + \left(-1.5 \cdot \frac{c \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}}{b} + \left(-1.6875 \cdot \frac{{c}^{3} \cdot \left({a}^{2} \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{{b}^{5}} + -0.5 \cdot \frac{{c}^{4} \cdot \left(\left(5.0625 \cdot \frac{{a}^{4}}{{b}^{6}} + {\left(-1.125 \cdot \frac{{a}^{2}}{{b}^{3}}\right)}^{2}\right) \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{a \cdot b}\right)\right)} \]
  5. Simplified95.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\frac{{a}^{4}}{{b}^{6}} \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right)} \]
    Step-by-step derivation

    [Start]95.4

    \[ -1.125 \cdot \frac{{c}^{2} \cdot \left(a \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{{b}^{3}} + \left(-1.5 \cdot \frac{c \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}}{b} + \left(-1.6875 \cdot \frac{{c}^{3} \cdot \left({a}^{2} \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{{b}^{5}} + -0.5 \cdot \frac{{c}^{4} \cdot \left(\left(5.0625 \cdot \frac{{a}^{4}}{{b}^{6}} + {\left(-1.125 \cdot \frac{{a}^{2}}{{b}^{3}}\right)}^{2}\right) \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{a \cdot b}\right)\right) \]

    associate-+r+ [=>]95.4

    \[ \color{blue}{\left(-1.125 \cdot \frac{{c}^{2} \cdot \left(a \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{{b}^{3}} + -1.5 \cdot \frac{c \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}}{b}\right) + \left(-1.6875 \cdot \frac{{c}^{3} \cdot \left({a}^{2} \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{{b}^{5}} + -0.5 \cdot \frac{{c}^{4} \cdot \left(\left(5.0625 \cdot \frac{{a}^{4}}{{b}^{6}} + {\left(-1.125 \cdot \frac{{a}^{2}}{{b}^{3}}\right)}^{2}\right) \cdot {\left(\sqrt{0.3333333333333333}\right)}^{2}\right)}{a \cdot b}\right)} \]
  6. Applied egg-rr95.9%

    \[\leadsto \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot {b}^{-6}\right)\right)} \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]
    Step-by-step derivation

    [Start]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\frac{{a}^{4}}{{b}^{6}} \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    div-inv [=>]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\color{blue}{\left({a}^{4} \cdot \frac{1}{{b}^{6}}\right)} \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    metadata-eval [<=]95.9

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

    metadata-eval [<=]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left({a}^{\left(\color{blue}{\sqrt{4}} + 2\right)} \cdot \frac{1}{{b}^{6}}\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    metadata-eval [<=]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left({a}^{\left(\sqrt{4} + \color{blue}{\sqrt{4}}\right)} \cdot \frac{1}{{b}^{6}}\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    pow-prod-up [<=]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left(\color{blue}{\left({a}^{\left(\sqrt{4}\right)} \cdot {a}^{\left(\sqrt{4}\right)}\right)} \cdot \frac{1}{{b}^{6}}\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    pow-prod-down [=>]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left(\color{blue}{{\left(a \cdot a\right)}^{\left(\sqrt{4}\right)}} \cdot \frac{1}{{b}^{6}}\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    metadata-eval [=>]95.9

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

    pow2 [<=]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left(\color{blue}{\left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)} \cdot \frac{1}{{b}^{6}}\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    associate-*l* [=>]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot \frac{1}{{b}^{6}}\right)\right)} \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

    pow-flip [=>]95.9

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

    metadata-eval [=>]95.9

    \[ \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{-0.5 \cdot c}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left(\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot {b}^{\color{blue}{-6}}\right)\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]
  7. Final simplification95.9%

    \[\leadsto \mathsf{fma}\left(-1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot 0.3333333333333333, \frac{c \cdot -0.5}{b}\right) + \mathsf{fma}\left(-0.5, \frac{{c}^{4}}{a} \cdot \left(\frac{0.3333333333333333}{b} \cdot \left(\left(\left(a \cdot a\right) \cdot \left(\left(a \cdot a\right) \cdot {b}^{-6}\right)\right) \cdot 6.328125\right)\right), \frac{-1.6875 \cdot {c}^{3}}{\frac{{b}^{5}}{a \cdot \left(a \cdot 0.3333333333333333\right)}}\right) \]

Alternatives

Alternative 1
Accuracy93.9%
Cost33536
\[\mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \frac{c \cdot c}{\frac{{b}^{3}}{a}} \cdot -0.375\right)\right) \]
Alternative 2
Accuracy84.4%
Cost14788
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} - b}{3 \cdot a}\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{-7}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
Alternative 3
Accuracy90.7%
Cost13696
\[\mathsf{fma}\left(-0.375, a \cdot \frac{c \cdot c}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right) \]
Alternative 4
Accuracy90.5%
Cost7616
\[-0.3333333333333333 \cdot \mathsf{fma}\left(1.5, \frac{c}{b}, \frac{c \cdot \left(c \cdot a\right)}{b \cdot b} \cdot \frac{1.125}{b}\right) \]
Alternative 5
Accuracy81.0%
Cost320
\[c \cdot \frac{-0.5}{b} \]
Alternative 6
Accuracy81.0%
Cost320
\[\frac{-0.5}{\frac{b}{c}} \]
Alternative 7
Accuracy81.2%
Cost320
\[\frac{c \cdot -0.5}{b} \]
Alternative 8
Accuracy3.2%
Cost192
\[\frac{0}{a} \]

Error

Reproduce?

herbie shell --seed 2023160 
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (and (and (< 1.1102230246251565e-16 a) (< a 9007199254740992.0)) (and (< 1.1102230246251565e-16 b) (< b 9007199254740992.0))) (and (< 1.1102230246251565e-16 c) (< c 9007199254740992.0)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))