| Alternative 1 | |
|---|---|
| Error | 6.2 |
| Cost | 28292 |
(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 c (* a -3.0) (* b b))))
(if (<= (/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a)) -1.8)
(/ (/ (- (* b b) t_0) (- (- b) (sqrt t_0))) (* 3.0 a))
(/
1.0
(fma
-2.0
(/ b c)
(fma
3.0
(* (/ (pow a 3.0) (pow b 5.0)) (* c (* c 0.5625)))
(fma 1.5 (/ a b) (* 3.0 (/ (* (* c (* a a)) 0.375) (pow b 3.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(c, (a * -3.0), (b * b));
double tmp;
if (((sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a)) <= -1.8) {
tmp = (((b * b) - t_0) / (-b - sqrt(t_0))) / (3.0 * a);
} else {
tmp = 1.0 / fma(-2.0, (b / c), fma(3.0, ((pow(a, 3.0) / pow(b, 5.0)) * (c * (c * 0.5625))), fma(1.5, (a / b), (3.0 * (((c * (a * a)) * 0.375) / pow(b, 3.0))))));
}
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(c, Float64(a * -3.0), Float64(b * b)) tmp = 0.0 if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c))) - b) / Float64(3.0 * a)) <= -1.8) tmp = Float64(Float64(Float64(Float64(b * b) - t_0) / Float64(Float64(-b) - sqrt(t_0))) / Float64(3.0 * a)); else tmp = Float64(1.0 / fma(-2.0, Float64(b / c), fma(3.0, Float64(Float64((a ^ 3.0) / (b ^ 5.0)) * Float64(c * Float64(c * 0.5625))), fma(1.5, Float64(a / b), Float64(3.0 * Float64(Float64(Float64(c * Float64(a * a)) * 0.375) / (b ^ 3.0))))))); 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[(c * N[(a * -3.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], -1.8], N[(N[(N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision] / N[((-b) - N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(-2.0 * N[(b / c), $MachinePrecision] + N[(3.0 * N[(N[(N[Power[a, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision] * N[(c * N[(c * 0.5625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.5 * N[(a / b), $MachinePrecision] + N[(3.0 * N[(N[(N[(c * N[(a * a), $MachinePrecision]), $MachinePrecision] * 0.375), $MachinePrecision] / N[Power[b, 3.0], $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(c, a \cdot -3, b \cdot b\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.8:\\
\;\;\;\;\frac{\frac{b \cdot b - t_0}{\left(-b\right) - \sqrt{t_0}}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left(c \cdot \left(c \cdot 0.5625\right)\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}\\
\end{array}
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -1.80000000000000004Initial program 10.0
Applied egg-rr9.3
Simplified9.1
[Start]9.3 | \[ \frac{\frac{\frac{b \cdot b - \mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}{\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}}}}{-\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}}}}{3 \cdot a}
\] |
|---|---|
associate-/r* [<=]9.3 | \[ \frac{\color{blue}{\frac{b \cdot b - \mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}{\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}} \cdot \left(-\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}}\right)}}}{3 \cdot a}
\] |
fma-def [<=]9.1 | \[ \frac{\frac{b \cdot b - \color{blue}{\left(b \cdot b + c \cdot \left(a \cdot -3\right)\right)}}{\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}} \cdot \left(-\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}}\right)}}{3 \cdot a}
\] |
+-commutative [=>]9.1 | \[ \frac{\frac{b \cdot b - \color{blue}{\left(c \cdot \left(a \cdot -3\right) + b \cdot b\right)}}{\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}} \cdot \left(-\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}}\right)}}{3 \cdot a}
\] |
fma-def [=>]9.1 | \[ \frac{\frac{b \cdot b - \color{blue}{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}{\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}} \cdot \left(-\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}}\right)}}{3 \cdot a}
\] |
distribute-rgt-neg-in [<=]9.1 | \[ \frac{\frac{b \cdot b - \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}{\color{blue}{-\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}} \cdot \sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}}}}}{3 \cdot a}
\] |
rem-square-sqrt [=>]9.1 | \[ \frac{\frac{b \cdot b - \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}{-\color{blue}{\left(b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right)}}}{3 \cdot a}
\] |
fma-def [<=]9.1 | \[ \frac{\frac{b \cdot b - \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}{-\left(b + \sqrt{\color{blue}{b \cdot b + c \cdot \left(a \cdot -3\right)}}\right)}}{3 \cdot a}
\] |
+-commutative [=>]9.1 | \[ \frac{\frac{b \cdot b - \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}{-\left(b + \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right) + b \cdot b}}\right)}}{3 \cdot a}
\] |
fma-def [=>]9.1 | \[ \frac{\frac{b \cdot b - \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}{-\left(b + \sqrt{\color{blue}{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}\right)}}{3 \cdot a}
\] |
if -1.80000000000000004 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) Initial program 31.7
Simplified31.7
[Start]31.7 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\] |
|---|---|
remove-double-neg [<=]31.7 | \[ \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 [<=]31.7 | \[ \frac{\color{blue}{\left(-b\right) - \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a}
\] |
div-sub [=>]32.2 | \[ \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 [=>]32.2 | \[ \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/ [<=]32.2 | \[ \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 [=>]32.2 | \[ \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 [=>]31.6 | \[ \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 [<=]31.6 | \[ \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 [<=]31.6 | \[ \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* [<=]31.6 | \[ \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 [<=]31.6 | \[ \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 [<=]31.6 | \[ \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 [<=]32.2 | \[ \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 [=>]32.2 | \[ \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}}
\] |
Applied egg-rr31.7
Taylor expanded in b around inf 4.2
Simplified4.2
[Start]4.2 | \[ \frac{1}{-2 \cdot \frac{b}{c} + \left(3 \cdot \frac{-0.5625 \cdot \left({c}^{2} \cdot {a}^{3}\right) + \left(0.2222222222222222 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{{c}^{2} \cdot a} + -0.75 \cdot \left(c \cdot \left(a \cdot \left(0.75 \cdot \left(c \cdot {a}^{2}\right) + -0.375 \cdot \left(c \cdot {a}^{2}\right)\right)\right)\right)\right)}{{b}^{5}} + \left(1.5 \cdot \frac{a}{b} + 3 \cdot \frac{0.75 \cdot \left(c \cdot {a}^{2}\right) + -0.375 \cdot \left(c \cdot {a}^{2}\right)}{{b}^{3}}\right)\right)}
\] |
|---|---|
fma-def [=>]4.2 | \[ \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, 3 \cdot \frac{-0.5625 \cdot \left({c}^{2} \cdot {a}^{3}\right) + \left(0.2222222222222222 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{{c}^{2} \cdot a} + -0.75 \cdot \left(c \cdot \left(a \cdot \left(0.75 \cdot \left(c \cdot {a}^{2}\right) + -0.375 \cdot \left(c \cdot {a}^{2}\right)\right)\right)\right)\right)}{{b}^{5}} + \left(1.5 \cdot \frac{a}{b} + 3 \cdot \frac{0.75 \cdot \left(c \cdot {a}^{2}\right) + -0.375 \cdot \left(c \cdot {a}^{2}\right)}{{b}^{3}}\right)\right)}}
\] |
fma-def [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\mathsf{fma}\left(3, \frac{-0.5625 \cdot \left({c}^{2} \cdot {a}^{3}\right) + \left(0.2222222222222222 \cdot \frac{{\left(-1.125 \cdot \left({c}^{2} \cdot {a}^{2}\right)\right)}^{2} + 5.0625 \cdot \left({c}^{4} \cdot {a}^{4}\right)}{{c}^{2} \cdot a} + -0.75 \cdot \left(c \cdot \left(a \cdot \left(0.75 \cdot \left(c \cdot {a}^{2}\right) + -0.375 \cdot \left(c \cdot {a}^{2}\right)\right)\right)\right)\right)}{{b}^{5}}, 1.5 \cdot \frac{a}{b} + 3 \cdot \frac{0.75 \cdot \left(c \cdot {a}^{2}\right) + -0.375 \cdot \left(c \cdot {a}^{2}\right)}{{b}^{3}}\right)}\right)}
\] |
Taylor expanded in c around 0 4.2
Simplified4.2
[Start]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(-0.5625, {a}^{3} \cdot \left(c \cdot c\right), \mathsf{fma}\left(0.2222222222222222, \frac{{c}^{2} \cdot \left(1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}\right)}{a}, -0.75 \cdot \left(c \cdot \left(a \cdot \left(\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375\right)\right)\right)\right)\right)}{{b}^{5}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
|---|---|
*-commutative [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(-0.5625, {a}^{3} \cdot \left(c \cdot c\right), \mathsf{fma}\left(0.2222222222222222, \frac{\color{blue}{\left(1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}\right) \cdot {c}^{2}}}{a}, -0.75 \cdot \left(c \cdot \left(a \cdot \left(\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375\right)\right)\right)\right)\right)}{{b}^{5}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
distribute-rgt-out [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(-0.5625, {a}^{3} \cdot \left(c \cdot c\right), \mathsf{fma}\left(0.2222222222222222, \frac{\color{blue}{\left({a}^{4} \cdot \left(1.265625 + 5.0625\right)\right)} \cdot {c}^{2}}{a}, -0.75 \cdot \left(c \cdot \left(a \cdot \left(\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375\right)\right)\right)\right)\right)}{{b}^{5}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
metadata-eval [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(-0.5625, {a}^{3} \cdot \left(c \cdot c\right), \mathsf{fma}\left(0.2222222222222222, \frac{\left({a}^{4} \cdot \color{blue}{6.328125}\right) \cdot {c}^{2}}{a}, -0.75 \cdot \left(c \cdot \left(a \cdot \left(\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375\right)\right)\right)\right)\right)}{{b}^{5}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
unpow2 [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(-0.5625, {a}^{3} \cdot \left(c \cdot c\right), \mathsf{fma}\left(0.2222222222222222, \frac{\left({a}^{4} \cdot 6.328125\right) \cdot \color{blue}{\left(c \cdot c\right)}}{a}, -0.75 \cdot \left(c \cdot \left(a \cdot \left(\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375\right)\right)\right)\right)\right)}{{b}^{5}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
Taylor expanded in a around 0 4.2
Simplified4.2
[Start]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3} \cdot \left(-0.5625 \cdot {c}^{2} + \left(-0.28125 \cdot {c}^{2} + 1.40625 \cdot {c}^{2}\right)\right)}{{b}^{5}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
|---|---|
associate-/l* [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \color{blue}{\frac{{a}^{3}}{\frac{{b}^{5}}{-0.5625 \cdot {c}^{2} + \left(-0.28125 \cdot {c}^{2} + 1.40625 \cdot {c}^{2}\right)}}}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
associate-/r/ [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \color{blue}{\frac{{a}^{3}}{{b}^{5}} \cdot \left(-0.5625 \cdot {c}^{2} + \left(-0.28125 \cdot {c}^{2} + 1.40625 \cdot {c}^{2}\right)\right)}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
*-commutative [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left(\color{blue}{{c}^{2} \cdot -0.5625} + \left(-0.28125 \cdot {c}^{2} + 1.40625 \cdot {c}^{2}\right)\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
distribute-rgt-out [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left({c}^{2} \cdot -0.5625 + \color{blue}{{c}^{2} \cdot \left(-0.28125 + 1.40625\right)}\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
distribute-lft-out [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \color{blue}{\left({c}^{2} \cdot \left(-0.5625 + \left(-0.28125 + 1.40625\right)\right)\right)}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
metadata-eval [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left({c}^{2} \cdot \left(-0.5625 + \color{blue}{1.125}\right)\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
metadata-eval [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left({c}^{2} \cdot \color{blue}{0.5625}\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
unpow2 [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \left(\color{blue}{\left(c \cdot c\right)} \cdot 0.5625\right), \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
associate-*l* [=>]4.2 | \[ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{{a}^{3}}{{b}^{5}} \cdot \color{blue}{\left(c \cdot \left(c \cdot 0.5625\right)\right)}, \mathsf{fma}\left(1.5, \frac{a}{b}, 3 \cdot \frac{\left(c \cdot \left(a \cdot a\right)\right) \cdot 0.375}{{b}^{3}}\right)\right)\right)}
\] |
Final simplification4.8
| Alternative 1 | |
|---|---|
| Error | 6.2 |
| Cost | 28292 |
| Alternative 2 | |
|---|---|
| Error | 6.2 |
| Cost | 28228 |
| Alternative 3 | |
|---|---|
| Error | 6.2 |
| Cost | 28228 |
| Alternative 4 | |
|---|---|
| Error | 6.2 |
| Cost | 28228 |
| Alternative 5 | |
|---|---|
| Error | 6.3 |
| Cost | 28036 |
| Alternative 6 | |
|---|---|
| Error | 6.5 |
| Cost | 21892 |
| Alternative 7 | |
|---|---|
| Error | 6.5 |
| Cost | 21060 |
| Alternative 8 | |
|---|---|
| Error | 6.5 |
| Cost | 21060 |
| Alternative 9 | |
|---|---|
| Error | 6.5 |
| Cost | 16004 |
| Alternative 10 | |
|---|---|
| Error | 9.2 |
| Cost | 14788 |
| Alternative 11 | |
|---|---|
| Error | 9.4 |
| Cost | 7492 |
| Alternative 12 | |
|---|---|
| Error | 9.4 |
| Cost | 7492 |
| Alternative 13 | |
|---|---|
| Error | 11.4 |
| Cost | 832 |
| Alternative 14 | |
|---|---|
| Error | 56.3 |
| Cost | 320 |
| Alternative 15 | |
|---|---|
| Error | 22.6 |
| Cost | 320 |
| Alternative 16 | |
|---|---|
| Error | 22.6 |
| Cost | 320 |
| Alternative 17 | |
|---|---|
| Error | 22.6 |
| Cost | 320 |
herbie shell --seed 2023045
(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)))