Average Error: 28.8 → 0.7
Time: 22.3s
Precision: binary64
Cost: 34624
\[\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)\\ \frac{\mathsf{fma}\left(6, c \cdot \left(a \cdot \left(b \cdot b\right)\right), -9 \cdot \left(a \cdot \left(c \cdot \left(c \cdot a\right)\right)\right)\right)}{\mathsf{fma}\left(b, b, t_0\right) \cdot \left(\left(a \cdot -3\right) \cdot \left(b + \sqrt{t_0}\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))))
   (/
    (fma 6.0 (* c (* a (* b b))) (* -9.0 (* a (* c (* c a)))))
    (* (fma b b t_0) (* (* a -3.0) (+ b (sqrt t_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(a, (c * -3.0), (b * b));
	return fma(6.0, (c * (a * (b * b))), (-9.0 * (a * (c * (c * a))))) / (fma(b, b, t_0) * ((a * -3.0) * (b + sqrt(t_0))));
}
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))
	return Float64(fma(6.0, Float64(c * Float64(a * Float64(b * b))), Float64(-9.0 * Float64(a * Float64(c * Float64(c * a))))) / Float64(fma(b, b, t_0) * Float64(Float64(a * -3.0) * Float64(b + sqrt(t_0)))))
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]}, N[(N[(6.0 * N[(c * N[(a * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(a * N[(c * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b * b + t$95$0), $MachinePrecision] * N[(N[(a * -3.0), $MachinePrecision] * N[(b + N[Sqrt[t$95$0], $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)\\
\frac{\mathsf{fma}\left(6, c \cdot \left(a \cdot \left(b \cdot b\right)\right), -9 \cdot \left(a \cdot \left(c \cdot \left(c \cdot a\right)\right)\right)\right)}{\mathsf{fma}\left(b, b, t_0\right) \cdot \left(\left(a \cdot -3\right) \cdot \left(b + \sqrt{t_0}\right)\right)}
\end{array}

Error

Derivation

  1. Initial program 28.8

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

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

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

    remove-double-neg [<=]28.8

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

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

    div-sub [=>]29.3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    [Start]27.9

    \[ \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-/r* [=>]27.9

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

    associate-*l* [=>]27.9

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

    fma-def [=>]27.9

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

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

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

    [Start]0.7

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

    fma-def [=>]0.7

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

    unpow2 [=>]0.7

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

    unpow2 [=>]0.7

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

    unpow2 [=>]0.7

    \[ \frac{\frac{\mathsf{fma}\left(6, c \cdot \left(a \cdot \left(b \cdot b\right)\right), -9 \cdot \left(\left(c \cdot c\right) \cdot \color{blue}{\left(a \cdot a\right)}\right)\right)}{a \cdot \left(-3 \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)\right)}}{\mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)} \]
  7. Applied egg-rr24.4

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(6, \left(b \cdot b\right) \cdot \left(c \cdot a\right), -9 \cdot {\left(c \cdot a\right)}^{2}\right)}{\left(\mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right) \cdot \left(a \cdot -3\right)\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}\right)} - 1} \]
  8. Simplified0.7

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

    [Start]24.4

    \[ e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(6, \left(b \cdot b\right) \cdot \left(c \cdot a\right), -9 \cdot {\left(c \cdot a\right)}^{2}\right)}{\left(\mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right) \cdot \left(a \cdot -3\right)\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}\right)} - 1 \]

    expm1-def [=>]9.5

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

    expm1-log1p [=>]0.7

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

    *-commutative [=>]0.7

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

    unpow2 [<=]0.7

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

    associate-*r* [<=]0.7

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

    unpow2 [=>]0.7

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

    associate-*l* [=>]0.7

    \[ \frac{\mathsf{fma}\left(6, c \cdot \left(a \cdot \left(b \cdot b\right)\right), -9 \cdot {\left(c \cdot a\right)}^{2}\right)}{\color{blue}{\mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right) \cdot \left(\left(a \cdot -3\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)\right)}} \]
  9. Applied egg-rr0.7

    \[\leadsto \frac{\mathsf{fma}\left(6, c \cdot \left(a \cdot \left(b \cdot b\right)\right), -9 \cdot \color{blue}{\left(\left(\left(c \cdot a\right) \cdot c\right) \cdot a\right)}\right)}{\mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right) \cdot \left(\left(a \cdot -3\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)\right)} \]
  10. Final simplification0.7

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

Alternatives

Alternative 1
Error0.7
Cost34624
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \frac{\frac{\mathsf{fma}\left(6, c \cdot \left(a \cdot \left(b \cdot b\right)\right), -9 \cdot \left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right)\right)}{a \cdot \left(-3 \cdot \left(b + \sqrt{t_0}\right)\right)}}{\mathsf{fma}\left(b, b, t_0\right)} \end{array} \]
Alternative 2
Error6.4
Cost21700
\[\begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3} \leq -50:\\ \;\;\;\;-0.3333333333333333 \cdot \left(\frac{b}{a} - \frac{\sqrt{t_0}}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.75 \cdot \left(c \cdot \left(c \cdot a\right)\right)}{b} - c \cdot b}{\mathsf{fma}\left(b, b, t_0\right)}\\ \end{array} \]
Alternative 3
Error0.7
Cost20736
\[\frac{\frac{\frac{3 \cdot \left(c \cdot {a}^{3}\right)}{a}}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}} \cdot -0.3333333333333333}{a \cdot a} \]
Alternative 4
Error9.4
Cost13764
\[\begin{array}{l} \mathbf{if}\;b \leq 44:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{b \cdot \frac{b \cdot b}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 5
Error9.4
Cost7620
\[\begin{array}{l} \mathbf{if}\;b \leq 44:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.375, \frac{c \cdot c}{b \cdot \frac{b \cdot b}{a}}, -0.5 \cdot \frac{c}{b}\right)\\ \end{array} \]
Alternative 6
Error9.5
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 44:\\ \;\;\;\;\left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\frac{-0.5}{b} + a \cdot \left(-0.375 \cdot \frac{c}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 7
Error9.5
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 44:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\frac{-0.5}{b} + a \cdot \left(-0.375 \cdot \frac{c}{{b}^{3}}\right)\right)\\ \end{array} \]
Alternative 8
Error11.6
Cost7296
\[c \cdot \left(\frac{-0.5}{b} + a \cdot \left(-0.375 \cdot \frac{c}{{b}^{3}}\right)\right) \]
Alternative 9
Error22.6
Cost320
\[c \cdot \frac{-0.5}{b} \]
Alternative 10
Error22.6
Cost320
\[\frac{-0.5}{\frac{b}{c}} \]
Alternative 11
Error22.5
Cost320
\[\frac{c \cdot -0.5}{b} \]

Error

Reproduce

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