| Alternative 1 | |
|---|---|
| Accuracy | 83.4% |
| Cost | 7624 |
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b -2.3e+103)
(* (/ b a) -0.6666666666666666)
(if (<= b -4.2e-162)
(/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
(if (<= b -1.32e-235)
(/ 1.0 (/ a (/ (- b (hypot (* (sqrt (* a -3.0)) (sqrt c)) b)) -3.0)))
(if (<= b 410000000.0)
(/
(/
-0.3333333333333333
(/ (+ b (hypot b (sqrt (* -3.0 (* a c))))) (* 3.0 (* a c))))
a)
(* -0.5 (/ c b)))))))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 tmp;
if (b <= -2.3e+103) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= -4.2e-162) {
tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} else if (b <= -1.32e-235) {
tmp = 1.0 / (a / ((b - hypot((sqrt((a * -3.0)) * sqrt(c)), b)) / -3.0));
} else if (b <= 410000000.0) {
tmp = (-0.3333333333333333 / ((b + hypot(b, sqrt((-3.0 * (a * c))))) / (3.0 * (a * c)))) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.3e+103) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= -4.2e-162) {
tmp = (Math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} else if (b <= -1.32e-235) {
tmp = 1.0 / (a / ((b - Math.hypot((Math.sqrt((a * -3.0)) * Math.sqrt(c)), b)) / -3.0));
} else if (b <= 410000000.0) {
tmp = (-0.3333333333333333 / ((b + Math.hypot(b, Math.sqrt((-3.0 * (a * c))))) / (3.0 * (a * c)))) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
def code(a, b, c): tmp = 0 if b <= -2.3e+103: tmp = (b / a) * -0.6666666666666666 elif b <= -4.2e-162: tmp = (math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0) elif b <= -1.32e-235: tmp = 1.0 / (a / ((b - math.hypot((math.sqrt((a * -3.0)) * math.sqrt(c)), b)) / -3.0)) elif b <= 410000000.0: tmp = (-0.3333333333333333 / ((b + math.hypot(b, math.sqrt((-3.0 * (a * c))))) / (3.0 * (a * c)))) / a else: tmp = -0.5 * (c / b) 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) tmp = 0.0 if (b <= -2.3e+103) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= -4.2e-162) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * c))) - b) / Float64(a * 3.0)); elseif (b <= -1.32e-235) tmp = Float64(1.0 / Float64(a / Float64(Float64(b - hypot(Float64(sqrt(Float64(a * -3.0)) * sqrt(c)), b)) / -3.0))); elseif (b <= 410000000.0) tmp = Float64(Float64(-0.3333333333333333 / Float64(Float64(b + hypot(b, sqrt(Float64(-3.0 * Float64(a * c))))) / Float64(3.0 * Float64(a * c)))) / a); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.3e+103) tmp = (b / a) * -0.6666666666666666; elseif (b <= -4.2e-162) tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0); elseif (b <= -1.32e-235) tmp = 1.0 / (a / ((b - hypot((sqrt((a * -3.0)) * sqrt(c)), b)) / -3.0)); elseif (b <= 410000000.0) tmp = (-0.3333333333333333 / ((b + hypot(b, sqrt((-3.0 * (a * c))))) / (3.0 * (a * c)))) / a; else tmp = -0.5 * (c / b); end tmp_2 = 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_] := If[LessEqual[b, -2.3e+103], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, -4.2e-162], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 3.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.32e-235], N[(1.0 / N[(a / N[(N[(b - N[Sqrt[N[(N[Sqrt[N[(a * -3.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[c], $MachinePrecision]), $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 410000000.0], N[(N[(-0.3333333333333333 / N[(N[(b + N[Sqrt[b ^ 2 + N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+103}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq -4.2 \cdot 10^{-162}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq -1.32 \cdot 10^{-235}:\\
\;\;\;\;\frac{1}{\frac{a}{\frac{b - \mathsf{hypot}\left(\sqrt{a \cdot -3} \cdot \sqrt{c}, b\right)}{-3}}}\\
\mathbf{elif}\;b \leq 410000000:\\
\;\;\;\;\frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{-3 \cdot \left(a \cdot c\right)}\right)}{3 \cdot \left(a \cdot c\right)}}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
Results
if b < -2.30000000000000008e103Initial program 28.6%
Taylor expanded in b around -inf 93.0%
Simplified93.0%
[Start]93.0 | \[ -0.6666666666666666 \cdot \frac{b}{a}
\] |
|---|---|
*-commutative [=>]93.0 | \[ \color{blue}{\frac{b}{a} \cdot -0.6666666666666666}
\] |
if -2.30000000000000008e103 < b < -4.2e-162Initial program 90.2%
if -4.2e-162 < b < -1.32e-235Initial program 72.1%
Simplified71.9%
[Start]72.1 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\] |
|---|---|
/-rgt-identity [<=]72.1 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\color{blue}{\frac{3 \cdot a}{1}}}
\] |
metadata-eval [<=]72.1 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\frac{3 \cdot a}{\color{blue}{--1}}}
\] |
associate-/l* [<=]72.1 | \[ \color{blue}{\frac{\left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(--1\right)}{3 \cdot a}}
\] |
associate-*r/ [<=]71.9 | \[ \color{blue}{\left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \frac{--1}{3 \cdot a}}
\] |
*-commutative [=>]71.9 | \[ \color{blue}{\frac{--1}{3 \cdot a} \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}
\] |
associate-*l/ [=>]72.1 | \[ \color{blue}{\frac{\left(--1\right) \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{3 \cdot a}}
\] |
associate-*r/ [<=]72.1 | \[ \color{blue}{\left(--1\right) \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}}
\] |
metadata-eval [=>]72.1 | \[ \color{blue}{1} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\] |
metadata-eval [<=]72.1 | \[ \color{blue}{\frac{-1}{-1}} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\] |
times-frac [<=]72.1 | \[ \color{blue}{\frac{-1 \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{-1 \cdot \left(3 \cdot a\right)}}
\] |
neg-mul-1 [<=]72.1 | \[ \frac{-1 \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{\color{blue}{-3 \cdot a}}
\] |
distribute-rgt-neg-in [=>]72.1 | \[ \frac{-1 \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{\color{blue}{3 \cdot \left(-a\right)}}
\] |
times-frac [=>]71.8 | \[ \color{blue}{\frac{-1}{3} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-a}}
\] |
metadata-eval [=>]71.8 | \[ \color{blue}{-0.3333333333333333} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-a}
\] |
neg-mul-1 [=>]71.8 | \[ -0.3333333333333333 \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\color{blue}{-1 \cdot a}}
\] |
Applied egg-rr81.6%
[Start]71.9 | \[ -0.3333333333333333 \cdot \frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}
\] |
|---|---|
associate-*r/ [=>]71.9 | \[ \color{blue}{\frac{-0.3333333333333333 \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right)}{a}}
\] |
clear-num [=>]71.8 | \[ \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right)}}}
\] |
fma-udef [=>]71.8 | \[ \frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \sqrt{\color{blue}{b \cdot b + a \cdot \left(c \cdot -3\right)}}\right)}}
\] |
add-sqr-sqrt [=>]71.8 | \[ \frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \sqrt{b \cdot b + \color{blue}{\sqrt{a \cdot \left(c \cdot -3\right)} \cdot \sqrt{a \cdot \left(c \cdot -3\right)}}}\right)}}
\] |
hypot-def [=>]81.6 | \[ \frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}\right)}}
\] |
Applied egg-rr81.6%
[Start]81.6 | \[ \frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right)}}
\] |
|---|---|
add-log-exp [=>]4.8 | \[ \frac{1}{\color{blue}{\log \left(e^{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right)}}\right)}}
\] |
*-un-lft-identity [=>]4.8 | \[ \frac{1}{\log \color{blue}{\left(1 \cdot e^{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right)}}\right)}}
\] |
log-prod [=>]4.8 | \[ \frac{1}{\color{blue}{\log 1 + \log \left(e^{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right)}}\right)}}
\] |
metadata-eval [=>]4.8 | \[ \frac{1}{\color{blue}{0} + \log \left(e^{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right)}}\right)}
\] |
add-log-exp [<=]81.6 | \[ \frac{1}{0 + \color{blue}{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right)}}}
\] |
associate-/r* [=>]81.6 | \[ \frac{1}{0 + \color{blue}{\frac{\frac{a}{-0.3333333333333333}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}}
\] |
div-inv [=>]81.6 | \[ \frac{1}{0 + \frac{\color{blue}{a \cdot \frac{1}{-0.3333333333333333}}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}
\] |
metadata-eval [=>]81.6 | \[ \frac{1}{0 + \frac{a \cdot \color{blue}{-3}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}
\] |
hypot-udef [=>]71.9 | \[ \frac{1}{0 + \frac{a \cdot -3}{b - \color{blue}{\sqrt{b \cdot b + \sqrt{a \cdot \left(c \cdot -3\right)} \cdot \sqrt{a \cdot \left(c \cdot -3\right)}}}}}
\] |
add-sqr-sqrt [<=]71.9 | \[ \frac{1}{0 + \frac{a \cdot -3}{b - \sqrt{b \cdot b + \color{blue}{a \cdot \left(c \cdot -3\right)}}}}
\] |
+-commutative [=>]71.9 | \[ \frac{1}{0 + \frac{a \cdot -3}{b - \sqrt{\color{blue}{a \cdot \left(c \cdot -3\right) + b \cdot b}}}}
\] |
add-sqr-sqrt [=>]71.9 | \[ \frac{1}{0 + \frac{a \cdot -3}{b - \sqrt{\color{blue}{\sqrt{a \cdot \left(c \cdot -3\right)} \cdot \sqrt{a \cdot \left(c \cdot -3\right)}} + b \cdot b}}}
\] |
hypot-def [=>]81.6 | \[ \frac{1}{0 + \frac{a \cdot -3}{b - \color{blue}{\mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -3\right)}, b\right)}}}
\] |
Simplified81.7%
[Start]81.6 | \[ \frac{1}{0 + \frac{a \cdot -3}{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -3\right)}, b\right)}}
\] |
|---|---|
+-lft-identity [=>]81.6 | \[ \frac{1}{\color{blue}{\frac{a \cdot -3}{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -3\right)}, b\right)}}}
\] |
associate-/l* [=>]81.7 | \[ \frac{1}{\color{blue}{\frac{a}{\frac{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -3\right)}, b\right)}{-3}}}}
\] |
associate-*r* [=>]81.6 | \[ \frac{1}{\frac{a}{\frac{b - \mathsf{hypot}\left(\sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}, b\right)}{-3}}}
\] |
*-commutative [=>]81.6 | \[ \frac{1}{\frac{a}{\frac{b - \mathsf{hypot}\left(\sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}, b\right)}{-3}}}
\] |
associate-*r* [<=]81.7 | \[ \frac{1}{\frac{a}{\frac{b - \mathsf{hypot}\left(\sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}, b\right)}{-3}}}
\] |
Applied egg-rr47.8%
[Start]81.7 | \[ \frac{1}{\frac{a}{\frac{b - \mathsf{hypot}\left(\sqrt{c \cdot \left(a \cdot -3\right)}, b\right)}{-3}}}
\] |
|---|---|
*-commutative [=>]81.7 | \[ \frac{1}{\frac{a}{\frac{b - \mathsf{hypot}\left(\sqrt{\color{blue}{\left(a \cdot -3\right) \cdot c}}, b\right)}{-3}}}
\] |
sqrt-prod [=>]47.8 | \[ \frac{1}{\frac{a}{\frac{b - \mathsf{hypot}\left(\color{blue}{\sqrt{a \cdot -3} \cdot \sqrt{c}}, b\right)}{-3}}}
\] |
if -1.32e-235 < b < 4.1e8Initial program 62.0%
Simplified61.8%
[Start]62.0 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\] |
|---|---|
/-rgt-identity [<=]62.0 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\color{blue}{\frac{3 \cdot a}{1}}}
\] |
metadata-eval [<=]62.0 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\frac{3 \cdot a}{\color{blue}{--1}}}
\] |
associate-/r/ [=>]62.0 | \[ \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \cdot \left(--1\right)}
\] |
metadata-eval [=>]62.0 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \cdot \color{blue}{1}
\] |
metadata-eval [<=]62.0 | \[ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \cdot \color{blue}{\frac{-1}{-1}}
\] |
times-frac [<=]62.0 | \[ \color{blue}{\frac{\left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot -1}{\left(3 \cdot a\right) \cdot -1}}
\] |
*-commutative [<=]62.0 | \[ \frac{\left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot -1}{\color{blue}{-1 \cdot \left(3 \cdot a\right)}}
\] |
times-frac [=>]61.9 | \[ \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-1} \cdot \frac{-1}{3 \cdot a}}
\] |
*-commutative [<=]61.9 | \[ \color{blue}{\frac{-1}{3 \cdot a} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-1}}
\] |
associate-/r* [=>]61.8 | \[ \color{blue}{\frac{\frac{-1}{3}}{a}} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-1}
\] |
associate-*l/ [=>]61.8 | \[ \color{blue}{\frac{\frac{-1}{3} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-1}}{a}}
\] |
Applied egg-rr60.9%
[Start]61.8 | \[ \frac{-0.3333333333333333 \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right)}{a}
\] |
|---|---|
flip-- [=>]61.7 | \[ \frac{-0.3333333333333333 \cdot \color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)} \cdot \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}}}}{a}
\] |
associate-*r/ [=>]61.6 | \[ \frac{\color{blue}{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)} \cdot \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right)}{b + \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}}}}{a}
\] |
add-sqr-sqrt [<=]61.7 | \[ \frac{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \color{blue}{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right)}{b + \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}}}{a}
\] |
associate-*l* [=>]61.6 | \[ \frac{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \mathsf{fma}\left(b, b, \color{blue}{a \cdot \left(c \cdot -3\right)}\right)\right)}{b + \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}}}{a}
\] |
fma-udef [=>]61.6 | \[ \frac{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)\right)}{b + \sqrt{\color{blue}{b \cdot b + \left(a \cdot c\right) \cdot -3}}}}{a}
\] |
add-sqr-sqrt [=>]60.8 | \[ \frac{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)\right)}{b + \sqrt{b \cdot b + \color{blue}{\sqrt{\left(a \cdot c\right) \cdot -3} \cdot \sqrt{\left(a \cdot c\right) \cdot -3}}}}}{a}
\] |
hypot-def [=>]60.8 | \[ \frac{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)\right)}{b + \color{blue}{\mathsf{hypot}\left(b, \sqrt{\left(a \cdot c\right) \cdot -3}\right)}}}{a}
\] |
associate-*l* [=>]60.9 | \[ \frac{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)\right)}{b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{a \cdot \left(c \cdot -3\right)}}\right)}}{a}
\] |
Simplified66.8%
[Start]60.9 | \[ \frac{\frac{-0.3333333333333333 \cdot \left(b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)\right)}{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}
\] |
|---|---|
associate-/l* [=>]60.8 | \[ \frac{\color{blue}{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}}}{a}
\] |
associate-*r* [=>]60.8 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}}{a}
\] |
*-commutative [=>]60.8 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{b \cdot b - \mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}}{a}
\] |
fma-udef [=>]60.8 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{b \cdot b - \color{blue}{\left(b \cdot b + a \cdot \left(c \cdot -3\right)\right)}}}}{a}
\] |
associate--r+ [=>]66.7 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{\color{blue}{\left(b \cdot b - b \cdot b\right) - a \cdot \left(c \cdot -3\right)}}}}{a}
\] |
+-inverses [=>]66.7 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{\color{blue}{0} - a \cdot \left(c \cdot -3\right)}}}{a}
\] |
neg-sub0 [<=]66.7 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{\color{blue}{-a \cdot \left(c \cdot -3\right)}}}}{a}
\] |
associate-*r* [=>]66.8 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{-\color{blue}{\left(a \cdot c\right) \cdot -3}}}}{a}
\] |
*-commutative [=>]66.8 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{-\color{blue}{\left(c \cdot a\right)} \cdot -3}}}{a}
\] |
distribute-rgt-neg-in [=>]66.8 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{\color{blue}{\left(c \cdot a\right) \cdot \left(--3\right)}}}}{a}
\] |
metadata-eval [=>]66.8 | \[ \frac{\frac{-0.3333333333333333}{\frac{b + \mathsf{hypot}\left(b, \sqrt{\left(c \cdot a\right) \cdot -3}\right)}{\left(c \cdot a\right) \cdot \color{blue}{3}}}}{a}
\] |
if 4.1e8 < b Initial program 12.0%
Taylor expanded in b around inf 91.5%
Final simplification82.8%
| Alternative 1 | |
|---|---|
| Accuracy | 83.4% |
| Cost | 7624 |
| Alternative 2 | |
|---|---|
| Accuracy | 83.7% |
| Cost | 7624 |
| Alternative 3 | |
|---|---|
| Accuracy | 83.7% |
| Cost | 7624 |
| Alternative 4 | |
|---|---|
| Accuracy | 78.0% |
| Cost | 7368 |
| Alternative 5 | |
|---|---|
| Accuracy | 77.9% |
| Cost | 7368 |
| Alternative 6 | |
|---|---|
| Accuracy | 77.9% |
| Cost | 7368 |
| Alternative 7 | |
|---|---|
| Accuracy | 78.0% |
| Cost | 7368 |
| Alternative 8 | |
|---|---|
| Accuracy | 63.7% |
| Cost | 644 |
| Alternative 9 | |
|---|---|
| Accuracy | 63.7% |
| Cost | 580 |
| Alternative 10 | |
|---|---|
| Accuracy | 63.7% |
| Cost | 452 |
| Alternative 11 | |
|---|---|
| Accuracy | 63.7% |
| Cost | 452 |
| Alternative 12 | |
|---|---|
| Accuracy | 37.7% |
| Cost | 320 |
| Alternative 13 | |
|---|---|
| Accuracy | 11.9% |
| Cost | 64 |
herbie shell --seed 2023151
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))