| Alternative 1 | |
|---|---|
| Accuracy | 71.5% |
| Cost | 33800 |

(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)))))
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* D (/ M (* d 2.0)))) (t_1 (sqrt (/ d h))) (t_2 (sqrt (/ d l))))
(if (<= d -2e-310)
(* t_1 (* t_2 (- 1.0 (* 0.5 (pow (* t_0 (sqrt (/ h l))) 2.0)))))
(if (<= d 1.05e-197)
(* (* D (* (* M M) (/ D d))) (* (/ (sqrt h) (pow l 1.5)) -0.125))
(*
t_1
(* t_2 (- 1.0 (* 0.5 (pow (* t_0 (/ (sqrt h) (sqrt l))) 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)));
}
assert(M < D);
double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M / (d * 2.0));
double t_1 = sqrt((d / h));
double t_2 = sqrt((d / l));
double tmp;
if (d <= -2e-310) {
tmp = t_1 * (t_2 * (1.0 - (0.5 * pow((t_0 * sqrt((h / l))), 2.0))));
} else if (d <= 1.05e-197) {
tmp = (D * ((M * M) * (D / d))) * ((sqrt(h) / pow(l, 1.5)) * -0.125);
} else {
tmp = t_1 * (t_2 * (1.0 - (0.5 * pow((t_0 * (sqrt(h) / sqrt(l))), 2.0))));
}
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
NOTE: M and D should be sorted in increasing order before calling this 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) :: t_2
real(8) :: tmp
t_0 = d_1 * (m / (d * 2.0d0))
t_1 = sqrt((d / h))
t_2 = sqrt((d / l))
if (d <= (-2d-310)) then
tmp = t_1 * (t_2 * (1.0d0 - (0.5d0 * ((t_0 * sqrt((h / l))) ** 2.0d0))))
else if (d <= 1.05d-197) then
tmp = (d_1 * ((m * m) * (d_1 / d))) * ((sqrt(h) / (l ** 1.5d0)) * (-0.125d0))
else
tmp = t_1 * (t_2 * (1.0d0 - (0.5d0 * ((t_0 * (sqrt(h) / sqrt(l))) ** 2.0d0))))
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)));
}
assert M < D;
public static double code(double d, double h, double l, double M, double D) {
double t_0 = D * (M / (d * 2.0));
double t_1 = Math.sqrt((d / h));
double t_2 = Math.sqrt((d / l));
double tmp;
if (d <= -2e-310) {
tmp = t_1 * (t_2 * (1.0 - (0.5 * Math.pow((t_0 * Math.sqrt((h / l))), 2.0))));
} else if (d <= 1.05e-197) {
tmp = (D * ((M * M) * (D / d))) * ((Math.sqrt(h) / Math.pow(l, 1.5)) * -0.125);
} else {
tmp = t_1 * (t_2 * (1.0 - (0.5 * Math.pow((t_0 * (Math.sqrt(h) / Math.sqrt(l))), 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)))
[M, D] = sort([M, D]) def code(d, h, l, M, D): t_0 = D * (M / (d * 2.0)) t_1 = math.sqrt((d / h)) t_2 = math.sqrt((d / l)) tmp = 0 if d <= -2e-310: tmp = t_1 * (t_2 * (1.0 - (0.5 * math.pow((t_0 * math.sqrt((h / l))), 2.0)))) elif d <= 1.05e-197: tmp = (D * ((M * M) * (D / d))) * ((math.sqrt(h) / math.pow(l, 1.5)) * -0.125) else: tmp = t_1 * (t_2 * (1.0 - (0.5 * math.pow((t_0 * (math.sqrt(h) / math.sqrt(l))), 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
M, D = sort([M, D]) function code(d, h, l, M, D) t_0 = Float64(D * Float64(M / Float64(d * 2.0))) t_1 = sqrt(Float64(d / h)) t_2 = sqrt(Float64(d / l)) tmp = 0.0 if (d <= -2e-310) tmp = Float64(t_1 * Float64(t_2 * Float64(1.0 - Float64(0.5 * (Float64(t_0 * sqrt(Float64(h / l))) ^ 2.0))))); elseif (d <= 1.05e-197) tmp = Float64(Float64(D * Float64(Float64(M * M) * Float64(D / d))) * Float64(Float64(sqrt(h) / (l ^ 1.5)) * -0.125)); else tmp = Float64(t_1 * Float64(t_2 * Float64(1.0 - Float64(0.5 * (Float64(t_0 * Float64(sqrt(h) / sqrt(l))) ^ 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
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(d, h, l, M, D)
t_0 = D * (M / (d * 2.0));
t_1 = sqrt((d / h));
t_2 = sqrt((d / l));
tmp = 0.0;
if (d <= -2e-310)
tmp = t_1 * (t_2 * (1.0 - (0.5 * ((t_0 * sqrt((h / l))) ^ 2.0))));
elseif (d <= 1.05e-197)
tmp = (D * ((M * M) * (D / d))) * ((sqrt(h) / (l ^ 1.5)) * -0.125);
else
tmp = t_1 * (t_2 * (1.0 - (0.5 * ((t_0 * (sqrt(h) / sqrt(l))) ^ 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]
NOTE: M and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(D * N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -2e-310], N[(t$95$1 * N[(t$95$2 * N[(1.0 - N[(0.5 * N[Power[N[(t$95$0 * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.05e-197], N[(N[(D * N[(N[(M * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[(1.0 - N[(0.5 * N[Power[N[(t$95$0 * N[(N[Sqrt[h], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
t_0 := D \cdot \frac{M}{d \cdot 2}\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \left(1 - 0.5 \cdot {\left(t_0 \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)\\
\mathbf{elif}\;d \leq 1.05 \cdot 10^{-197}:\\
\;\;\;\;\left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot -0.125\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(t_2 \cdot \left(1 - 0.5 \cdot {\left(t_0 \cdot \frac{\sqrt{h}}{\sqrt{\ell}}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
if d < -1.999999999999994e-310Initial program 71.4%
Simplified71.3%
[Start]71.4% | \[ \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* [=>]71.4% | \[ \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 [=>]71.4% | \[ {\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 [=>]71.4% | \[ \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 [=>]71.4% | \[ \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 [=>]71.4% | \[ \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* [=>]71.4% | \[ \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 [=>]71.4% | \[ \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 [=>]71.3% | \[ \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-rr69.6%
[Start]71.3% | \[ \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)
\] |
|---|---|
associate-*r/ [=>]69.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right)\right)
\] |
frac-times [=>]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
*-commutative [=>]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
*-commutative [=>]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D \cdot M}{\color{blue}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-*r/ [<=]69.6% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-/r* [=>]69.6% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
Applied egg-rr73.6%
[Start]69.6% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
|---|---|
*-commutative [=>]69.6% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{\color{blue}{h \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}}}{\ell}\right)\right)
\] |
associate-/l/ [=>]69.6% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \color{blue}{\frac{M}{2 \cdot d}}\right)}^{2}}{\ell}\right)\right)
\] |
associate-*l/ [<=]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}\right)}\right)\right)
\] |
add-sqr-sqrt [=>]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}\right)}\right)\right)
\] |
pow2 [=>]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}\right)}^{2}}\right)\right)
\] |
if -1.999999999999994e-310 < d < 1.05e-197Initial program 27.8%
Taylor expanded in d around 0 43.2%
Simplified37.5%
[Start]43.2% | \[ -0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)
\] |
|---|---|
*-commutative [=>]43.2% | \[ \color{blue}{\left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot -0.125}
\] |
associate-*l* [=>]43.2% | \[ \color{blue}{\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)}
\] |
associate-/l* [=>]38.2% | \[ \color{blue}{\frac{{D}^{2}}{\frac{d}{{M}^{2}}}} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
associate-/r/ [=>]37.4% | \[ \color{blue}{\left(\frac{{D}^{2}}{d} \cdot {M}^{2}\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
unpow2 [=>]37.4% | \[ \left(\frac{\color{blue}{D \cdot D}}{d} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
associate-/l* [=>]37.5% | \[ \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot {M}^{2}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
unpow2 [=>]37.5% | \[ \left(\frac{D}{\frac{d}{D}} \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
Taylor expanded in D around 0 43.2%
Simplified38.2%
[Start]43.2% | \[ \frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
|---|---|
unpow2 [=>]43.2% | \[ \frac{{D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}}{d} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
associate-*l/ [<=]37.4% | \[ \color{blue}{\left(\frac{{D}^{2}}{d} \cdot \left(M \cdot M\right)\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
unpow2 [=>]37.4% | \[ \left(\frac{\color{blue}{D \cdot D}}{d} \cdot \left(M \cdot M\right)\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
associate-*r/ [<=]37.5% | \[ \left(\color{blue}{\left(D \cdot \frac{D}{d}\right)} \cdot \left(M \cdot M\right)\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
associate-*l* [=>]38.2% | \[ \color{blue}{\left(D \cdot \left(\frac{D}{d} \cdot \left(M \cdot M\right)\right)\right)} \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
*-commutative [=>]38.2% | \[ \left(D \cdot \color{blue}{\left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)}\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
Applied egg-rr48.4%
[Start]38.2% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\sqrt{\frac{h}{{\ell}^{3}}} \cdot -0.125\right)
\] |
|---|---|
sqrt-div [=>]48.4% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\color{blue}{\frac{\sqrt{h}}{\sqrt{{\ell}^{3}}}} \cdot -0.125\right)
\] |
Simplified64.0%
[Start]48.4% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{\sqrt{{\ell}^{3}}} \cdot -0.125\right)
\] |
|---|---|
sqr-pow [=>]48.4% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{\sqrt{\color{blue}{{\ell}^{\left(\frac{3}{2}\right)} \cdot {\ell}^{\left(\frac{3}{2}\right)}}}} \cdot -0.125\right)
\] |
rem-sqrt-square [=>]64.0% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{\color{blue}{\left|{\ell}^{\left(\frac{3}{2}\right)}\right|}} \cdot -0.125\right)
\] |
sqr-pow [=>]64.0% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{\left|\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}\right|} \cdot -0.125\right)
\] |
fabs-sqr [=>]64.0% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{\color{blue}{{\ell}^{\left(\frac{\frac{3}{2}}{2}\right)} \cdot {\ell}^{\left(\frac{\frac{3}{2}}{2}\right)}}} \cdot -0.125\right)
\] |
sqr-pow [<=]64.0% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{\color{blue}{{\ell}^{\left(\frac{3}{2}\right)}}} \cdot -0.125\right)
\] |
metadata-eval [=>]64.0% | \[ \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{\sqrt{h}}{{\ell}^{\color{blue}{1.5}}} \cdot -0.125\right)
\] |
if 1.05e-197 < d Initial program 79.0%
Simplified78.0%
[Start]79.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* [=>]78.9% | \[ \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 [=>]78.9% | \[ {\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 [=>]78.9% | \[ \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 [=>]78.9% | \[ \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 [=>]78.9% | \[ \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* [=>]78.9% | \[ \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 [=>]78.9% | \[ \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 [=>]78.0% | \[ \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-rr81.4%
[Start]78.0% | \[ \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)
\] |
|---|---|
associate-*r/ [=>]80.6% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\frac{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot h}{\ell}}\right)\right)
\] |
frac-times [=>]81.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
*-commutative [=>]81.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{\color{blue}{D \cdot M}}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
*-commutative [=>]81.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(\frac{D \cdot M}{\color{blue}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-*r/ [<=]81.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-/r* [=>]81.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
Applied egg-rr81.4%
[Start]81.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
|---|---|
*-commutative [=>]81.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{\color{blue}{h \cdot {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2}}}{\ell}\right)\right)
\] |
associate-/l/ [=>]81.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{h \cdot {\left(D \cdot \color{blue}{\frac{M}{2 \cdot d}}\right)}^{2}}{\ell}\right)\right)
\] |
associate-*l/ [<=]78.7% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}\right)}\right)\right)
\] |
add-sqr-sqrt [=>]78.7% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}\right)}\right)\right)
\] |
pow2 [=>]78.7% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{\frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}\right)}^{2}}\right)\right)
\] |
Applied egg-rr85.0%
[Start]81.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
|---|---|
sqrt-div [=>]85.0% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\left(D \cdot \frac{M}{d \cdot 2}\right) \cdot \color{blue}{\frac{\sqrt{h}}{\sqrt{\ell}}}\right)}^{2}\right)\right)
\] |
Final simplification77.6%
| Alternative 1 | |
|---|---|
| Accuracy | 71.5% |
| Cost | 33800 |
| Alternative 2 | |
|---|---|
| Accuracy | 71.5% |
| Cost | 48068 |
| Alternative 3 | |
|---|---|
| Accuracy | 71.0% |
| Cost | 41796 |
| Alternative 4 | |
|---|---|
| Accuracy | 69.6% |
| Cost | 21128 |
| Alternative 5 | |
|---|---|
| Accuracy | 68.8% |
| Cost | 21000 |
| Alternative 6 | |
|---|---|
| Accuracy | 69.6% |
| Cost | 21000 |
| Alternative 7 | |
|---|---|
| Accuracy | 67.0% |
| Cost | 20736 |
| Alternative 8 | |
|---|---|
| Accuracy | 68.4% |
| Cost | 15052 |
| Alternative 9 | |
|---|---|
| Accuracy | 70.5% |
| Cost | 14668 |
| Alternative 10 | |
|---|---|
| Accuracy | 57.1% |
| Cost | 14536 |
| Alternative 11 | |
|---|---|
| Accuracy | 62.2% |
| Cost | 14536 |
| Alternative 12 | |
|---|---|
| Accuracy | 64.4% |
| Cost | 14536 |
| Alternative 13 | |
|---|---|
| Accuracy | 47.0% |
| Cost | 14088 |
| Alternative 14 | |
|---|---|
| Accuracy | 49.9% |
| Cost | 14088 |
| Alternative 15 | |
|---|---|
| Accuracy | 32.1% |
| Cost | 13444 |
| Alternative 16 | |
|---|---|
| Accuracy | 31.9% |
| Cost | 13444 |
| Alternative 17 | |
|---|---|
| Accuracy | 30.1% |
| Cost | 13380 |
| Alternative 18 | |
|---|---|
| Accuracy | 45.8% |
| Cost | 13380 |
| Alternative 19 | |
|---|---|
| Accuracy | 26.4% |
| Cost | 6848 |
| Alternative 20 | |
|---|---|
| Accuracy | 26.2% |
| Cost | 6784 |
| Alternative 21 | |
|---|---|
| Accuracy | 26.2% |
| Cost | 6720 |
herbie shell --seed 2023167
(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)))))