| Alternative 1 | |
|---|---|
| Error | 18.1 |
| Cost | 21716 |
(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 (/ d (* (sqrt h) (sqrt l))))
(t_1
(+
1.0
(*
0.5
(/ (* h (* M (/ -0.5 (/ d D)))) (/ l (* M (/ 0.5 (/ d D))))))))
(t_2 (sqrt (- d))))
(if (<= h -2.4e-160)
(* (* (sqrt (/ d h)) (/ t_2 (sqrt (- l)))) t_1)
(if (<= h -2.7e-302)
(* t_1 (* (/ t_2 (sqrt (- h))) (sqrt (/ d l))))
(if (<= h 1.15e-60)
(* t_0 (+ 1.0 (* (* (/ D (/ l M)) (* (/ h d) (/ M d))) (* D -0.125))))
(pow
(cbrt
(*
t_0
(+ 1.0 (* (/ h (/ l (pow (* M (* D (/ 0.5 d))) 2.0))) -0.5))))
3.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 = d / (sqrt(h) * sqrt(l));
double t_1 = 1.0 + (0.5 * ((h * (M * (-0.5 / (d / D)))) / (l / (M * (0.5 / (d / D))))));
double t_2 = sqrt(-d);
double tmp;
if (h <= -2.4e-160) {
tmp = (sqrt((d / h)) * (t_2 / sqrt(-l))) * t_1;
} else if (h <= -2.7e-302) {
tmp = t_1 * ((t_2 / sqrt(-h)) * sqrt((d / l)));
} else if (h <= 1.15e-60) {
tmp = t_0 * (1.0 + (((D / (l / M)) * ((h / d) * (M / d))) * (D * -0.125)));
} else {
tmp = pow(cbrt((t_0 * (1.0 + ((h / (l / pow((M * (D * (0.5 / d))), 2.0))) * -0.5)))), 3.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 = d / (Math.sqrt(h) * Math.sqrt(l));
double t_1 = 1.0 + (0.5 * ((h * (M * (-0.5 / (d / D)))) / (l / (M * (0.5 / (d / D))))));
double t_2 = Math.sqrt(-d);
double tmp;
if (h <= -2.4e-160) {
tmp = (Math.sqrt((d / h)) * (t_2 / Math.sqrt(-l))) * t_1;
} else if (h <= -2.7e-302) {
tmp = t_1 * ((t_2 / Math.sqrt(-h)) * Math.sqrt((d / l)));
} else if (h <= 1.15e-60) {
tmp = t_0 * (1.0 + (((D / (l / M)) * ((h / d) * (M / d))) * (D * -0.125)));
} else {
tmp = Math.pow(Math.cbrt((t_0 * (1.0 + ((h / (l / Math.pow((M * (D * (0.5 / d))), 2.0))) * -0.5)))), 3.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 = Float64(d / Float64(sqrt(h) * sqrt(l))) t_1 = Float64(1.0 + Float64(0.5 * Float64(Float64(h * Float64(M * Float64(-0.5 / Float64(d / D)))) / Float64(l / Float64(M * Float64(0.5 / Float64(d / D))))))) t_2 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -2.4e-160) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(t_2 / sqrt(Float64(-l)))) * t_1); elseif (h <= -2.7e-302) tmp = Float64(t_1 * Float64(Float64(t_2 / sqrt(Float64(-h))) * sqrt(Float64(d / l)))); elseif (h <= 1.15e-60) tmp = Float64(t_0 * Float64(1.0 + Float64(Float64(Float64(D / Float64(l / M)) * Float64(Float64(h / d) * Float64(M / d))) * Float64(D * -0.125)))); else tmp = cbrt(Float64(t_0 * Float64(1.0 + Float64(Float64(h / Float64(l / (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0))) * -0.5)))) ^ 3.0; end return 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[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(0.5 * N[(N[(h * N[(M * N[(-0.5 / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l / N[(M * N[(0.5 / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -2.4e-160], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[h, -2.7e-302], N[(t$95$1 * N[(N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 1.15e-60], N[(t$95$0 * N[(1.0 + N[(N[(N[(D / N[(l / M), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(t$95$0 * N[(1.0 + N[(N[(h / N[(l / N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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 := \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
t_1 := 1 + 0.5 \cdot \frac{h \cdot \left(M \cdot \frac{-0.5}{\frac{d}{D}}\right)}{\frac{\ell}{M \cdot \frac{0.5}{\frac{d}{D}}}}\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;h \leq -2.4 \cdot 10^{-160}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t_2}{\sqrt{-\ell}}\right) \cdot t_1\\
\mathbf{elif}\;h \leq -2.7 \cdot 10^{-302}:\\
\;\;\;\;t_1 \cdot \left(\frac{t_2}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;h \leq 1.15 \cdot 10^{-60}:\\
\;\;\;\;t_0 \cdot \left(1 + \left(\frac{D}{\frac{\ell}{M}} \cdot \left(\frac{h}{d} \cdot \frac{M}{d}\right)\right) \cdot \left(D \cdot -0.125\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt[3]{t_0 \cdot \left(1 + \frac{h}{\frac{\ell}{{\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}} \cdot -0.5\right)}\right)}^{3}\\
\end{array}
Results
if h < -2.39999999999999991e-160Initial program 25.3
Simplified25.3
[Start]25.3 | \[ \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)
\] |
|---|---|
metadata-eval [=>]25.3 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \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)
\] |
unpow1/2 [=>]25.3 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \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)
\] |
metadata-eval [=>]25.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\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)
\] |
unpow1/2 [=>]25.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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* [=>]25.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
metadata-eval [=>]25.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
times-frac [=>]25.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
Applied egg-rr25.8
Simplified23.6
[Start]25.8 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(e^{\mathsf{log1p}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)} - 1\right)\right)
\] |
|---|---|
expm1-def [=>]25.8 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}\right)
\] |
expm1-log1p [=>]25.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
associate-*r/ [=>]24.5 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right)
\] |
associate-*l/ [<=]23.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell} \cdot h\right)}\right)
\] |
*-commutative [=>]23.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(h \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)}\right)
\] |
*-commutative [=>]23.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2}}{\ell}\right)\right)
\] |
associate-*r* [=>]23.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot 0.5\right)}}^{2}}{\ell}\right)\right)
\] |
Applied egg-rr22.3
Applied egg-rr15.2
if -2.39999999999999991e-160 < h < -2.70000000000000006e-302Initial program 34.6
Simplified36.2
[Start]34.6 | \[ \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)
\] |
|---|---|
metadata-eval [=>]34.6 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \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)
\] |
unpow1/2 [=>]34.6 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \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)
\] |
metadata-eval [=>]34.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\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)
\] |
unpow1/2 [=>]34.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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* [=>]34.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
metadata-eval [=>]34.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
times-frac [=>]36.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
Applied egg-rr36.4
Simplified38.2
[Start]36.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(e^{\mathsf{log1p}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)} - 1\right)\right)
\] |
|---|---|
expm1-def [=>]36.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}\right)
\] |
expm1-log1p [=>]36.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
associate-*r/ [=>]36.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right)
\] |
associate-*l/ [<=]38.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell} \cdot h\right)}\right)
\] |
*-commutative [=>]38.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(h \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)}\right)
\] |
*-commutative [=>]38.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2}}{\ell}\right)\right)
\] |
associate-*r* [=>]38.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot 0.5\right)}}^{2}}{\ell}\right)\right)
\] |
Applied egg-rr32.6
Applied egg-rr14.2
if -2.70000000000000006e-302 < h < 1.1500000000000001e-60Initial program 29.7
Simplified30.4
[Start]29.7 | \[ \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)
\] |
|---|---|
metadata-eval [=>]29.7 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \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)
\] |
unpow1/2 [=>]29.7 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \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)
\] |
metadata-eval [=>]29.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\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)
\] |
unpow1/2 [=>]29.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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* [=>]29.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
metadata-eval [=>]29.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
times-frac [=>]30.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
Taylor expanded in M around 0 44.3
Simplified36.3
[Start]44.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}\right)\right)
\] |
|---|---|
associate-/r* [=>]42.5 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \color{blue}{\frac{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell}}{{d}^{2}}}\right)\right)
\] |
associate-/l/ [=>]44.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}\right)\right)
\] |
associate-*r* [=>]44.9 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \frac{\color{blue}{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}}{{d}^{2} \cdot \ell}\right)\right)
\] |
*-commutative [<=]44.9 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \frac{\left({D}^{2} \cdot {M}^{2}\right) \cdot h}{\color{blue}{\ell \cdot {d}^{2}}}\right)\right)
\] |
times-frac [=>]42.9 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{\ell} \cdot \frac{h}{{d}^{2}}\right)}\right)\right)
\] |
unpow2 [=>]42.9 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{{D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}}{\ell} \cdot \frac{h}{{d}^{2}}\right)\right)\right)
\] |
associate-*r* [=>]40.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{\color{blue}{\left({D}^{2} \cdot M\right) \cdot M}}{\ell} \cdot \frac{h}{{d}^{2}}\right)\right)\right)
\] |
unpow2 [=>]40.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M}{\ell} \cdot \frac{h}{{d}^{2}}\right)\right)\right)
\] |
unpow2 [=>]40.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}{\ell} \cdot \frac{h}{\color{blue}{d \cdot d}}\right)\right)\right)
\] |
associate-/r* [=>]36.3 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{\left(\left(D \cdot D\right) \cdot M\right) \cdot M}{\ell} \cdot \color{blue}{\frac{\frac{h}{d}}{d}}\right)\right)\right)
\] |
Applied egg-rr32.3
Applied egg-rr29.3
Applied egg-rr11.1
if 1.1500000000000001e-60 < h Initial program 22.9
Simplified23.1
[Start]22.9 | \[ \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)
\] |
|---|---|
metadata-eval [=>]22.9 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \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)
\] |
unpow1/2 [=>]22.9 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \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)
\] |
metadata-eval [=>]22.9 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\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)
\] |
unpow1/2 [=>]22.9 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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* [=>]23.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
metadata-eval [=>]23.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
times-frac [=>]23.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \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)
\] |
Applied egg-rr23.7
Simplified20.4
[Start]23.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(e^{\mathsf{log1p}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)} - 1\right)\right)
\] |
|---|---|
expm1-def [=>]23.7 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)\right)}\right)
\] |
expm1-log1p [=>]23.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left({\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
associate-*r/ [=>]21.8 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}}\right)
\] |
associate-*l/ [<=]20.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell} \cdot h\right)}\right)
\] |
*-commutative [=>]20.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \color{blue}{\left(h \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)}\right)
\] |
*-commutative [=>]20.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot 0.5\right)}\right)}^{2}}{\ell}\right)\right)
\] |
associate-*r* [=>]20.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left(h \cdot \frac{{\color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot 0.5\right)}}^{2}}{\ell}\right)\right)
\] |
Applied egg-rr20.1
Applied egg-rr12.8
Final simplification13.5
| Alternative 1 | |
|---|---|
| Error | 18.1 |
| Cost | 21716 |
| Alternative 2 | |
|---|---|
| Error | 19.1 |
| Cost | 21580 |
| Alternative 3 | |
|---|---|
| Error | 19.0 |
| Cost | 21580 |
| Alternative 4 | |
|---|---|
| Error | 16.3 |
| Cost | 21580 |
| Alternative 5 | |
|---|---|
| Error | 17.8 |
| Cost | 21400 |
| Alternative 6 | |
|---|---|
| Error | 18.6 |
| Cost | 21332 |
| Alternative 7 | |
|---|---|
| Error | 18.6 |
| Cost | 21332 |
| Alternative 8 | |
|---|---|
| Error | 20.0 |
| Cost | 21004 |
| Alternative 9 | |
|---|---|
| Error | 19.2 |
| Cost | 15312 |
| Alternative 10 | |
|---|---|
| Error | 19.7 |
| Cost | 15312 |
| Alternative 11 | |
|---|---|
| Error | 22.7 |
| Cost | 15192 |
| Alternative 12 | |
|---|---|
| Error | 22.0 |
| Cost | 15184 |
| Alternative 13 | |
|---|---|
| Error | 19.9 |
| Cost | 15061 |
| Alternative 14 | |
|---|---|
| Error | 24.2 |
| Cost | 15060 |
| Alternative 15 | |
|---|---|
| Error | 18.8 |
| Cost | 15052 |
| Alternative 16 | |
|---|---|
| Error | 19.6 |
| Cost | 14928 |
| Alternative 17 | |
|---|---|
| Error | 25.5 |
| Cost | 14600 |
| Alternative 18 | |
|---|---|
| Error | 25.6 |
| Cost | 14600 |
| Alternative 19 | |
|---|---|
| Error | 23.5 |
| Cost | 13380 |
| Alternative 20 | |
|---|---|
| Error | 23.5 |
| Cost | 13252 |
| Alternative 21 | |
|---|---|
| Error | 28.5 |
| Cost | 7044 |
| Alternative 22 | |
|---|---|
| Error | 28.3 |
| Cost | 7044 |
| Alternative 23 | |
|---|---|
| Error | 35.4 |
| Cost | 6980 |
| Alternative 24 | |
|---|---|
| Error | 34.1 |
| Cost | 6980 |
| Alternative 25 | |
|---|---|
| Error | 43.3 |
| Cost | 6784 |
| Alternative 26 | |
|---|---|
| Error | 43.3 |
| Cost | 6720 |
herbie shell --seed 2023017
(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)))))