| Alternative 1 | |
|---|---|
| Accuracy | 88.4% |
| Cost | 49412 |
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b 0.55)
(/ (- (sqrt (+ (* b b) (* a (* c -4.0)))) b) (* a 2.0))
(-
(*
0.5
(+
(+
(* (pow c 3.0) (/ (* a a) (/ (pow b 5.0) -4.0)))
(*
(* c c)
(+
(/ a (pow b 3.0))
(* 2.0 (/ (* (/ (* a a) (pow b 4.0)) -1.5) (/ a b))))))
(*
(pow c 4.0)
(+
(/ (* (/ (pow a 4.0) (pow b 8.0)) 2.25) (/ a b))
(* -12.25 (/ (pow a 3.0) (pow b 7.0)))))))
(/ c b))))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 tmp;
if (b <= 0.55) {
tmp = (sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0);
} else {
tmp = (0.5 * (((pow(c, 3.0) * ((a * a) / (pow(b, 5.0) / -4.0))) + ((c * c) * ((a / pow(b, 3.0)) + (2.0 * ((((a * a) / pow(b, 4.0)) * -1.5) / (a / b)))))) + (pow(c, 4.0) * ((((pow(a, 4.0) / pow(b, 8.0)) * 2.25) / (a / b)) + (-12.25 * (pow(a, 3.0) / pow(b, 7.0))))))) - (c / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 0.55d0) then
tmp = (sqrt(((b * b) + (a * (c * (-4.0d0))))) - b) / (a * 2.0d0)
else
tmp = (0.5d0 * ((((c ** 3.0d0) * ((a * a) / ((b ** 5.0d0) / (-4.0d0)))) + ((c * c) * ((a / (b ** 3.0d0)) + (2.0d0 * ((((a * a) / (b ** 4.0d0)) * (-1.5d0)) / (a / b)))))) + ((c ** 4.0d0) * (((((a ** 4.0d0) / (b ** 8.0d0)) * 2.25d0) / (a / b)) + ((-12.25d0) * ((a ** 3.0d0) / (b ** 7.0d0))))))) - (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
public static double code(double a, double b, double c) {
double tmp;
if (b <= 0.55) {
tmp = (Math.sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0);
} else {
tmp = (0.5 * (((Math.pow(c, 3.0) * ((a * a) / (Math.pow(b, 5.0) / -4.0))) + ((c * c) * ((a / Math.pow(b, 3.0)) + (2.0 * ((((a * a) / Math.pow(b, 4.0)) * -1.5) / (a / b)))))) + (Math.pow(c, 4.0) * ((((Math.pow(a, 4.0) / Math.pow(b, 8.0)) * 2.25) / (a / b)) + (-12.25 * (Math.pow(a, 3.0) / Math.pow(b, 7.0))))))) - (c / b);
}
return tmp;
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
def code(a, b, c): tmp = 0 if b <= 0.55: tmp = (math.sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0) else: tmp = (0.5 * (((math.pow(c, 3.0) * ((a * a) / (math.pow(b, 5.0) / -4.0))) + ((c * c) * ((a / math.pow(b, 3.0)) + (2.0 * ((((a * a) / math.pow(b, 4.0)) * -1.5) / (a / b)))))) + (math.pow(c, 4.0) * ((((math.pow(a, 4.0) / math.pow(b, 8.0)) * 2.25) / (a / b)) + (-12.25 * (math.pow(a, 3.0) / math.pow(b, 7.0))))))) - (c / b) 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) tmp = 0.0 if (b <= 0.55) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -4.0)))) - b) / Float64(a * 2.0)); else tmp = Float64(Float64(0.5 * Float64(Float64(Float64((c ^ 3.0) * Float64(Float64(a * a) / Float64((b ^ 5.0) / -4.0))) + Float64(Float64(c * c) * Float64(Float64(a / (b ^ 3.0)) + Float64(2.0 * Float64(Float64(Float64(Float64(a * a) / (b ^ 4.0)) * -1.5) / Float64(a / b)))))) + Float64((c ^ 4.0) * Float64(Float64(Float64(Float64((a ^ 4.0) / (b ^ 8.0)) * 2.25) / Float64(a / b)) + Float64(-12.25 * Float64((a ^ 3.0) / (b ^ 7.0))))))) - Float64(c / b)); end return tmp end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a); end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 0.55) tmp = (sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0); else tmp = (0.5 * ((((c ^ 3.0) * ((a * a) / ((b ^ 5.0) / -4.0))) + ((c * c) * ((a / (b ^ 3.0)) + (2.0 * ((((a * a) / (b ^ 4.0)) * -1.5) / (a / b)))))) + ((c ^ 4.0) * (((((a ^ 4.0) / (b ^ 8.0)) * 2.25) / (a / b)) + (-12.25 * ((a ^ 3.0) / (b ^ 7.0))))))) - (c / b); end tmp_2 = 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_] := If[LessEqual[b, 0.55], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(N[(N[(N[Power[c, 3.0], $MachinePrecision] * N[(N[(a * a), $MachinePrecision] / N[(N[Power[b, 5.0], $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(c * c), $MachinePrecision] * N[(N[(a / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(N[(N[(a * a), $MachinePrecision] / N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] * -1.5), $MachinePrecision] / N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[c, 4.0], $MachinePrecision] * N[(N[(N[(N[(N[Power[a, 4.0], $MachinePrecision] / N[Power[b, 8.0], $MachinePrecision]), $MachinePrecision] * 2.25), $MachinePrecision] / N[(a / b), $MachinePrecision]), $MachinePrecision] + N[(-12.25 * N[(N[Power[a, 3.0], $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \leq 0.55:\\
\;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left({c}^{3} \cdot \frac{a \cdot a}{\frac{{b}^{5}}{-4}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b}\\
\end{array}
Results
if b < 0.55000000000000004Initial program 82.5%
Simplified82.6%
[Start]82.5 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\] |
|---|---|
*-commutative [=>]82.5 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}}
\] |
+-commutative [=>]82.5 | \[ \frac{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(-b\right)}}{a \cdot 2}
\] |
unsub-neg [=>]82.5 | \[ \frac{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}}{a \cdot 2}
\] |
fma-neg [=>]82.6 | \[ \frac{\sqrt{\color{blue}{\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)}} - b}{a \cdot 2}
\] |
associate-*l* [=>]82.6 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, -\color{blue}{4 \cdot \left(a \cdot c\right)}\right)} - b}{a \cdot 2}
\] |
*-commutative [=>]82.6 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(a \cdot c\right) \cdot 4}\right)} - b}{a \cdot 2}
\] |
distribute-rgt-neg-in [=>]82.6 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(a \cdot c\right) \cdot \left(-4\right)}\right)} - b}{a \cdot 2}
\] |
metadata-eval [=>]82.6 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{-4}\right)} - b}{a \cdot 2}
\] |
Applied egg-rr82.5%
[Start]82.6 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)} - b}{a \cdot 2}
\] |
|---|---|
fma-udef [=>]82.5 | \[ \frac{\sqrt{\color{blue}{b \cdot b + \left(a \cdot c\right) \cdot -4}} - b}{a \cdot 2}
\] |
associate-*l* [=>]82.5 | \[ \frac{\sqrt{b \cdot b + \color{blue}{a \cdot \left(c \cdot -4\right)}} - b}{a \cdot 2}
\] |
if 0.55000000000000004 < b Initial program 51.6%
Simplified51.7%
[Start]51.6 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\] |
|---|---|
*-commutative [=>]51.6 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}}
\] |
+-commutative [=>]51.6 | \[ \frac{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(-b\right)}}{a \cdot 2}
\] |
unsub-neg [=>]51.6 | \[ \frac{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}}{a \cdot 2}
\] |
fma-neg [=>]51.7 | \[ \frac{\sqrt{\color{blue}{\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)}} - b}{a \cdot 2}
\] |
associate-*l* [=>]51.7 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, -\color{blue}{4 \cdot \left(a \cdot c\right)}\right)} - b}{a \cdot 2}
\] |
*-commutative [=>]51.7 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(a \cdot c\right) \cdot 4}\right)} - b}{a \cdot 2}
\] |
distribute-rgt-neg-in [=>]51.7 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(a \cdot c\right) \cdot \left(-4\right)}\right)} - b}{a \cdot 2}
\] |
metadata-eval [=>]51.7 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{-4}\right)} - b}{a \cdot 2}
\] |
Applied egg-rr51.3%
[Start]51.7 | \[ \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)} - b}{a \cdot 2}
\] |
|---|---|
add-sqr-sqrt [=>]50.6 | \[ \frac{\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}} - b}{a \cdot 2}
\] |
fma-neg [=>]51.2 | \[ \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}}{a \cdot 2}
\] |
pow1/2 [=>]51.2 | \[ \frac{\mathsf{fma}\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.5}}}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}{a \cdot 2}
\] |
sqrt-pow1 [=>]51.8 | \[ \frac{\mathsf{fma}\left(\color{blue}{{\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{\left(\frac{0.5}{2}\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}{a \cdot 2}
\] |
fma-udef [=>]51.8 | \[ \frac{\mathsf{fma}\left({\color{blue}{\left(b \cdot b + \left(a \cdot c\right) \cdot -4\right)}}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}{a \cdot 2}
\] |
+-commutative [=>]51.8 | \[ \frac{\mathsf{fma}\left({\color{blue}{\left(\left(a \cdot c\right) \cdot -4 + b \cdot b\right)}}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}{a \cdot 2}
\] |
associate-*l* [=>]51.8 | \[ \frac{\mathsf{fma}\left({\left(\color{blue}{a \cdot \left(c \cdot -4\right)} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}{a \cdot 2}
\] |
fma-def [=>]51.8 | \[ \frac{\mathsf{fma}\left({\color{blue}{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}{a \cdot 2}
\] |
metadata-eval [=>]51.8 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\color{blue}{0.25}}, \sqrt{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}, -b\right)}{a \cdot 2}
\] |
pow1/2 [=>]51.8 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.25}, \sqrt{\color{blue}{{\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.5}}}, -b\right)}{a \cdot 2}
\] |
sqrt-pow1 [=>]51.6 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.25}, \color{blue}{{\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{\left(\frac{0.5}{2}\right)}}, -b\right)}{a \cdot 2}
\] |
fma-udef [=>]51.3 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.25}, {\color{blue}{\left(b \cdot b + \left(a \cdot c\right) \cdot -4\right)}}^{\left(\frac{0.5}{2}\right)}, -b\right)}{a \cdot 2}
\] |
+-commutative [=>]51.3 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.25}, {\color{blue}{\left(\left(a \cdot c\right) \cdot -4 + b \cdot b\right)}}^{\left(\frac{0.5}{2}\right)}, -b\right)}{a \cdot 2}
\] |
associate-*l* [=>]51.3 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.25}, {\left(\color{blue}{a \cdot \left(c \cdot -4\right)} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}, -b\right)}{a \cdot 2}
\] |
fma-def [=>]51.3 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.25}, {\color{blue}{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}}^{\left(\frac{0.5}{2}\right)}, -b\right)}{a \cdot 2}
\] |
metadata-eval [=>]51.3 | \[ \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\color{blue}{0.25}}, -b\right)}{a \cdot 2}
\] |
Taylor expanded in c around 0 93.1%
Simplified93.1%
[Start]93.1 | \[ -1 \cdot \frac{c}{b} + \left(0.5 \cdot \left({c}^{4} \cdot \left(\frac{{\left(0.5 \cdot \frac{{a}^{2}}{{b}^{4}} + -2 \cdot \frac{{a}^{2}}{{b}^{4}}\right)}^{2} \cdot b}{a} + \left(-2 \cdot \frac{-0.16666666666666666 \cdot \frac{{a}^{3}}{{b}^{6}} + \left(2 \cdot \frac{{a}^{3}}{{b}^{6}} + -5.333333333333333 \cdot \frac{{a}^{3}}{{b}^{6}}\right)}{b} + 2 \cdot \frac{b \cdot \left(2 \cdot \frac{{a}^{4}}{{b}^{8}} + \left(-1 \cdot \frac{{a}^{4}}{{b}^{8}} + \left(5.333333333333333 \cdot \frac{{a}^{4}}{{b}^{8}} + \left(-16 \cdot \frac{{a}^{4}}{{b}^{8}} + 0.041666666666666664 \cdot \frac{{a}^{4}}{{b}^{8}}\right)\right)\right)\right)}{a}\right)\right)\right) + \left(0.5 \cdot \left({c}^{3} \cdot \left(-2 \cdot \frac{0.5 \cdot \frac{{a}^{2}}{{b}^{4}} + -2 \cdot \frac{{a}^{2}}{{b}^{4}}}{b} + 2 \cdot \frac{\left(-0.16666666666666666 \cdot \frac{{a}^{3}}{{b}^{6}} + \left(2 \cdot \frac{{a}^{3}}{{b}^{6}} + -5.333333333333333 \cdot \frac{{a}^{3}}{{b}^{6}}\right)\right) \cdot b}{a}\right)\right) + 0.5 \cdot \left({c}^{2} \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\left(0.5 \cdot \frac{{a}^{2}}{{b}^{4}} + -2 \cdot \frac{{a}^{2}}{{b}^{4}}\right) \cdot b}{a}\right)\right)\right)\right)
\] |
|---|
Taylor expanded in a around 0 93.1%
Taylor expanded in a around 0 93.1%
Simplified93.1%
[Start]93.1 | \[ 0.5 \cdot \left(\left({c}^{3} \cdot \left(-4 \cdot \frac{{a}^{2}}{{b}^{5}}\right) + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b}
\] |
|---|---|
*-commutative [=>]93.1 | \[ 0.5 \cdot \left(\left({c}^{3} \cdot \color{blue}{\left(\frac{{a}^{2}}{{b}^{5}} \cdot -4\right)} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b}
\] |
associate-/r/ [<=]93.1 | \[ 0.5 \cdot \left(\left({c}^{3} \cdot \color{blue}{\frac{{a}^{2}}{\frac{{b}^{5}}{-4}}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b}
\] |
unpow2 [=>]93.1 | \[ 0.5 \cdot \left(\left({c}^{3} \cdot \frac{\color{blue}{a \cdot a}}{\frac{{b}^{5}}{-4}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b}
\] |
Final simplification91.7%
| Alternative 1 | |
|---|---|
| Accuracy | 88.4% |
| Cost | 49412 |
| Alternative 2 | |
|---|---|
| Accuracy | 91.6% |
| Cost | 47108 |
| Alternative 3 | |
|---|---|
| Accuracy | 83.2% |
| Cost | 35917 |
| Alternative 4 | |
|---|---|
| Accuracy | 83.2% |
| Cost | 29645 |
| Alternative 5 | |
|---|---|
| Accuracy | 83.2% |
| Cost | 29645 |
| Alternative 6 | |
|---|---|
| Accuracy | 88.3% |
| Cost | 28164 |
| Alternative 7 | |
|---|---|
| Accuracy | 84.7% |
| Cost | 7492 |
| Alternative 8 | |
|---|---|
| Accuracy | 81.5% |
| Cost | 7232 |
| Alternative 9 | |
|---|---|
| Accuracy | 81.3% |
| Cost | 1600 |
| Alternative 10 | |
|---|---|
| Accuracy | 64.1% |
| Cost | 256 |
| Alternative 11 | |
|---|---|
| Accuracy | 3.2% |
| Cost | 64 |
herbie shell --seed 2023151
(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)))