| Alternative 1 | |
|---|---|
| Error | 27.85% |
| Cost | 40592 |
(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
(pow (* (sqrt (/ h l)) (* (* (/ 0.5 d) (* M D)) (sqrt 0.5))) 2.0)))
(t_1 (sqrt (- d))))
(if (<= d -1.35e-90)
(* (* (/ t_1 (sqrt (- h))) (sqrt (/ d l))) t_0)
(if (<= d -7.2e-296)
(* t_0 (* (sqrt (/ d h)) (/ t_1 (sqrt (- l)))))
(if (<= d 3.8e-221)
(* (/ (* (* M D) (* M D)) d) (* (sqrt (/ h (pow l 3.0))) -0.125))
(if (<= d 5.5e+147)
(* t_0 (* (pow (/ d h) 0.5) (* (sqrt (/ 1.0 l)) (sqrt d))))
(* d (/ (sqrt (/ 1.0 h)) (sqrt l)))))))))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 - pow((sqrt((h / l)) * (((0.5 / d) * (M * D)) * sqrt(0.5))), 2.0);
double t_1 = sqrt(-d);
double tmp;
if (d <= -1.35e-90) {
tmp = ((t_1 / sqrt(-h)) * sqrt((d / l))) * t_0;
} else if (d <= -7.2e-296) {
tmp = t_0 * (sqrt((d / h)) * (t_1 / sqrt(-l)));
} else if (d <= 3.8e-221) {
tmp = (((M * D) * (M * D)) / d) * (sqrt((h / pow(l, 3.0))) * -0.125);
} else if (d <= 5.5e+147) {
tmp = t_0 * (pow((d / h), 0.5) * (sqrt((1.0 / l)) * sqrt(d)));
} else {
tmp = d * (sqrt((1.0 / h)) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - ((sqrt((h / l)) * (((0.5d0 / d) * (m * d_1)) * sqrt(0.5d0))) ** 2.0d0)
t_1 = sqrt(-d)
if (d <= (-1.35d-90)) then
tmp = ((t_1 / sqrt(-h)) * sqrt((d / l))) * t_0
else if (d <= (-7.2d-296)) then
tmp = t_0 * (sqrt((d / h)) * (t_1 / sqrt(-l)))
else if (d <= 3.8d-221) then
tmp = (((m * d_1) * (m * d_1)) / d) * (sqrt((h / (l ** 3.0d0))) * (-0.125d0))
else if (d <= 5.5d+147) then
tmp = t_0 * (((d / h) ** 0.5d0) * (sqrt((1.0d0 / l)) * sqrt(d)))
else
tmp = d * (sqrt((1.0d0 / h)) / sqrt(l))
end if
code = tmp
end function
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 - Math.pow((Math.sqrt((h / l)) * (((0.5 / d) * (M * D)) * Math.sqrt(0.5))), 2.0);
double t_1 = Math.sqrt(-d);
double tmp;
if (d <= -1.35e-90) {
tmp = ((t_1 / Math.sqrt(-h)) * Math.sqrt((d / l))) * t_0;
} else if (d <= -7.2e-296) {
tmp = t_0 * (Math.sqrt((d / h)) * (t_1 / Math.sqrt(-l)));
} else if (d <= 3.8e-221) {
tmp = (((M * D) * (M * D)) / d) * (Math.sqrt((h / Math.pow(l, 3.0))) * -0.125);
} else if (d <= 5.5e+147) {
tmp = t_0 * (Math.pow((d / h), 0.5) * (Math.sqrt((1.0 / l)) * Math.sqrt(d)));
} else {
tmp = d * (Math.sqrt((1.0 / h)) / Math.sqrt(l));
}
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 - math.pow((math.sqrt((h / l)) * (((0.5 / d) * (M * D)) * math.sqrt(0.5))), 2.0) t_1 = math.sqrt(-d) tmp = 0 if d <= -1.35e-90: tmp = ((t_1 / math.sqrt(-h)) * math.sqrt((d / l))) * t_0 elif d <= -7.2e-296: tmp = t_0 * (math.sqrt((d / h)) * (t_1 / math.sqrt(-l))) elif d <= 3.8e-221: tmp = (((M * D) * (M * D)) / d) * (math.sqrt((h / math.pow(l, 3.0))) * -0.125) elif d <= 5.5e+147: tmp = t_0 * (math.pow((d / h), 0.5) * (math.sqrt((1.0 / l)) * math.sqrt(d))) else: tmp = d * (math.sqrt((1.0 / h)) / math.sqrt(l)) 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(sqrt(Float64(h / l)) * Float64(Float64(Float64(0.5 / d) * Float64(M * D)) * sqrt(0.5))) ^ 2.0)) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (d <= -1.35e-90) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * t_0); elseif (d <= -7.2e-296) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(t_1 / sqrt(Float64(-l))))); elseif (d <= 3.8e-221) tmp = Float64(Float64(Float64(Float64(M * D) * Float64(M * D)) / d) * Float64(sqrt(Float64(h / (l ^ 3.0))) * -0.125)); elseif (d <= 5.5e+147) tmp = Float64(t_0 * Float64((Float64(d / h) ^ 0.5) * Float64(sqrt(Float64(1.0 / l)) * sqrt(d)))); else tmp = Float64(d * Float64(sqrt(Float64(1.0 / h)) / sqrt(l))); 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 - ((sqrt((h / l)) * (((0.5 / d) * (M * D)) * sqrt(0.5))) ^ 2.0); t_1 = sqrt(-d); tmp = 0.0; if (d <= -1.35e-90) tmp = ((t_1 / sqrt(-h)) * sqrt((d / l))) * t_0; elseif (d <= -7.2e-296) tmp = t_0 * (sqrt((d / h)) * (t_1 / sqrt(-l))); elseif (d <= 3.8e-221) tmp = (((M * D) * (M * D)) / d) * (sqrt((h / (l ^ 3.0))) * -0.125); elseif (d <= 5.5e+147) tmp = t_0 * (((d / h) ^ 0.5) * (sqrt((1.0 / l)) * sqrt(d))); else tmp = d * (sqrt((1.0 / h)) / sqrt(l)); 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[Power[N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(0.5 / d), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[d, -1.35e-90], N[(N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, -7.2e-296], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.8e-221], N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.5e+147], N[(t$95$0 * N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Sqrt[N[(1.0 / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $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(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\frac{0.5}{d} \cdot \left(M \cdot D\right)\right) \cdot \sqrt{0.5}\right)\right)}^{2}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;d \leq -1.35 \cdot 10^{-90}:\\
\;\;\;\;\left(\frac{t_1}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t_0\\
\mathbf{elif}\;d \leq -7.2 \cdot 10^{-296}:\\
\;\;\;\;t_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{t_1}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;d \leq 3.8 \cdot 10^{-221}:\\
\;\;\;\;\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)\\
\mathbf{elif}\;d \leq 5.5 \cdot 10^{+147}:\\
\;\;\;\;t_0 \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \sqrt{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\
\end{array}
Results
if d < -1.34999999999999998e-90Initial program 35.1
Applied egg-rr33.82
Applied egg-rr62.05
Simplified33.82
[Start]62.05 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)} - 1\right)\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
|---|---|
expm1-def [=>]36.11 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)\right)}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
expm1-log1p [=>]33.82 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
Applied egg-rr21.06
if -1.34999999999999998e-90 < d < -7.19999999999999961e-296Initial program 56.12
Applied egg-rr51.6
Applied egg-rr79.13
Simplified51.6
[Start]79.13 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)} - 1\right)\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
|---|---|
expm1-def [=>]51.95 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)\right)}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
expm1-log1p [=>]51.6 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
Applied egg-rr73.16
Simplified51.6
[Start]73.16 | \[ \left(\left(e^{\mathsf{log1p}\left(\sqrt{\frac{d}{h}}\right)} - 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
|---|---|
expm1-def [=>]52.3 | \[ \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{h}}\right)\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
expm1-log1p [=>]51.6 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
Applied egg-rr38.42
if -7.19999999999999961e-296 < d < 3.8000000000000001e-221Initial program 67.29
Simplified69.12
[Start]67.29 | \[ \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 [=>]67.29 | \[ \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 [=>]67.29 | \[ \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 [=>]67.29 | \[ \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 [=>]67.29 | \[ \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* [=>]67.29 | \[ \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 [=>]67.29 | \[ \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 [=>]69.12 | \[ \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-rr69.33
Taylor expanded in d around 0 80.04
Simplified74.48
[Start]80.04 | \[ -0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)
\] |
|---|---|
*-commutative [=>]80.04 | \[ \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot -0.125}
\] |
associate-*l* [=>]80.04 | \[ \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)}
\] |
unpow2 [=>]80.04 | \[ \frac{\color{blue}{\left(D \cdot D\right)} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
unpow2 [=>]80.04 | \[ \frac{\left(D \cdot D\right) \cdot \color{blue}{\left(M \cdot M\right)}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
unswap-sqr [=>]74.48 | \[ \frac{\color{blue}{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
if 3.8000000000000001e-221 < d < 5.4999999999999997e147Initial program 35.34
Applied egg-rr32.33
Applied egg-rr25.37
Simplified25.37
[Start]25.37 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{\ell}}\right)\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
|---|---|
*-commutative [=>]25.37 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left(\sqrt{\frac{1}{\ell}} \cdot \sqrt{d}\right)}\right) \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)
\] |
if 5.4999999999999997e147 < d Initial program 46.5
Simplified45.83
[Start]46.5 | \[ \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 [=>]46.5 | \[ \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 [=>]46.5 | \[ \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 [=>]46.5 | \[ \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 [=>]46.49 | \[ \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* [=>]46.49 | \[ \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 [=>]46.49 | \[ \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 [=>]45.83 | \[ \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 d around inf 25.18
Simplified24.1
[Start]25.18 | \[ \sqrt{\frac{1}{\ell \cdot h}} \cdot d
\] |
|---|---|
*-commutative [=>]25.18 | \[ \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}}
\] |
associate-/r* [=>]24.1 | \[ d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}}
\] |
Applied egg-rr7.89
Simplified7.89
[Start]7.89 | \[ d \cdot \frac{1 \cdot \sqrt{\frac{1}{h}}}{\sqrt{\ell}}
\] |
|---|---|
*-lft-identity [=>]7.89 | \[ d \cdot \frac{\color{blue}{\sqrt{\frac{1}{h}}}}{\sqrt{\ell}}
\] |
Final simplification27.1
| Alternative 1 | |
|---|---|
| Error | 27.85% |
| Cost | 40592 |
| Alternative 2 | |
|---|---|
| Error | 26.75% |
| Cost | 40592 |
| Alternative 3 | |
|---|---|
| Error | 27.11% |
| Cost | 40592 |
| Alternative 4 | |
|---|---|
| Error | 27.09% |
| Cost | 40528 |
| Alternative 5 | |
|---|---|
| Error | 29.27% |
| Cost | 34196 |
| Alternative 6 | |
|---|---|
| Error | 30.07% |
| Cost | 34064 |
| Alternative 7 | |
|---|---|
| Error | 28.41% |
| Cost | 34064 |
| Alternative 8 | |
|---|---|
| Error | 29.5% |
| Cost | 28120 |
| Alternative 9 | |
|---|---|
| Error | 30.02% |
| Cost | 27528 |
| Alternative 10 | |
|---|---|
| Error | 31.25% |
| Cost | 27468 |
| Alternative 11 | |
|---|---|
| Error | 29.84% |
| Cost | 27396 |
| Alternative 12 | |
|---|---|
| Error | 33.54% |
| Cost | 21720 |
| Alternative 13 | |
|---|---|
| Error | 32.02% |
| Cost | 21720 |
| Alternative 14 | |
|---|---|
| Error | 30.92% |
| Cost | 21720 |
| Alternative 15 | |
|---|---|
| Error | 34.67% |
| Cost | 21400 |
| Alternative 16 | |
|---|---|
| Error | 33% |
| Cost | 21400 |
| Alternative 17 | |
|---|---|
| Error | 36.81% |
| Cost | 21145 |
| Alternative 18 | |
|---|---|
| Error | 33.88% |
| Cost | 21136 |
| Alternative 19 | |
|---|---|
| Error | 34.44% |
| Cost | 21004 |
| Alternative 20 | |
|---|---|
| Error | 37.5% |
| Cost | 15184 |
| Alternative 21 | |
|---|---|
| Error | 37.51% |
| Cost | 15056 |
| Alternative 22 | |
|---|---|
| Error | 36.03% |
| Cost | 14920 |
| Alternative 23 | |
|---|---|
| Error | 37.2% |
| Cost | 14600 |
| Alternative 24 | |
|---|---|
| Error | 36.71% |
| Cost | 14352 |
| Alternative 25 | |
|---|---|
| Error | 35.85% |
| Cost | 13448 |
| Alternative 26 | |
|---|---|
| Error | 34.96% |
| Cost | 13448 |
| Alternative 27 | |
|---|---|
| Error | 35.83% |
| Cost | 13384 |
| Alternative 28 | |
|---|---|
| Error | 42.44% |
| Cost | 7176 |
| Alternative 29 | |
|---|---|
| Error | 42.2% |
| Cost | 7176 |
| Alternative 30 | |
|---|---|
| Error | 53.45% |
| Cost | 7112 |
| Alternative 31 | |
|---|---|
| Error | 55.45% |
| Cost | 6980 |
| Alternative 32 | |
|---|---|
| Error | 52.94% |
| Cost | 6980 |
| Alternative 33 | |
|---|---|
| Error | 52.9% |
| Cost | 6980 |
| Alternative 34 | |
|---|---|
| Error | 52.75% |
| Cost | 6980 |
| Alternative 35 | |
|---|---|
| Error | 68.32% |
| Cost | 6720 |
| Alternative 36 | |
|---|---|
| Error | 95.98% |
| Cost | 64 |
herbie shell --seed 2023103
(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)))))