\[\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)\]
\[\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{fma}\left(a, c \cdot 3, b \cdot \left(b \cdot 0\right)\right)}\\
\frac{{\left({c}^{2} \cdot {a}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{\sqrt{\sqrt[3]{{t_0}^{4}}} \cdot \left|\sqrt[3]{t_0}\right|}} \cdot \frac{-0.3333333333333333}{a}
\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 (cbrt (fma a (* c 3.0) (* b (* b 0.0))))))
(*
(/
(* (pow (* (pow c 2.0) (pow a 2.0)) 0.3333333333333333) (cbrt 9.0))
(/
(+ b (sqrt (fma a (* c -3.0) (* b b))))
(* (sqrt (cbrt (pow t_0 4.0))) (fabs (cbrt t_0)))))
(/ -0.3333333333333333 a))))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
\[\leadsto \color{blue}{\frac{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)} \cdot \sqrt[3]{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]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}} \cdot \frac{-0.3333333333333333}{a}
\]
Taylor expanded in b around 0 42.05
\[\leadsto \frac{\color{blue}{{\left({c}^{2} \cdot \left(1 \cdot {a}^{2}\right)\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}} \cdot \frac{-0.3333333333333333}{a}
\]
Applied egg-rr42.04
\[\leadsto \frac{{\left({c}^{2} \cdot \left(1 \cdot {a}^{2}\right)\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{\color{blue}{\sqrt{\sqrt[3]{{\left(\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}^{4}}} \cdot \sqrt{{\left(\sqrt[3]{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}\right)}^{2}}}}} \cdot \frac{-0.3333333333333333}{a}
\]
Simplified2.39
\[\leadsto \frac{{\left({c}^{2} \cdot \left(1 \cdot {a}^{2}\right)\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{\color{blue}{\sqrt{\sqrt[3]{{\left(\sqrt[3]{\mathsf{fma}\left(a, 3 \cdot c, b \cdot \left(0 \cdot b\right)\right)}\right)}^{4}}} \cdot \left|\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(a, 3 \cdot c, b \cdot \left(0 \cdot b\right)\right)}}\right|}}} \cdot \frac{-0.3333333333333333}{a}
\]
Proof
[Start]42.04
\[ \frac{{\left({c}^{2} \cdot \left(1 \cdot {a}^{2}\right)\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{\sqrt{\sqrt[3]{{\left(\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}^{4}}} \cdot \sqrt{{\left(\sqrt[3]{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}\right)}^{2}}}} \cdot \frac{-0.3333333333333333}{a}
\]
Final simplification2.39
\[\leadsto \frac{{\left({c}^{2} \cdot {a}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{\sqrt{\sqrt[3]{{\left(\sqrt[3]{\mathsf{fma}\left(a, c \cdot 3, b \cdot \left(b \cdot 0\right)\right)}\right)}^{4}}} \cdot \left|\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(a, c \cdot 3, b \cdot \left(b \cdot 0\right)\right)}}\right|}} \cdot \frac{-0.3333333333333333}{a}
\]
Alternatives
Alternative 1
Error
2.52%
Cost
79488
\[\begin{array}{l}
t_0 := \sqrt[3]{\sqrt{\mathsf{fma}\left(a, c \cdot 3, b \cdot \left(b \cdot 0\right)\right)}}\\
\frac{-0.3333333333333333}{a} \cdot \frac{{\left({c}^{2} \cdot {a}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}{\frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{t_0 \cdot t_0}}
\end{array}
\]
herbie shell --seed 2023121
(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)))