| Alternative 1 | |
|---|---|
| Accuracy | 91.8% |
| Cost | 66500 |

(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
(FPCore (a b c)
:precision binary64
(let* ((t_0 (pow (fma b b (* (* c a) -4.0)) 1.5)) (t_1 (cbrt t_0)))
(if (<= b 0.102)
(/ (/ (- t_0 (pow b 3.0)) (fma t_1 (+ b t_1) (* b b))) (* a 2.0))
(-
(-
(fma
-0.25
(* 20.0 (/ (pow c 4.0) (/ (pow b 7.0) (pow a 3.0))))
(/ (* (* -2.0 (* a a)) (pow c 3.0)) (pow b 5.0)))
(/ c b))
(/ (* c c) (/ (pow b 3.0) a))))))double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
double code(double a, double b, double c) {
double t_0 = pow(fma(b, b, ((c * a) * -4.0)), 1.5);
double t_1 = cbrt(t_0);
double tmp;
if (b <= 0.102) {
tmp = ((t_0 - pow(b, 3.0)) / fma(t_1, (b + t_1), (b * b))) / (a * 2.0);
} else {
tmp = (fma(-0.25, (20.0 * (pow(c, 4.0) / (pow(b, 7.0) / pow(a, 3.0)))), (((-2.0 * (a * a)) * pow(c, 3.0)) / pow(b, 5.0))) - (c / b)) - ((c * c) / (pow(b, 3.0) / a));
}
return tmp;
}
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a)) end
function code(a, b, c) t_0 = fma(b, b, Float64(Float64(c * a) * -4.0)) ^ 1.5 t_1 = cbrt(t_0) tmp = 0.0 if (b <= 0.102) tmp = Float64(Float64(Float64(t_0 - (b ^ 3.0)) / fma(t_1, Float64(b + t_1), Float64(b * b))) / Float64(a * 2.0)); else tmp = Float64(Float64(fma(-0.25, Float64(20.0 * Float64((c ^ 4.0) / Float64((b ^ 7.0) / (a ^ 3.0)))), Float64(Float64(Float64(-2.0 * Float64(a * a)) * (c ^ 3.0)) / (b ^ 5.0))) - Float64(c / b)) - Float64(Float64(c * c) / Float64((b ^ 3.0) / a))); end return tmp end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_] := Block[{t$95$0 = N[Power[N[(b * b + N[(N[(c * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 1/3], $MachinePrecision]}, If[LessEqual[b, 0.102], N[(N[(N[(t$95$0 - N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * N[(b + t$95$1), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.25 * N[(20.0 * N[(N[Power[c, 4.0], $MachinePrecision] / N[(N[Power[b, 7.0], $MachinePrecision] / N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-2.0 * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(N[(c * c), $MachinePrecision] / N[(N[Power[b, 3.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)\right)}^{1.5}\\
t_1 := \sqrt[3]{t_0}\\
\mathbf{if}\;b \leq 0.102:\\
\;\;\;\;\frac{\frac{t_0 - {b}^{3}}{\mathsf{fma}\left(t_1, b + t_1, b \cdot b\right)}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.25, 20 \cdot \frac{{c}^{4}}{\frac{{b}^{7}}{{a}^{3}}}, \frac{\left(-2 \cdot \left(a \cdot a\right)\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\
\end{array}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if b < 0.101999999999999993Initial program 85.1%
Applied egg-rr83.7%
[Start]85.1% | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\] |
|---|---|
add-cbrt-cube [=>]83.5% | \[ \frac{\left(-b\right) + \color{blue}{\sqrt[3]{\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}
\] |
pow3 [=>]83.3% | \[ \frac{\left(-b\right) + \sqrt[3]{\color{blue}{{\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}^{3}}}}{2 \cdot a}
\] |
sqrt-pow2 [=>]83.7% | \[ \frac{\left(-b\right) + \sqrt[3]{\color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{\left(\frac{3}{2}\right)}}}}{2 \cdot a}
\] |
*-commutative [=>]83.7% | \[ \frac{\left(-b\right) + \sqrt[3]{{\left(b \cdot b - \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}^{\left(\frac{3}{2}\right)}}}{2 \cdot a}
\] |
*-commutative [=>]83.7% | \[ \frac{\left(-b\right) + \sqrt[3]{{\left(b \cdot b - c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}^{\left(\frac{3}{2}\right)}}}{2 \cdot a}
\] |
metadata-eval [=>]83.7% | \[ \frac{\left(-b\right) + \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{\color{blue}{1.5}}}}{2 \cdot a}
\] |
Applied egg-rr84.3%
[Start]83.7% | \[ \frac{\left(-b\right) + \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}}}{2 \cdot a}
\] |
|---|---|
flip3-+ [=>]83.8% | \[ \frac{\color{blue}{\frac{{\left(-b\right)}^{3} + {\left(\sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}}\right)}}}{2 \cdot a}
\] |
fma-neg [=>]84.4% | \[ \frac{\frac{{\left(-b\right)}^{3} + {\left(\sqrt[3]{{\color{blue}{\left(\mathsf{fma}\left(b, b, -c \cdot \left(a \cdot 4\right)\right)\right)}}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
*-commutative [=>]84.4% | \[ \frac{\frac{{\left(-b\right)}^{3} + {\left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\color{blue}{\left(a \cdot 4\right) \cdot c}\right)\right)}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
*-commutative [<=]84.4% | \[ \frac{\frac{{\left(-b\right)}^{3} + {\left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(a \cdot 4\right)}\right)\right)}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
associate-*r* [=>]84.4% | \[ \frac{\frac{{\left(-b\right)}^{3} + {\left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\color{blue}{\left(c \cdot a\right) \cdot 4}\right)\right)}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(b \cdot b - c \cdot \left(a \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
Simplified86.1%
[Start]84.3% | \[ \frac{\frac{{\left(-b\right)}^{3} + {\left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
|---|---|
cube-neg [=>]84.3% | \[ \frac{\frac{\color{blue}{\left(-{b}^{3}\right)} + {\left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
mul-1-neg [<=]84.3% | \[ \frac{\frac{\color{blue}{-1 \cdot {b}^{3}} + {\left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
rem-cube-cbrt [=>]86.0% | \[ \frac{\frac{-1 \cdot {b}^{3} + \color{blue}{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
+-commutative [=>]86.0% | \[ \frac{\frac{\color{blue}{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5} + -1 \cdot {b}^{3}}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
mul-1-neg [=>]86.0% | \[ \frac{\frac{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5} + \color{blue}{\left(-{b}^{3}\right)}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
unsub-neg [=>]86.0% | \[ \frac{\frac{\color{blue}{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5} - {b}^{3}}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
distribute-rgt-neg-in [=>]86.0% | \[ \frac{\frac{{\left(\mathsf{fma}\left(b, b, \color{blue}{\left(c \cdot a\right) \cdot \left(-4\right)}\right)\right)}^{1.5} - {b}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
metadata-eval [=>]86.0% | \[ \frac{\frac{{\left(\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot \color{blue}{-4}\right)\right)}^{1.5} - {b}^{3}}{\left(-b\right) \cdot \left(-b\right) + \left(\sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}} - \left(-b\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(b, b, -\left(c \cdot a\right) \cdot 4\right)\right)}^{1.5}}\right)}}{2 \cdot a}
\] |
if 0.101999999999999993 < b Initial program 50.4%
Simplified50.4%
[Start]50.4% | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\] |
|---|---|
neg-sub0 [=>]50.4% | \[ \frac{\color{blue}{\left(0 - b\right)} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\] |
associate-+l- [=>]50.4% | \[ \frac{\color{blue}{0 - \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}{2 \cdot a}
\] |
sub0-neg [=>]50.4% | \[ \frac{\color{blue}{-\left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}{2 \cdot a}
\] |
neg-mul-1 [=>]50.4% | \[ \frac{\color{blue}{-1 \cdot \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}{2 \cdot a}
\] |
associate-*l/ [<=]50.4% | \[ \color{blue}{\frac{-1}{2 \cdot a} \cdot \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}
\] |
*-commutative [=>]50.4% | \[ \color{blue}{\left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \frac{-1}{2 \cdot a}}
\] |
associate-/r* [=>]50.4% | \[ \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \color{blue}{\frac{\frac{-1}{2}}{a}}
\] |
/-rgt-identity [<=]50.4% | \[ \color{blue}{\frac{b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{1}} \cdot \frac{\frac{-1}{2}}{a}
\] |
metadata-eval [<=]50.4% | \[ \frac{b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{--1}} \cdot \frac{\frac{-1}{2}}{a}
\] |
Taylor expanded in a around 0 94.8%
Simplified94.8%
[Start]94.8% | \[ -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + \left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{\left({\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2} + 16 \cdot \frac{{c}^{4}}{{b}^{6}}\right) \cdot {a}^{3}}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right)
\] |
|---|---|
+-commutative [=>]94.8% | \[ \color{blue}{\left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{\left({\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2} + 16 \cdot \frac{{c}^{4}}{{b}^{6}}\right) \cdot {a}^{3}}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right) + -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}}
\] |
mul-1-neg [=>]94.8% | \[ \left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{\left({\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2} + 16 \cdot \frac{{c}^{4}}{{b}^{6}}\right) \cdot {a}^{3}}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right) + \color{blue}{\left(-\frac{{c}^{2} \cdot a}{{b}^{3}}\right)}
\] |
unsub-neg [=>]94.8% | \[ \color{blue}{\left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{\left({\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2} + 16 \cdot \frac{{c}^{4}}{{b}^{6}}\right) \cdot {a}^{3}}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right) - \frac{{c}^{2} \cdot a}{{b}^{3}}}
\] |
Taylor expanded in c around 0 94.8%
Simplified94.8%
[Start]94.8% | \[ \left(\mathsf{fma}\left(-0.25, 20 \cdot \frac{{c}^{4} \cdot {a}^{3}}{{b}^{7}}, \frac{\left(-2 \cdot \left(a \cdot a\right)\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \frac{c \cdot c}{\frac{{b}^{3}}{a}}
\] |
|---|---|
associate-/l* [=>]94.8% | \[ \left(\mathsf{fma}\left(-0.25, 20 \cdot \color{blue}{\frac{{c}^{4}}{\frac{{b}^{7}}{{a}^{3}}}}, \frac{\left(-2 \cdot \left(a \cdot a\right)\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \frac{c \cdot c}{\frac{{b}^{3}}{a}}
\] |
Final simplification93.9%
| Alternative 1 | |
|---|---|
| Accuracy | 91.8% |
| Cost | 66500 |
| Alternative 2 | |
|---|---|
| Accuracy | 91.8% |
| Cost | 60228 |
| Alternative 3 | |
|---|---|
| Accuracy | 91.7% |
| Cost | 47172 |
| Alternative 4 | |
|---|---|
| Accuracy | 88.7% |
| Cost | 46468 |
| Alternative 5 | |
|---|---|
| Accuracy | 88.9% |
| Cost | 20868 |
| Alternative 6 | |
|---|---|
| Accuracy | 85.3% |
| Cost | 13764 |
| Alternative 7 | |
|---|---|
| Accuracy | 85.3% |
| Cost | 7492 |
| Alternative 8 | |
|---|---|
| Accuracy | 81.2% |
| Cost | 1024 |
| Alternative 9 | |
|---|---|
| Accuracy | 64.2% |
| Cost | 256 |
herbie shell --seed 2023178
(FPCore (a b c)
:name "Quadratic roots, 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) (* (* 4.0 a) c)))) (* 2.0 a)))