| Alternative 1 | |
|---|---|
| Error | 6.2 |
| Cost | 48068 |
(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))))
(if (<= (/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a)) -0.027)
(/
(* (cbrt (* (* c c) (* a a))) (cbrt 9.0))
(/ (* (* a -3.0) (+ b (sqrt t_0))) (cbrt (- (* b b) t_0))))
(/
1.0
(fma
-2.0
(/ b c)
(fma
3.0
(/
(fma
-0.5625
(* (* c c) (pow a 3.0))
(* (pow a 3.0) (* (* c c) 1.125)))
(pow b 5.0))
(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(a, (c * -3.0), (b * b));
double tmp;
if (((sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a)) <= -0.027) {
tmp = (cbrt(((c * c) * (a * a))) * cbrt(9.0)) / (((a * -3.0) * (b + sqrt(t_0))) / cbrt(((b * b) - t_0)));
} else {
tmp = 1.0 / fma(-2.0, (b / c), fma(3.0, (fma(-0.5625, ((c * c) * pow(a, 3.0)), (pow(a, 3.0) * ((c * c) * 1.125))) / pow(b, 5.0)), 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(a, Float64(c * -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)) <= -0.027) tmp = Float64(Float64(cbrt(Float64(Float64(c * c) * Float64(a * a))) * cbrt(9.0)) / Float64(Float64(Float64(a * -3.0) * Float64(b + sqrt(t_0))) / cbrt(Float64(Float64(b * b) - t_0)))); else tmp = Float64(1.0 / fma(-2.0, Float64(b / c), fma(3.0, Float64(fma(-0.5625, Float64(Float64(c * c) * (a ^ 3.0)), Float64((a ^ 3.0) * Float64(Float64(c * c) * 1.125))) / (b ^ 5.0)), 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[(a * N[(c * -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], -0.027], N[(N[(N[Power[N[(N[(c * c), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[Power[9.0, 1/3], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(a * -3.0), $MachinePrecision] * N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(-2.0 * N[(b / c), $MachinePrecision] + N[(3.0 * N[(N[(-0.5625 * N[(N[(c * c), $MachinePrecision] * N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[a, 3.0], $MachinePrecision] * N[(N[(c * c), $MachinePrecision] * 1.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $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(a, c \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 -0.027:\\
\;\;\;\;\frac{\sqrt[3]{\left(c \cdot c\right) \cdot \left(a \cdot a\right)} \cdot \sqrt[3]{9}}{\frac{\left(a \cdot -3\right) \cdot \left(b + \sqrt{t_0}\right)}{\sqrt[3]{b \cdot b - t_0}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \mathsf{fma}\left(3, \frac{\mathsf{fma}\left(-0.5625, \left(c \cdot c\right) \cdot {a}^{3}, {a}^{3} \cdot \left(\left(c \cdot c\right) \cdot 1.125\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)}\\
\end{array}
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -0.0269999999999999997Initial program 13.1
Simplified13.1
[Start]13.1 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\] |
|---|---|
remove-double-neg [<=]13.1 | \[ \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 [<=]13.1 | \[ \frac{\color{blue}{\left(-b\right) - \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a}
\] |
div-sub [=>]13.6 | \[ \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 [=>]13.6 | \[ \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/ [<=]13.8 | \[ \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 [=>]13.8 | \[ \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 [=>]13.7 | \[ \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 [<=]13.7 | \[ \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 [<=]13.7 | \[ \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* [<=]13.7 | \[ \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 [<=]13.7 | \[ \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 [<=]13.7 | \[ \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 [<=]13.8 | \[ \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 [=>]13.8 | \[ \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-rr12.3
Taylor expanded in b around 0 11.1
Simplified10.9
[Start]11.1 | \[ \frac{{\left({c}^{2} \cdot \left(1 \cdot {a}^{2}\right)\right)}^{0.3333333333333333} \cdot \sqrt[3]{9}}{\frac{\left(a \cdot -3\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}
\] |
|---|---|
unpow1/3 [=>]10.9 | \[ \frac{\color{blue}{\sqrt[3]{{c}^{2} \cdot \left(1 \cdot {a}^{2}\right)}} \cdot \sqrt[3]{9}}{\frac{\left(a \cdot -3\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}
\] |
unpow2 [=>]10.9 | \[ \frac{\sqrt[3]{\color{blue}{\left(c \cdot c\right)} \cdot \left(1 \cdot {a}^{2}\right)} \cdot \sqrt[3]{9}}{\frac{\left(a \cdot -3\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}
\] |
*-lft-identity [=>]10.9 | \[ \frac{\sqrt[3]{\left(c \cdot c\right) \cdot \color{blue}{{a}^{2}}} \cdot \sqrt[3]{9}}{\frac{\left(a \cdot -3\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}
\] |
unpow2 [=>]10.9 | \[ \frac{\sqrt[3]{\left(c \cdot c\right) \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \sqrt[3]{9}}{\frac{\left(a \cdot -3\right) \cdot \left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}\right)}{\sqrt[3]{b \cdot b - \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}}
\] |
if -0.0269999999999999997 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) Initial program 32.9
Simplified32.9
[Start]32.9 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\] |
|---|---|
remove-double-neg [<=]32.9 | \[ \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 [<=]32.9 | \[ \frac{\color{blue}{\left(-b\right) - \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a}
\] |
div-sub [=>]33.4 | \[ \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 [=>]33.4 | \[ \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/ [<=]33.4 | \[ \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 [=>]33.4 | \[ \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 [=>]32.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 [<=]32.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 [<=]32.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* [<=]32.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 [<=]32.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 [<=]32.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 [<=]33.4 | \[ \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 [=>]33.4 | \[ \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-rr32.9
Taylor expanded in b around inf 3.4
Simplified3.4
[Start]3.4 | \[ \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 [=>]3.4 | \[ \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 [=>]3.4 | \[ \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 3.4
Simplified3.4
[Start]3.4 | \[ \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), {c}^{2} \cdot \left(0.2222222222222222 \cdot \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{a} + -0.28125 \cdot {a}^{3}\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 [=>]3.4 | \[ \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), \color{blue}{\left(c \cdot c\right)} \cdot \left(0.2222222222222222 \cdot \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{a} + -0.28125 \cdot {a}^{3}\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)}
\] |
fma-def [=>]3.4 | \[ \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), \left(c \cdot c\right) \cdot \color{blue}{\mathsf{fma}\left(0.2222222222222222, \frac{1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}}{a}, -0.28125 \cdot {a}^{3}\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 [=>]3.4 | \[ \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), \left(c \cdot c\right) \cdot \mathsf{fma}\left(0.2222222222222222, \frac{\color{blue}{{a}^{4} \cdot \left(1.265625 + 5.0625\right)}}{a}, -0.28125 \cdot {a}^{3}\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 [=>]3.4 | \[ \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), \left(c \cdot c\right) \cdot \mathsf{fma}\left(0.2222222222222222, \frac{{a}^{4} \cdot \color{blue}{6.328125}}{a}, -0.28125 \cdot {a}^{3}\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 [=>]3.4 | \[ \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), \left(c \cdot c\right) \cdot \mathsf{fma}\left(0.2222222222222222, \frac{{a}^{4} \cdot 6.328125}{a}, \color{blue}{{a}^{3} \cdot -0.28125}\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 c around 0 3.4
Simplified3.4
[Start]3.4 | \[ \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), {c}^{2} \cdot \left(-0.28125 \cdot {a}^{3} + 1.40625 \cdot {a}^{3}\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 [=>]3.4 | \[ \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), \color{blue}{\left(-0.28125 \cdot {a}^{3} + 1.40625 \cdot {a}^{3}\right) \cdot {c}^{2}}\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 [=>]3.4 | \[ \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), \color{blue}{\left({a}^{3} \cdot \left(-0.28125 + 1.40625\right)\right)} \cdot {c}^{2}\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 [=>]3.4 | \[ \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), \left({a}^{3} \cdot \color{blue}{1.125}\right) \cdot {c}^{2}\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 [=>]3.4 | \[ \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), \left({a}^{3} \cdot 1.125\right) \cdot \color{blue}{\left(c \cdot c\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* [=>]3.4 | \[ \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), \color{blue}{{a}^{3} \cdot \left(1.125 \cdot \left(c \cdot c\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)}
\] |
Final simplification5.1
| Alternative 1 | |
|---|---|
| Error | 6.2 |
| Cost | 48068 |
| Alternative 2 | |
|---|---|
| Error | 6.2 |
| Cost | 48068 |
| Alternative 3 | |
|---|---|
| Error | 6.5 |
| Cost | 28228 |
| Alternative 4 | |
|---|---|
| Error | 6.5 |
| Cost | 28228 |
| Alternative 5 | |
|---|---|
| Error | 6.7 |
| Cost | 28036 |
| Alternative 6 | |
|---|---|
| Error | 6.9 |
| Cost | 27524 |
| Alternative 7 | |
|---|---|
| Error | 6.9 |
| Cost | 21764 |
| Alternative 8 | |
|---|---|
| Error | 6.9 |
| Cost | 21188 |
| Alternative 9 | |
|---|---|
| Error | 6.9 |
| Cost | 16004 |
| Alternative 10 | |
|---|---|
| Error | 9.1 |
| Cost | 14788 |
| Alternative 11 | |
|---|---|
| Error | 10.1 |
| Cost | 7492 |
| Alternative 12 | |
|---|---|
| Error | 11.5 |
| Cost | 832 |
| Alternative 13 | |
|---|---|
| Error | 22.9 |
| Cost | 320 |
| Alternative 14 | |
|---|---|
| Error | 62.0 |
| Cost | 64 |
herbie shell --seed 2023056
(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)))