| Alternative 1 | |
|---|---|
| Accuracy | 88.2% |
| Cost | 20808 |

(FPCore (a b_2 c) :precision binary64 (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
(FPCore (a b_2 c)
:precision binary64
(let* ((t_0 (/ (* -0.5 c) b_2)))
(if (<= b_2 -1.85e+28)
t_0
(if (<= b_2 -1.75e-37)
(/
(/
(+ (- (* b_2 b_2) (* b_2 b_2)) (* c a))
(fma -1.0 b_2 (hypot b_2 (sqrt (* c (- a))))))
a)
(if (<= b_2 -1.35e-119)
t_0
(if (<= b_2 0.0002)
(/
(-
(- b_2)
(sqrt (+ (- (* b_2 b_2) (* c a)) (* 2.0 (fma a (- c) (* c a))))))
a)
(* -2.0 (/ b_2 a))))))))double code(double a, double b_2, double c) {
return (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
}
double code(double a, double b_2, double c) {
double t_0 = (-0.5 * c) / b_2;
double tmp;
if (b_2 <= -1.85e+28) {
tmp = t_0;
} else if (b_2 <= -1.75e-37) {
tmp = ((((b_2 * b_2) - (b_2 * b_2)) + (c * a)) / fma(-1.0, b_2, hypot(b_2, sqrt((c * -a))))) / a;
} else if (b_2 <= -1.35e-119) {
tmp = t_0;
} else if (b_2 <= 0.0002) {
tmp = (-b_2 - sqrt((((b_2 * b_2) - (c * a)) + (2.0 * fma(a, -c, (c * a)))))) / a;
} else {
tmp = -2.0 * (b_2 / a);
}
return tmp;
}
function code(a, b_2, c) return Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a) end
function code(a, b_2, c) t_0 = Float64(Float64(-0.5 * c) / b_2) tmp = 0.0 if (b_2 <= -1.85e+28) tmp = t_0; elseif (b_2 <= -1.75e-37) tmp = Float64(Float64(Float64(Float64(Float64(b_2 * b_2) - Float64(b_2 * b_2)) + Float64(c * a)) / fma(-1.0, b_2, hypot(b_2, sqrt(Float64(c * Float64(-a)))))) / a); elseif (b_2 <= -1.35e-119) tmp = t_0; elseif (b_2 <= 0.0002) tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(Float64(b_2 * b_2) - Float64(c * a)) + Float64(2.0 * fma(a, Float64(-c), Float64(c * a)))))) / a); else tmp = Float64(-2.0 * Float64(b_2 / a)); end return tmp end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[(N[(-0.5 * c), $MachinePrecision] / b$95$2), $MachinePrecision]}, If[LessEqual[b$95$2, -1.85e+28], t$95$0, If[LessEqual[b$95$2, -1.75e-37], N[(N[(N[(N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(b$95$2 * b$95$2), $MachinePrecision]), $MachinePrecision] + N[(c * a), $MachinePrecision]), $MachinePrecision] / N[(-1.0 * b$95$2 + N[Sqrt[b$95$2 ^ 2 + N[Sqrt[N[(c * (-a)), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, -1.35e-119], t$95$0, If[LessEqual[b$95$2, 0.0002], N[(N[((-b$95$2) - N[Sqrt[N[(N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(c * a), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(a * (-c) + N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]]]]]]
\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
t_0 := \frac{-0.5 \cdot c}{b_2}\\
\mathbf{if}\;b_2 \leq -1.85 \cdot 10^{+28}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b_2 \leq -1.75 \cdot 10^{-37}:\\
\;\;\;\;\frac{\frac{\left(b_2 \cdot b_2 - b_2 \cdot b_2\right) + c \cdot a}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right)}}{a}\\
\mathbf{elif}\;b_2 \leq -1.35 \cdot 10^{-119}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b_2 \leq 0.0002:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, c \cdot a\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a}\\
\end{array}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if b_2 < -1.85e28 or -1.7500000000000001e-37 < b_2 < -1.35000000000000013e-119Initial program 20.5%
Taylor expanded in b_2 around -inf 89.9%
Simplified89.9%
[Start]89.9% | \[ -0.5 \cdot \frac{c}{b_2}
\] |
|---|---|
associate-*r/ [=>]89.9% | \[ \color{blue}{\frac{-0.5 \cdot c}{b_2}}
\] |
if -1.85e28 < b_2 < -1.7500000000000001e-37Initial program 73.9%
Applied egg-rr51.9%
[Start]73.9% | \[ \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\] |
|---|---|
add-cbrt-cube [=>]55.9% | \[ \frac{\left(-b_2\right) - \color{blue}{\sqrt[3]{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a}
\] |
pow3 [=>]55.3% | \[ \frac{\left(-b_2\right) - \sqrt[3]{\color{blue}{{\left(\sqrt{b_2 \cdot b_2 - a \cdot c}\right)}^{3}}}}{a}
\] |
pow1/3 [=>]51.9% | \[ \frac{\left(-b_2\right) - \color{blue}{{\left({\left(\sqrt{b_2 \cdot b_2 - a \cdot c}\right)}^{3}\right)}^{0.3333333333333333}}}{a}
\] |
sqrt-pow2 [=>]51.9% | \[ \frac{\left(-b_2\right) - {\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333}}{a}
\] |
metadata-eval [=>]51.9% | \[ \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333}}{a}
\] |
Simplified55.6%
[Start]51.9% | \[ \frac{\left(-b_2\right) - {\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{1.5}\right)}^{0.3333333333333333}}{a}
\] |
|---|---|
unpow1/3 [=>]55.6% | \[ \frac{\left(-b_2\right) - \color{blue}{\sqrt[3]{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{1.5}}}}{a}
\] |
*-commutative [=>]55.6% | \[ \frac{\left(-b_2\right) - \sqrt[3]{{\left(b_2 \cdot b_2 - \color{blue}{c \cdot a}\right)}^{1.5}}}{a}
\] |
Applied egg-rr73.5%
[Start]55.6% | \[ \frac{\left(-b_2\right) - \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}{a}
\] |
|---|---|
flip-- [=>]54.7% | \[ \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}} \cdot \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}}{a}
\] |
pow2 [=>]54.7% | \[ \frac{\frac{\color{blue}{{\left(-b_2\right)}^{2}} - \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}} \cdot \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
pow1/3 [=>]51.2% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - \color{blue}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}\right)}^{0.3333333333333333}} \cdot \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
pow1/3 [=>]50.3% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - {\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}\right)}^{0.3333333333333333} \cdot \color{blue}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}\right)}^{0.3333333333333333}}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
pow-prod-down [=>]42.5% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - \color{blue}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5} \cdot {\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}\right)}^{0.3333333333333333}}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
pow-prod-up [=>]42.5% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - {\color{blue}{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{\left(1.5 + 1.5\right)}\right)}}^{0.3333333333333333}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
metadata-eval [=>]42.5% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - {\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{\color{blue}{3}}\right)}^{0.3333333333333333}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
pow3 [<=]42.5% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - {\color{blue}{\left(\left(\left(b_2 \cdot b_2 - c \cdot a\right) \cdot \left(b_2 \cdot b_2 - c \cdot a\right)\right) \cdot \left(b_2 \cdot b_2 - c \cdot a\right)\right)}}^{0.3333333333333333}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
pow1/3 [<=]45.6% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - \color{blue}{\sqrt[3]{\left(\left(b_2 \cdot b_2 - c \cdot a\right) \cdot \left(b_2 \cdot b_2 - c \cdot a\right)\right) \cdot \left(b_2 \cdot b_2 - c \cdot a\right)}}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
add-cbrt-cube [<=]55.9% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - \color{blue}{\left(b_2 \cdot b_2 - c \cdot a\right)}}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
*-commutative [=>]55.9% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - \left(b_2 \cdot b_2 - \color{blue}{a \cdot c}\right)}{\left(-b_2\right) + \sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}}}{a}
\] |
Simplified91.1%
[Start]73.5% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - \left(b_2 \cdot b_2 - a \cdot c\right)}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right)}}{a}
\] |
|---|---|
unpow2 [<=]73.5% | \[ \frac{\frac{{\left(-b_2\right)}^{2} - \left(\color{blue}{{b_2}^{2}} - a \cdot c\right)}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right)}}{a}
\] |
associate--r- [=>]91.1% | \[ \frac{\frac{\color{blue}{\left({\left(-b_2\right)}^{2} - {b_2}^{2}\right) + a \cdot c}}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right)}}{a}
\] |
unpow2 [=>]91.1% | \[ \frac{\frac{\left(\color{blue}{\left(-b_2\right) \cdot \left(-b_2\right)} - {b_2}^{2}\right) + a \cdot c}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right)}}{a}
\] |
sqr-neg [=>]91.1% | \[ \frac{\frac{\left(\color{blue}{b_2 \cdot b_2} - {b_2}^{2}\right) + a \cdot c}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right)}}{a}
\] |
unpow2 [=>]91.1% | \[ \frac{\frac{\left(b_2 \cdot b_2 - \color{blue}{b_2 \cdot b_2}\right) + a \cdot c}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{c \cdot \left(-a\right)}\right)\right)}}{a}
\] |
distribute-rgt-neg-out [=>]91.1% | \[ \frac{\frac{\left(b_2 \cdot b_2 - b_2 \cdot b_2\right) + a \cdot c}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{\color{blue}{-c \cdot a}}\right)\right)}}{a}
\] |
*-commutative [<=]91.1% | \[ \frac{\frac{\left(b_2 \cdot b_2 - b_2 \cdot b_2\right) + a \cdot c}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{-\color{blue}{a \cdot c}}\right)\right)}}{a}
\] |
distribute-rgt-neg-out [<=]91.1% | \[ \frac{\frac{\left(b_2 \cdot b_2 - b_2 \cdot b_2\right) + a \cdot c}{\mathsf{fma}\left(-1, b_2, \mathsf{hypot}\left(b_2, \sqrt{\color{blue}{a \cdot \left(-c\right)}}\right)\right)}}{a}
\] |
if -1.35000000000000013e-119 < b_2 < 2.0000000000000001e-4Initial program 81.0%
Applied egg-rr81.0%
[Start]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\] |
|---|---|
prod-diff [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\color{blue}{\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}}{a}
\] |
*-commutative [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a}
\] |
fma-neg [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a}
\] |
prod-diff [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a}
\] |
*-commutative [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a}
\] |
fma-neg [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)}}{a}
\] |
associate-+l+ [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, c \cdot a\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}}{a}
\] |
*-commutative [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a}
\] |
fma-udef [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a}
\] |
distribute-lft-neg-in [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a}
\] |
*-commutative [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a}
\] |
distribute-rgt-neg-in [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right) + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a}
\] |
fma-def [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)} + \mathsf{fma}\left(-c, a, c \cdot a\right)\right)}}{a}
\] |
*-commutative [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(-c, a, \color{blue}{a \cdot c}\right)\right)}}{a}
\] |
fma-udef [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\left(\left(-c\right) \cdot a + a \cdot c\right)}\right)}}{a}
\] |
distribute-lft-neg-in [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{\left(-c \cdot a\right)} + a \cdot c\right)\right)}}{a}
\] |
*-commutative [<=]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\left(-\color{blue}{a \cdot c}\right) + a \cdot c\right)\right)}}{a}
\] |
distribute-rgt-neg-in [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \left(\color{blue}{a \cdot \left(-c\right)} + a \cdot c\right)\right)}}{a}
\] |
fma-def [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \color{blue}{\mathsf{fma}\left(a, -c, a \cdot c\right)}\right)}}{a}
\] |
Simplified81.0%
[Start]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - a \cdot c\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}{a}
\] |
|---|---|
*-commutative [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - \color{blue}{c \cdot a}\right) + \left(\mathsf{fma}\left(a, -c, a \cdot c\right) + \mathsf{fma}\left(a, -c, a \cdot c\right)\right)}}{a}
\] |
count-2 [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + \color{blue}{2 \cdot \mathsf{fma}\left(a, -c, a \cdot c\right)}}}{a}
\] |
*-commutative [=>]81.0% | \[ \frac{\left(-b_2\right) - \sqrt{\left(b_2 \cdot b_2 - c \cdot a\right) + 2 \cdot \mathsf{fma}\left(a, -c, \color{blue}{c \cdot a}\right)}}{a}
\] |
if 2.0000000000000001e-4 < b_2 Initial program 86.6%
Taylor expanded in b_2 around inf 100.0%
Final simplification90.2%
| Alternative 1 | |
|---|---|
| Accuracy | 88.2% |
| Cost | 20808 |
| Alternative 2 | |
|---|---|
| Accuracy | 86.6% |
| Cost | 14672 |
| Alternative 3 | |
|---|---|
| Accuracy | 86.5% |
| Cost | 7696 |
| Alternative 4 | |
|---|---|
| Accuracy | 85.9% |
| Cost | 7240 |
| Alternative 5 | |
|---|---|
| Accuracy | 85.8% |
| Cost | 7112 |
| Alternative 6 | |
|---|---|
| Accuracy | 77.1% |
| Cost | 836 |
| Alternative 7 | |
|---|---|
| Accuracy | 47.1% |
| Cost | 452 |
| Alternative 8 | |
|---|---|
| Accuracy | 76.8% |
| Cost | 452 |
| Alternative 9 | |
|---|---|
| Accuracy | 28.6% |
| Cost | 388 |
| Alternative 10 | |
|---|---|
| Accuracy | 10.0% |
| Cost | 192 |
herbie shell --seed 2023277
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))