| Alternative 1 | |
|---|---|
| Error | 19.3 |
| Cost | 104464 |
(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 (- 1.0 (* (* 0.5 (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
(t_1 (pow (/ d h) 0.5))
(t_2 (pow (/ d l) 0.5))
(t_3 (* (* t_1 t_2) t_0)))
(if (<= t_3 (- INFINITY))
(* (/ (pow (* D M) 2.0) d) (* (sqrt (/ h (pow l 3.0))) -0.125))
(if (<= t_3 -2e-128)
(* (* (* (pow 2.0 0.5) (pow (* d (/ 0.5 h)) 0.5)) t_2) t_0)
(if (<= t_3 1e-306)
(*
(* d (- (sqrt (/ (/ 1.0 h) l))))
(- 1.0 (* (/ h l) (* (pow (/ (* D M) d) 2.0) 0.125))))
(if (<= t_3 5e+273)
(*
(* t_2 t_1)
(- 1.0 (* (/ h l) (* (pow (* D (/ M d)) 2.0) 0.125))))
(* d (sqrt (/ (/ 1.0 l) h)))))))))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 = 1.0 - ((0.5 * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l));
double t_1 = pow((d / h), 0.5);
double t_2 = pow((d / l), 0.5);
double t_3 = (t_1 * t_2) * t_0;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (pow((D * M), 2.0) / d) * (sqrt((h / pow(l, 3.0))) * -0.125);
} else if (t_3 <= -2e-128) {
tmp = ((pow(2.0, 0.5) * pow((d * (0.5 / h)), 0.5)) * t_2) * t_0;
} else if (t_3 <= 1e-306) {
tmp = (d * -sqrt(((1.0 / h) / l))) * (1.0 - ((h / l) * (pow(((D * M) / d), 2.0) * 0.125)));
} else if (t_3 <= 5e+273) {
tmp = (t_2 * t_1) * (1.0 - ((h / l) * (pow((D * (M / d)), 2.0) * 0.125)));
} else {
tmp = d * sqrt(((1.0 / l) / h));
}
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 = 1.0 - ((0.5 * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l));
double t_1 = Math.pow((d / h), 0.5);
double t_2 = Math.pow((d / l), 0.5);
double t_3 = (t_1 * t_2) * t_0;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = (Math.pow((D * M), 2.0) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * -0.125);
} else if (t_3 <= -2e-128) {
tmp = ((Math.pow(2.0, 0.5) * Math.pow((d * (0.5 / h)), 0.5)) * t_2) * t_0;
} else if (t_3 <= 1e-306) {
tmp = (d * -Math.sqrt(((1.0 / h) / l))) * (1.0 - ((h / l) * (Math.pow(((D * M) / d), 2.0) * 0.125)));
} else if (t_3 <= 5e+273) {
tmp = (t_2 * t_1) * (1.0 - ((h / l) * (Math.pow((D * (M / d)), 2.0) * 0.125)));
} else {
tmp = d * Math.sqrt(((1.0 / l) / h));
}
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 = 1.0 - ((0.5 * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)) t_1 = math.pow((d / h), 0.5) t_2 = math.pow((d / l), 0.5) t_3 = (t_1 * t_2) * t_0 tmp = 0 if t_3 <= -math.inf: tmp = (math.pow((D * M), 2.0) / d) * (math.sqrt((h / math.pow(l, 3.0))) * -0.125) elif t_3 <= -2e-128: tmp = ((math.pow(2.0, 0.5) * math.pow((d * (0.5 / h)), 0.5)) * t_2) * t_0 elif t_3 <= 1e-306: tmp = (d * -math.sqrt(((1.0 / h) / l))) * (1.0 - ((h / l) * (math.pow(((D * M) / d), 2.0) * 0.125))) elif t_3 <= 5e+273: tmp = (t_2 * t_1) * (1.0 - ((h / l) * (math.pow((D * (M / d)), 2.0) * 0.125))) else: tmp = d * math.sqrt(((1.0 / l) / h)) 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 = Float64(1.0 - Float64(Float64(0.5 * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))) t_1 = Float64(d / h) ^ 0.5 t_2 = Float64(d / l) ^ 0.5 t_3 = Float64(Float64(t_1 * t_2) * t_0) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64((Float64(D * M) ^ 2.0) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * -0.125)); elseif (t_3 <= -2e-128) tmp = Float64(Float64(Float64((2.0 ^ 0.5) * (Float64(d * Float64(0.5 / h)) ^ 0.5)) * t_2) * t_0); elseif (t_3 <= 1e-306) tmp = Float64(Float64(d * Float64(-sqrt(Float64(Float64(1.0 / h) / l)))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / d) ^ 2.0) * 0.125)))); elseif (t_3 <= 5e+273) tmp = Float64(Float64(t_2 * t_1) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(D * Float64(M / d)) ^ 2.0) * 0.125)))); else tmp = Float64(d * sqrt(Float64(Float64(1.0 / l) / h))); 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 = 1.0 - ((0.5 * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)); t_1 = (d / h) ^ 0.5; t_2 = (d / l) ^ 0.5; t_3 = (t_1 * t_2) * t_0; tmp = 0.0; if (t_3 <= -Inf) tmp = (((D * M) ^ 2.0) / d) * (sqrt((h / (l ^ 3.0))) * -0.125); elseif (t_3 <= -2e-128) tmp = (((2.0 ^ 0.5) * ((d * (0.5 / h)) ^ 0.5)) * t_2) * t_0; elseif (t_3 <= 1e-306) tmp = (d * -sqrt(((1.0 / h) / l))) * (1.0 - ((h / l) * ((((D * M) / d) ^ 2.0) * 0.125))); elseif (t_3 <= 5e+273) tmp = (t_2 * t_1) * (1.0 - ((h / l) * (((D * (M / d)) ^ 2.0) * 0.125))); else tmp = d * sqrt(((1.0 / l) / h)); 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[(1.0 - N[(N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * t$95$2), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -2e-128], N[(N[(N[(N[Power[2.0, 0.5], $MachinePrecision] * N[Power[N[(d * N[(0.5 / h), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$3, 1e-306], N[(N[(d * (-N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+273], N[(N[(t$95$2 * t$95$1), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / h), $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 := 1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\\
t_1 := {\left(\frac{d}{h}\right)}^{0.5}\\
t_2 := {\left(\frac{d}{\ell}\right)}^{0.5}\\
t_3 := \left(t_1 \cdot t_2\right) \cdot t_0\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)\\
\mathbf{elif}\;t_3 \leq -2 \cdot 10^{-128}:\\
\;\;\;\;\left(\left({2}^{0.5} \cdot {\left(d \cdot \frac{0.5}{h}\right)}^{0.5}\right) \cdot t_2\right) \cdot t_0\\
\mathbf{elif}\;t_3 \leq 10^{-306}:\\
\;\;\;\;\left(d \cdot \left(-\sqrt{\frac{\frac{1}{h}}{\ell}}\right)\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot 0.125\right)\right)\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{+273}:\\
\;\;\;\;\left(t_2 \cdot t_1\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot 0.125\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\
\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 64.0
Taylor expanded in d around 0 59.8
Simplified57.1
[Start]59.8 | \[ -0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)
\] |
|---|---|
rational.json-simplify-43 [=>]59.8 | \[ \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)}
\] |
exponential.json-simplify-27 [=>]57.1 | \[ \frac{\color{blue}{{\left(D \cdot M\right)}^{2}}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
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.00000000000000011e-128Initial program 1.6
Applied egg-rr1.7
if -2.00000000000000011e-128 < (*.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)))) < 1.00000000000000003e-306Initial program 37.8
Simplified42.4
[Start]37.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)
\] |
|---|---|
exponential.json-simplify-27 [=>]41.5 | \[ \color{blue}{{\left(\frac{d}{h} \cdot \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)
\] |
metadata-eval [=>]41.5 | \[ {\left(\frac{d}{h} \cdot \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)
\] |
metadata-eval [=>]41.5 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left(\color{blue}{0.5} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
rational.json-simplify-49 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left(0.5 \cdot {\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
rational.json-simplify-2 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left(0.5 \cdot {\left(D \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
Applied egg-rr42.4
Simplified42.4
[Start]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left({\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right) + 0\right)\right)
\] |
|---|---|
rational.json-simplify-4 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)
\] |
rational.json-simplify-2 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \color{blue}{\left(\frac{h}{\ell} \cdot 0.5\right)}\right)
\] |
metadata-eval [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot \color{blue}{\frac{2}{4}}\right)\right)
\] |
rational.json-simplify-49 [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \color{blue}{\frac{2 \cdot \frac{h}{\ell}}{4}}\right)
\] |
metadata-eval [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \frac{2 \cdot \frac{h}{\ell}}{\color{blue}{\frac{2}{0.5}}}\right)
\] |
rational.json-simplify-61 [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \color{blue}{\frac{0.5}{\frac{2}{2 \cdot \frac{h}{\ell}}}}\right)
\] |
rational.json-simplify-49 [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\frac{2}{2 \cdot \frac{h}{\ell}}}}\right)
\] |
rational.json-simplify-61 [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{2 \cdot \frac{h}{\ell}}{\frac{2}{0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}}\right)
\] |
rational.json-simplify-49 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{h}{\ell} \cdot \frac{2}{\frac{2}{0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}}\right)
\] |
rational.json-simplify-46 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{2}{\color{blue}{\frac{\frac{2}{0.5}}{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}}\right)
\] |
metadata-eval [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{2}{\frac{\color{blue}{4}}{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}\right)
\] |
rational.json-simplify-61 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \color{blue}{\frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\frac{4}{2}}}\right)
\] |
metadata-eval [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\color{blue}{2}}\right)
\] |
rational.json-simplify-43 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{{\color{blue}{\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right)}}^{2}}{2}\right)
\] |
rational.json-simplify-2 [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{{\left(0.5 \cdot \color{blue}{\left(D \cdot \frac{M}{d}\right)}\right)}^{2}}{2}\right)
\] |
exponential.json-simplify-26 [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{\color{blue}{{0.5}^{2} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}}{2}\right)
\] |
metadata-eval [=>]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{\color{blue}{0.25} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{2}\right)
\] |
metadata-eval [<=]42.4 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{\color{blue}{\frac{2}{8}} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{2}\right)
\] |
Applied egg-rr42.6
Simplified42.4
[Start]42.6 | \[ \left({\left(\frac{d}{\frac{h}{\frac{d}{\ell}}}\right)}^{0.5} + 0\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
|---|---|
rational.json-simplify-4 [=>]42.6 | \[ \color{blue}{{\left(\frac{d}{\frac{h}{\frac{d}{\ell}}}\right)}^{0.5}} \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
rational.json-simplify-61 [=>]42.4 | \[ {\color{blue}{\left(\frac{\frac{d}{\ell}}{\frac{h}{d}}\right)}}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(D \cdot \frac{M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
Taylor expanded in D around 0 41.5
Taylor expanded in d around -inf 26.9
Simplified26.8
[Start]26.9 | \[ \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
|---|---|
rational.json-simplify-43 [=>]26.9 | \[ \color{blue}{\left(d \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot -1\right)\right)} \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
rational.json-simplify-9 [=>]26.9 | \[ \left(d \cdot \color{blue}{\left(-\sqrt{\frac{1}{\ell \cdot h}}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
rational.json-simplify-46 [=>]26.8 | \[ \left(d \cdot \left(-\sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}}\right)\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
rational.json-simplify-44 [=>]26.8 | \[ \left(d \cdot \left(-\sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}\right)\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d}\right)}^{2} \cdot 0.125\right)\right)
\] |
if 1.00000000000000003e-306 < (*.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)))) < 4.99999999999999961e273Initial program 1.1
Simplified15.9
[Start]1.1 | \[ \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)
\] |
|---|---|
exponential.json-simplify-27 [=>]15.8 | \[ \color{blue}{{\left(\frac{d}{h} \cdot \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)
\] |
metadata-eval [=>]15.8 | \[ {\left(\frac{d}{h} \cdot \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)
\] |
metadata-eval [=>]15.8 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left(\color{blue}{0.5} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
rational.json-simplify-49 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left(0.5 \cdot {\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
rational.json-simplify-2 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left(0.5 \cdot {\left(D \cdot \frac{M}{\color{blue}{d \cdot 2}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
Applied egg-rr15.9
Simplified15.9
[Start]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \left({\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right) + 0\right)\right)
\] |
|---|---|
rational.json-simplify-4 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(0.5 \cdot \frac{h}{\ell}\right)}\right)
\] |
rational.json-simplify-2 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \color{blue}{\left(\frac{h}{\ell} \cdot 0.5\right)}\right)
\] |
metadata-eval [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot \color{blue}{\frac{2}{4}}\right)\right)
\] |
rational.json-simplify-49 [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \color{blue}{\frac{2 \cdot \frac{h}{\ell}}{4}}\right)
\] |
metadata-eval [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \frac{2 \cdot \frac{h}{\ell}}{\color{blue}{\frac{2}{0.5}}}\right)
\] |
rational.json-simplify-61 [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2} \cdot \color{blue}{\frac{0.5}{\frac{2}{2 \cdot \frac{h}{\ell}}}}\right)
\] |
rational.json-simplify-49 [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\frac{2}{2 \cdot \frac{h}{\ell}}}}\right)
\] |
rational.json-simplify-61 [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{2 \cdot \frac{h}{\ell}}{\frac{2}{0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}}\right)
\] |
rational.json-simplify-49 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{h}{\ell} \cdot \frac{2}{\frac{2}{0.5 \cdot {\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}}\right)
\] |
rational.json-simplify-46 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{2}{\color{blue}{\frac{\frac{2}{0.5}}{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}}\right)
\] |
metadata-eval [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{2}{\frac{\color{blue}{4}}{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}}\right)
\] |
rational.json-simplify-61 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \color{blue}{\frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\frac{4}{2}}}\right)
\] |
metadata-eval [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{{\left(D \cdot \left(0.5 \cdot \frac{M}{d}\right)\right)}^{2}}{\color{blue}{2}}\right)
\] |
rational.json-simplify-43 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{{\color{blue}{\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right)}}^{2}}{2}\right)
\] |
rational.json-simplify-2 [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{{\left(0.5 \cdot \color{blue}{\left(D \cdot \frac{M}{d}\right)}\right)}^{2}}{2}\right)
\] |
exponential.json-simplify-26 [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{\color{blue}{{0.5}^{2} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}}{2}\right)
\] |
metadata-eval [=>]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{\color{blue}{0.25} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{2}\right)
\] |
metadata-eval [<=]15.9 | \[ {\left(\frac{d}{h} \cdot \frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \frac{h}{\ell} \cdot \frac{\color{blue}{\frac{2}{8}} \cdot {\left(D \cdot \frac{M}{d}\right)}^{2}}{2}\right)
\] |
Applied egg-rr1.2
if 4.99999999999999961e273 < (*.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 63.0
Taylor expanded in d around inf 43.3
Simplified43.3
[Start]43.3 | \[ \sqrt{\frac{1}{\ell \cdot h}} \cdot d
\] |
|---|---|
rational.json-simplify-2 [=>]43.3 | \[ \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}}
\] |
rational.json-simplify-46 [=>]43.3 | \[ d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}}
\] |
Final simplification19.3
| Alternative 1 | |
|---|---|
| Error | 19.3 |
| Cost | 104464 |
| Alternative 2 | |
|---|---|
| Error | 21.6 |
| Cost | 21528 |
| Alternative 3 | |
|---|---|
| Error | 23.5 |
| Cost | 21264 |
| Alternative 4 | |
|---|---|
| Error | 24.5 |
| Cost | 15064 |
| Alternative 5 | |
|---|---|
| Error | 24.8 |
| Cost | 14932 |
| Alternative 6 | |
|---|---|
| Error | 23.3 |
| Cost | 14932 |
| Alternative 7 | |
|---|---|
| Error | 23.5 |
| Cost | 14800 |
| Alternative 8 | |
|---|---|
| Error | 23.8 |
| Cost | 14404 |
| Alternative 9 | |
|---|---|
| Error | 24.5 |
| Cost | 14404 |
| Alternative 10 | |
|---|---|
| Error | 25.5 |
| Cost | 14340 |
| Alternative 11 | |
|---|---|
| Error | 28.1 |
| Cost | 7044 |
| Alternative 12 | |
|---|---|
| Error | 28.0 |
| Cost | 7044 |
| Alternative 13 | |
|---|---|
| Error | 43.1 |
| Cost | 6848 |
herbie shell --seed 2023073
(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)))))