| Alternative 1 | |
|---|---|
| Accuracy | 82.5% |
| Cost | 33928 |

(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 (/ (* h (pow (* M (/ D (* d 2.0))) 2.0)) l))))
(t_1 (sqrt (- d))))
(if (<= h -1.15e-51)
(* (sqrt (/ d h)) (* (/ t_1 (sqrt (- l))) t_0))
(if (<= h -1e-309)
(*
(/ t_1 (sqrt (- h)))
(*
(sqrt (/ d l))
(- 1.0 (* 0.5 (pow (* D (* (* 0.5 (/ M d)) (sqrt (/ h l)))) 2.0)))))
(* (/ (sqrt d) (sqrt h)) (* t_0 (/ (sqrt d) (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 - (0.5 * ((h * pow((M * (D / (d * 2.0))), 2.0)) / l));
double t_1 = sqrt(-d);
double tmp;
if (h <= -1.15e-51) {
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_0);
} else if (h <= -1e-309) {
tmp = (t_1 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * pow((D * ((0.5 * (M / d)) * sqrt((h / l)))), 2.0))));
} else {
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / 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 - (0.5d0 * ((h * ((m * (d_1 / (d * 2.0d0))) ** 2.0d0)) / l))
t_1 = sqrt(-d)
if (h <= (-1.15d-51)) then
tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_0)
else if (h <= (-1d-309)) then
tmp = (t_1 / sqrt(-h)) * (sqrt((d / l)) * (1.0d0 - (0.5d0 * ((d_1 * ((0.5d0 * (m / d)) * sqrt((h / l)))) ** 2.0d0))))
else
tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / 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 - (0.5 * ((h * Math.pow((M * (D / (d * 2.0))), 2.0)) / l));
double t_1 = Math.sqrt(-d);
double tmp;
if (h <= -1.15e-51) {
tmp = Math.sqrt((d / h)) * ((t_1 / Math.sqrt(-l)) * t_0);
} else if (h <= -1e-309) {
tmp = (t_1 / Math.sqrt(-h)) * (Math.sqrt((d / l)) * (1.0 - (0.5 * Math.pow((D * ((0.5 * (M / d)) * Math.sqrt((h / l)))), 2.0))));
} else {
tmp = (Math.sqrt(d) / Math.sqrt(h)) * (t_0 * (Math.sqrt(d) / 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 - (0.5 * ((h * math.pow((M * (D / (d * 2.0))), 2.0)) / l)) t_1 = math.sqrt(-d) tmp = 0 if h <= -1.15e-51: tmp = math.sqrt((d / h)) * ((t_1 / math.sqrt(-l)) * t_0) elif h <= -1e-309: tmp = (t_1 / math.sqrt(-h)) * (math.sqrt((d / l)) * (1.0 - (0.5 * math.pow((D * ((0.5 * (M / d)) * math.sqrt((h / l)))), 2.0)))) else: tmp = (math.sqrt(d) / math.sqrt(h)) * (t_0 * (math.sqrt(d) / 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(0.5 * Float64(Float64(h * (Float64(M * Float64(D / Float64(d * 2.0))) ^ 2.0)) / l))) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -1.15e-51) tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(t_1 / sqrt(Float64(-l))) * t_0)); elseif (h <= -1e-309) tmp = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * Float64(1.0 - Float64(0.5 * (Float64(D * Float64(Float64(0.5 * Float64(M / d)) * sqrt(Float64(h / l)))) ^ 2.0))))); else tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_0 * Float64(sqrt(d) / 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 - (0.5 * ((h * ((M * (D / (d * 2.0))) ^ 2.0)) / l)); t_1 = sqrt(-d); tmp = 0.0; if (h <= -1.15e-51) tmp = sqrt((d / h)) * ((t_1 / sqrt(-l)) * t_0); elseif (h <= -1e-309) tmp = (t_1 / sqrt(-h)) * (sqrt((d / l)) * (1.0 - (0.5 * ((D * ((0.5 * (M / d)) * sqrt((h / l)))) ^ 2.0)))); else tmp = (sqrt(d) / sqrt(h)) * (t_0 * (sqrt(d) / 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[(0.5 * N[(N[(h * N[Power[N[(M * N[(D / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -1.15e-51], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-309], N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(0.5 * N[Power[N[(D * N[(N[(0.5 * N[(M / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\begin{array}{l}
t_0 := 1 - 0.5 \cdot \frac{h \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}}{\ell}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;h \leq -1.15 \cdot 10^{-51}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_1}{\sqrt{-\ell}} \cdot t_0\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{t_1}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(0.5 \cdot \frac{M}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
if h < -1.15000000000000001e-51Initial program 68.4%
Simplified70.0%
[Start]68.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* [=>]68.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 [=>]68.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 [=>]68.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 [=>]68.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 [=>]68.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* [=>]68.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 [=>]68.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 [=>]70.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-rr70.3%
[Start]70.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/ [=>]70.3% | \[ \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)
\] |
add-sqr-sqrt [=>]48.2% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
add-sqr-sqrt [<=]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-*l/ [=>]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 \frac{D}{d}}{2}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-*r/ [<=]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-/l/ [=>]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \color{blue}{\frac{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(M \cdot \frac{D}{\color{blue}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
Applied egg-rr81.3%
[Start]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
|---|---|
frac-2neg [=>]70.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\color{blue}{\frac{-d}{-\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
sqrt-div [=>]81.3% | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
if -1.15000000000000001e-51 < h < -1.000000000000002e-309Initial program 67.6%
Simplified67.5%
[Start]67.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)
\] |
|---|---|
associate-*l* [=>]67.5% | \[ \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 [=>]67.5% | \[ {\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 [=>]67.5% | \[ \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 [=>]67.5% | \[ \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 [=>]67.5% | \[ \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* [=>]67.5% | \[ \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 [=>]67.5% | \[ \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 [=>]67.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
Applied egg-rr71.9%
[Start]67.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)
\] |
|---|---|
add-sqr-sqrt [=>]67.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot \sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}\right)\right)
\] |
pow2 [=>]67.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \color{blue}{{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\right)}^{2}}\right)\right)
\] |
sqrt-prod [=>]67.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(\sqrt{{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}}^{2}\right)\right)
\] |
unpow2 [=>]67.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\sqrt{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
sqrt-prod [=>]51.2% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
add-sqr-sqrt [<=]71.9% | \[ \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)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
associate-*l/ [=>]71.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{M \cdot \frac{D}{d}}{2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
associate-*r/ [<=]71.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(M \cdot \frac{\frac{D}{d}}{2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
associate-/l/ [=>]71.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \color{blue}{\frac{D}{2 \cdot d}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
*-commutative [=>]71.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{D}{\color{blue}{d \cdot 2}}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
Simplified70.5%
[Start]71.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\left(M \cdot \frac{D}{d \cdot 2}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
|---|---|
*-commutative [=>]71.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(\frac{D}{d \cdot 2} \cdot M\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
associate-*l/ [=>]71.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\frac{D \cdot M}{d \cdot 2}} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
associate-*r/ [<=]70.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(\color{blue}{\left(D \cdot \frac{M}{d \cdot 2}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\right)
\] |
associate-*l* [=>]70.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\color{blue}{\left(D \cdot \left(\frac{M}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}}^{2}\right)\right)
\] |
*-lft-identity [<=]70.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{\color{blue}{1 \cdot M}}{d \cdot 2} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)
\] |
*-commutative [=>]70.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\frac{1 \cdot M}{\color{blue}{2 \cdot d}} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)
\] |
times-frac [=>]70.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\color{blue}{\left(\frac{1}{2} \cdot \frac{M}{d}\right)} \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)
\] |
metadata-eval [=>]70.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(\color{blue}{0.5} \cdot \frac{M}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)
\] |
Applied egg-rr84.8%
[Start]70.5% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(0.5 \cdot \frac{M}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)
\] |
|---|---|
frac-2neg [=>]70.5% | \[ \sqrt{\color{blue}{\frac{-d}{-h}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(0.5 \cdot \frac{M}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)
\] |
sqrt-div [=>]84.8% | \[ \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot {\left(D \cdot \left(\left(0.5 \cdot \frac{M}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)\right)}^{2}\right)\right)
\] |
if -1.000000000000002e-309 < h Initial program 70.5%
Simplified68.9%
[Start]70.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)
\] |
|---|---|
associate-*l* [=>]70.5% | \[ \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 [=>]70.5% | \[ {\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 [=>]70.5% | \[ \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 [=>]70.5% | \[ \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 [=>]70.5% | \[ \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* [=>]70.5% | \[ \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 [=>]70.5% | \[ \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 [=>]68.9% | \[ \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-rr71.4%
[Start]68.9% | \[ \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/ [=>]71.4% | \[ \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)
\] |
add-sqr-sqrt [=>]41.9% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\sqrt{\frac{M}{2} \cdot \frac{D}{d}} \cdot \sqrt{\frac{M}{2} \cdot \frac{D}{d}}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
add-sqr-sqrt [<=]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-*l/ [=>]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(\frac{M \cdot \frac{D}{d}}{2}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-*r/ [<=]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\color{blue}{\left(M \cdot \frac{\frac{D}{d}}{2}\right)}}^{2} \cdot h}{\ell}\right)\right)
\] |
associate-/l/ [=>]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \color{blue}{\frac{D}{2 \cdot d}}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
*-commutative [=>]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{\color{blue}{d \cdot 2}}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
Applied egg-rr79.0%
[Start]71.4% | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
|---|---|
sqrt-div [=>]79.0% | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
Applied egg-rr86.2%
[Start]79.0% | \[ \sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
|---|---|
sqrt-div [=>]86.2% | \[ \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2} \cdot h}{\ell}\right)\right)
\] |
Final simplification84.7%
| Alternative 1 | |
|---|---|
| Accuracy | 82.5% |
| Cost | 33928 |
| Alternative 2 | |
|---|---|
| Accuracy | 68.0% |
| Cost | 48068 |
| Alternative 3 | |
|---|---|
| Accuracy | 81.8% |
| Cost | 33928 |
| Alternative 4 | |
|---|---|
| Accuracy | 81.9% |
| Cost | 33928 |
| Alternative 5 | |
|---|---|
| Accuracy | 82.3% |
| Cost | 33668 |
| Alternative 6 | |
|---|---|
| Accuracy | 73.9% |
| Cost | 27400 |
| Alternative 7 | |
|---|---|
| Accuracy | 74.8% |
| Cost | 27396 |
| Alternative 8 | |
|---|---|
| Accuracy | 76.0% |
| Cost | 27396 |
| Alternative 9 | |
|---|---|
| Accuracy | 69.9% |
| Cost | 27268 |
| Alternative 10 | |
|---|---|
| Accuracy | 71.1% |
| Cost | 27268 |
| Alternative 11 | |
|---|---|
| Accuracy | 70.6% |
| Cost | 27268 |
| Alternative 12 | |
|---|---|
| Accuracy | 70.7% |
| Cost | 27268 |
| Alternative 13 | |
|---|---|
| Accuracy | 68.0% |
| Cost | 20800 |
| Alternative 14 | |
|---|---|
| Accuracy | 66.0% |
| Cost | 20736 |
| Alternative 15 | |
|---|---|
| Accuracy | 67.7% |
| Cost | 20736 |
| Alternative 16 | |
|---|---|
| Accuracy | 51.8% |
| Cost | 15180 |
| Alternative 17 | |
|---|---|
| Accuracy | 47.4% |
| Cost | 14924 |
| Alternative 18 | |
|---|---|
| Accuracy | 45.4% |
| Cost | 14665 |
| Alternative 19 | |
|---|---|
| Accuracy | 47.1% |
| Cost | 14665 |
| Alternative 20 | |
|---|---|
| Accuracy | 45.4% |
| Cost | 14664 |
| Alternative 21 | |
|---|---|
| Accuracy | 38.3% |
| Cost | 13248 |
herbie shell --seed 2023272
(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)))))