\[\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)\]
(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 (* b (* b a))) (* (pow (* c a) 2.0) -9.0))
(+ b (sqrt t_0)))
(/ 1.0 (fma b b 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{{b}^{4} - {\left(\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)}^{2}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right) \cdot \left(b \cdot b + \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)}} \cdot \frac{-0.3333333333333333}{a}
\]
Taylor expanded in b around 0 0.8
\[\leadsto \frac{\color{blue}{6 \cdot \left(c \cdot \left(a \cdot {b}^{2}\right)\right) + -9 \cdot \left({c}^{2} \cdot {a}^{2}\right)}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right) \cdot \left(b \cdot b + \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)} \cdot \frac{-0.3333333333333333}{a}
\]
Applied egg-rr0.8
\[\leadsto \color{blue}{\left(\frac{\mathsf{fma}\left(6, c \cdot \left(b \cdot \left(b \cdot a\right)\right), {\left(c \cdot a\right)}^{2} \cdot -9\right)}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}} \cdot \frac{1}{\mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)}\right)} \cdot \frac{-0.3333333333333333}{a}
\]
Final simplification0.8
\[\leadsto \left(\frac{\mathsf{fma}\left(6, c \cdot \left(b \cdot \left(b \cdot a\right)\right), {\left(c \cdot a\right)}^{2} \cdot -9\right)}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}} \cdot \frac{1}{\mathsf{fma}\left(b, b, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)\right)}\right) \cdot \frac{-0.3333333333333333}{a}
\]
herbie shell --seed 2023027
(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)))