| Alternative 1 | |
|---|---|
| Accuracy | 69.0% |
| Cost | 21136 |
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l))))))
(if (<= t_1 (- INFINITY))
(*
(sqrt (/ d h))
(/ (* (* t_0 -0.125) (* M (/ M (/ l h)))) (pow (/ d D) 2.0)))
(if (<= t_1 -2e-293)
t_1
(if (or (<= t_1 0.0) (not (<= t_1 2e+221)))
(fabs (/ d (sqrt (* h l))))
(*
(/ 1.0 (sqrt (/ h d)))
(*
t_0
(- 1.0 (* 0.5 (* (/ h l) (pow (* (/ M 2.0) (/ D d)) 2.0)))))))))))double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = sqrt((d / h)) * (((t_0 * -0.125) * (M * (M / (l / h)))) / pow((d / D), 2.0));
} else if (t_1 <= -2e-293) {
tmp = t_1;
} else if ((t_1 <= 0.0) || !(t_1 <= 2e+221)) {
tmp = fabs((d / sqrt((h * l))));
} else {
tmp = (1.0 / sqrt((h / d))) * (t_0 * (1.0 - (0.5 * ((h / l) * pow(((M / 2.0) * (D / d)), 2.0)))));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = (Math.pow((d / h), 0.5) * Math.pow((d / l), 0.5)) * (1.0 - ((0.5 * Math.pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / h)) * (((t_0 * -0.125) * (M * (M / (l / h)))) / Math.pow((d / D), 2.0));
} else if (t_1 <= -2e-293) {
tmp = t_1;
} else if ((t_1 <= 0.0) || !(t_1 <= 2e+221)) {
tmp = Math.abs((d / Math.sqrt((h * l))));
} else {
tmp = (1.0 / Math.sqrt((h / d))) * (t_0 * (1.0 - (0.5 * ((h / l) * Math.pow(((M / 2.0) * (D / d)), 2.0)))));
}
return tmp;
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (math.pow((d / h), 0.5) * math.pow((d / l), 0.5)) * (1.0 - ((0.5 * math.pow(((M * D) / (d * 2.0)), 2.0)) * (h / l))) tmp = 0 if t_1 <= -math.inf: tmp = math.sqrt((d / h)) * (((t_0 * -0.125) * (M * (M / (l / h)))) / math.pow((d / D), 2.0)) elif t_1 <= -2e-293: tmp = t_1 elif (t_1 <= 0.0) or not (t_1 <= 2e+221): tmp = math.fabs((d / math.sqrt((h * l)))) else: tmp = (1.0 / math.sqrt((h / d))) * (t_0 * (1.0 - (0.5 * ((h / l) * math.pow(((M / 2.0) * (D / d)), 2.0))))) return tmp
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 - Float64(Float64(0.5 * (Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(Float64(t_0 * -0.125) * Float64(M * Float64(M / Float64(l / h)))) / (Float64(d / D) ^ 2.0))); elseif (t_1 <= -2e-293) tmp = t_1; elseif ((t_1 <= 0.0) || !(t_1 <= 2e+221)) tmp = abs(Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(Float64(1.0 / sqrt(Float64(h / d))) * Float64(t_0 * Float64(1.0 - Float64(0.5 * Float64(Float64(h / l) * (Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0)))))); end return tmp end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (((d / h) ^ 0.5) * ((d / l) ^ 0.5)) * (1.0 - ((0.5 * (((M * D) / (d * 2.0)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_1 <= -Inf) tmp = sqrt((d / h)) * (((t_0 * -0.125) * (M * (M / (l / h)))) / ((d / D) ^ 2.0)); elseif (t_1 <= -2e-293) tmp = t_1; elseif ((t_1 <= 0.0) || ~((t_1 <= 2e+221))) tmp = abs((d / sqrt((h * l)))); else tmp = (1.0 / sqrt((h / d))) * (t_0 * (1.0 - (0.5 * ((h / l) * (((M / 2.0) * (D / d)) ^ 2.0))))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(t$95$0 * -0.125), $MachinePrecision] * N[(M * N[(M / N[(l / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-293], t$95$1, If[Or[LessEqual[t$95$1, 0.0], N[Not[LessEqual[t$95$1, 2e+221]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(1.0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 - N[(0.5 * N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{\left(t_0 \cdot -0.125\right) \cdot \left(M \cdot \frac{M}{\frac{\ell}{h}}\right)}{{\left(\frac{d}{D}\right)}^{2}}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-293}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0 \lor \neg \left(t_1 \leq 2 \cdot 10^{+221}\right):\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\frac{h}{d}}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)\right)\right)\\
\end{array}
Results
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -inf.0Initial program 0.0%
Simplified4.5%
[Start]0.0 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
|---|---|
associate-*l* [=>]0.0 | \[ \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}
\] |
metadata-eval [=>]0.0 | \[ {\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
unpow1/2 [=>]0.0 | \[ \color{blue}{\sqrt{\frac{d}{h}}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
metadata-eval [=>]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
unpow1/2 [=>]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
sub-neg [=>]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(1 + \left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)
\] |
+-commutative [=>]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(\left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) + 1\right)}\right)
\] |
*-commutative [=>]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(-\color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{h}{\ell}\right) + 1\right)\right)
\] |
associate-*l* [=>]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(-\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\frac{1}{2} \cdot \frac{h}{\ell}\right)}\right) + 1\right)\right)
\] |
distribute-rgt-neg-in [=>]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(-\frac{1}{2} \cdot \frac{h}{\ell}\right)} + 1\right)\right)
\] |
*-commutative [<=]0.0 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(-\color{blue}{\frac{h}{\ell} \cdot \frac{1}{2}}\right) + 1\right)\right)
\] |
Taylor expanded in M around inf 5.7%
Simplified3.9%
[Start]5.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)\right)
\] |
|---|---|
times-frac [=>]3.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)}\right)\right)
\] |
unpow2 [=>]3.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right)\right)
\] |
unpow2 [=>]3.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)\right)\right)
\] |
unpow2 [=>]3.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{\color{blue}{\left(M \cdot M\right)} \cdot h}{\ell}\right)\right)\right)
\] |
Applied egg-rr13.8%
[Start]3.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}\right)\right)\right)
\] |
|---|---|
clear-num [=>]3.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\color{blue}{\frac{1}{\frac{d \cdot d}{D \cdot D}}} \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}\right)\right)\right)
\] |
frac-2neg [=>]3.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{1}{\frac{d \cdot d}{D \cdot D}} \cdot \color{blue}{\frac{-\left(M \cdot M\right) \cdot h}{-\ell}}\right)\right)\right)
\] |
frac-times [=>]5.2 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\frac{1 \cdot \left(-\left(M \cdot M\right) \cdot h\right)}{\frac{d \cdot d}{D \cdot D} \cdot \left(-\ell\right)}}\right)\right)
\] |
*-un-lft-identity [<=]5.2 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{-\left(M \cdot M\right) \cdot h}}{\frac{d \cdot d}{D \cdot D} \cdot \left(-\ell\right)}\right)\right)
\] |
associate-*l* [=>]6.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{-\color{blue}{M \cdot \left(M \cdot h\right)}}{\frac{d \cdot d}{D \cdot D} \cdot \left(-\ell\right)}\right)\right)
\] |
distribute-rgt-neg-in [=>]6.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{\color{blue}{M \cdot \left(-M \cdot h\right)}}{\frac{d \cdot d}{D \cdot D} \cdot \left(-\ell\right)}\right)\right)
\] |
times-frac [=>]13.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{M \cdot \left(-M \cdot h\right)}{\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \left(-\ell\right)}\right)\right)
\] |
Simplified14.6%
[Start]13.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{M \cdot \left(-M \cdot h\right)}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(-\ell\right)}\right)\right)
\] |
|---|---|
times-frac [=>]14.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \color{blue}{\left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \frac{-M \cdot h}{-\ell}\right)}\right)\right)
\] |
distribute-rgt-neg-in [=>]14.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \frac{\color{blue}{M \cdot \left(-h\right)}}{-\ell}\right)\right)\right)
\] |
Applied egg-rr20.2%
[Start]14.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \frac{M \cdot \left(-h\right)}{-\ell}\right)\right)\right)
\] |
|---|---|
associate-*r* [=>]14.6 | \[ \sqrt{\frac{d}{h}} \cdot \color{blue}{\left(\left(\sqrt{\frac{d}{\ell}} \cdot -0.125\right) \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \frac{M \cdot \left(-h\right)}{-\ell}\right)\right)}
\] |
associate-*l/ [=>]16.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\left(\sqrt{\frac{d}{\ell}} \cdot -0.125\right) \cdot \color{blue}{\frac{M \cdot \frac{M \cdot \left(-h\right)}{-\ell}}{\frac{d}{D} \cdot \frac{d}{D}}}\right)
\] |
associate-*r/ [=>]21.0 | \[ \sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\left(\sqrt{\frac{d}{\ell}} \cdot -0.125\right) \cdot \left(M \cdot \frac{M \cdot \left(-h\right)}{-\ell}\right)}{\frac{d}{D} \cdot \frac{d}{D}}}
\] |
if -inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < -2.0000000000000001e-293Initial program 98.1%
if -2.0000000000000001e-293 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 0.0 or 2.0000000000000001e221 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 14.6%
Taylor expanded in d around inf 35.8%
Simplified35.9%
[Start]35.8 | \[ \sqrt{\frac{1}{\ell \cdot h}} \cdot d
\] |
|---|---|
*-commutative [=>]35.8 | \[ \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}}
\] |
associate-/r* [=>]35.9 | \[ d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}}
\] |
Applied egg-rr19.2%
[Start]35.9 | \[ d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}
\] |
|---|---|
add-sqr-sqrt [=>]34.6 | \[ \color{blue}{\sqrt{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \cdot \sqrt{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}}}
\] |
sqrt-unprod [=>]21.8 | \[ \color{blue}{\sqrt{\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right)}}
\] |
pow1/2 [=>]21.8 | \[ \color{blue}{{\left(\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right)}^{0.5}}
\] |
*-commutative [=>]21.8 | \[ {\left(\color{blue}{\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\right)} \cdot \left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right)\right)}^{0.5}
\] |
*-commutative [=>]21.8 | \[ {\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\right) \cdot \color{blue}{\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot d\right)}\right)}^{0.5}
\] |
swap-sqr [=>]19.1 | \[ {\color{blue}{\left(\left(\sqrt{\frac{\frac{1}{\ell}}{h}} \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(d \cdot d\right)\right)}}^{0.5}
\] |
add-sqr-sqrt [<=]19.2 | \[ {\left(\color{blue}{\frac{\frac{1}{\ell}}{h}} \cdot \left(d \cdot d\right)\right)}^{0.5}
\] |
Simplified21.9%
[Start]19.2 | \[ {\left(\frac{\frac{1}{\ell}}{h} \cdot \left(d \cdot d\right)\right)}^{0.5}
\] |
|---|---|
unpow1/2 [=>]19.2 | \[ \color{blue}{\sqrt{\frac{\frac{1}{\ell}}{h} \cdot \left(d \cdot d\right)}}
\] |
associate-/r* [<=]19.2 | \[ \sqrt{\color{blue}{\frac{1}{\ell \cdot h}} \cdot \left(d \cdot d\right)}
\] |
associate-*l/ [=>]19.2 | \[ \sqrt{\color{blue}{\frac{1 \cdot \left(d \cdot d\right)}{\ell \cdot h}}}
\] |
*-lft-identity [=>]19.2 | \[ \sqrt{\frac{\color{blue}{d \cdot d}}{\ell \cdot h}}
\] |
associate-*r/ [<=]21.9 | \[ \sqrt{\color{blue}{d \cdot \frac{d}{\ell \cdot h}}}
\] |
Applied egg-rr62.7%
[Start]21.9 | \[ \sqrt{d \cdot \frac{d}{\ell \cdot h}}
\] |
|---|---|
add-sqr-sqrt [=>]21.9 | \[ \sqrt{\color{blue}{\sqrt{d \cdot \frac{d}{\ell \cdot h}} \cdot \sqrt{d \cdot \frac{d}{\ell \cdot h}}}}
\] |
rem-sqrt-square [=>]21.9 | \[ \color{blue}{\left|\sqrt{d \cdot \frac{d}{\ell \cdot h}}\right|}
\] |
associate-*r/ [=>]19.2 | \[ \left|\sqrt{\color{blue}{\frac{d \cdot d}{\ell \cdot h}}}\right|
\] |
sqrt-div [=>]28.2 | \[ \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{\ell \cdot h}}}\right|
\] |
sqrt-unprod [<=]30.5 | \[ \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{\ell \cdot h}}\right|
\] |
add-sqr-sqrt [<=]62.7 | \[ \left|\frac{\color{blue}{d}}{\sqrt{\ell \cdot h}}\right|
\] |
if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 2.0000000000000001e221Initial program 98.8%
Simplified98.5%
[Start]98.8 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
|---|---|
associate-*l* [=>]98.8 | \[ \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}
\] |
metadata-eval [=>]98.8 | \[ {\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
unpow1/2 [=>]98.8 | \[ \color{blue}{\sqrt{\frac{d}{h}}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
metadata-eval [=>]98.8 | \[ \sqrt{\frac{d}{h}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
unpow1/2 [=>]98.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)
\] |
associate-*l* [=>]98.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - \color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)\right)
\] |
metadata-eval [=>]98.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - \color{blue}{0.5} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
times-frac [=>]98.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
Applied egg-rr98.2%
[Start]98.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
|---|---|
clear-num [=>]98.2 | \[ \sqrt{\color{blue}{\frac{1}{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
sqrt-div [=>]98.2 | \[ \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
metadata-eval [=>]98.2 | \[ \frac{\color{blue}{1}}{\sqrt{\frac{h}{d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
Final simplification78.9%
| Alternative 1 | |
|---|---|
| Accuracy | 69.0% |
| Cost | 21136 |
| Alternative 2 | |
|---|---|
| Accuracy | 69.4% |
| Cost | 21136 |
| Alternative 3 | |
|---|---|
| Accuracy | 70.4% |
| Cost | 21136 |
| Alternative 4 | |
|---|---|
| Accuracy | 71.6% |
| Cost | 21004 |
| Alternative 5 | |
|---|---|
| Accuracy | 64.4% |
| Cost | 14732 |
| Alternative 6 | |
|---|---|
| Accuracy | 65.6% |
| Cost | 14668 |
| Alternative 7 | |
|---|---|
| Accuracy | 68.9% |
| Cost | 14668 |
| Alternative 8 | |
|---|---|
| Accuracy | 64.0% |
| Cost | 13580 |
| Alternative 9 | |
|---|---|
| Accuracy | 57.6% |
| Cost | 13384 |
| Alternative 10 | |
|---|---|
| Accuracy | 64.1% |
| Cost | 13380 |
| Alternative 11 | |
|---|---|
| Accuracy | 57.5% |
| Cost | 8456 |
| Alternative 12 | |
|---|---|
| Accuracy | 57.4% |
| Cost | 7372 |
| Alternative 13 | |
|---|---|
| Accuracy | 57.6% |
| Cost | 7308 |
| Alternative 14 | |
|---|---|
| Accuracy | 57.4% |
| Cost | 7308 |
| Alternative 15 | |
|---|---|
| Accuracy | 57.5% |
| Cost | 7308 |
| Alternative 16 | |
|---|---|
| Accuracy | 47.9% |
| Cost | 7244 |
| Alternative 17 | |
|---|---|
| Accuracy | 47.8% |
| Cost | 7244 |
| Alternative 18 | |
|---|---|
| Accuracy | 47.9% |
| Cost | 7244 |
| Alternative 19 | |
|---|---|
| Accuracy | 46.0% |
| Cost | 6980 |
| Alternative 20 | |
|---|---|
| Accuracy | 31.4% |
| Cost | 6784 |
| Alternative 21 | |
|---|---|
| Accuracy | 31.4% |
| Cost | 6720 |
herbie shell --seed 2023146
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))