| Alternative 1 | |
|---|---|
| Accuracy | 70.0% |
| Cost | 28248 |
(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 (* (/ M d) 0.5)))
(t_1 (sqrt (- d)))
(t_2 (fma -0.5 (/ t_0 (/ l (* h t_0))) 1.0))
(t_3 (* (/ t_1 (sqrt (- h))) (* (sqrt (/ d l)) t_2)))
(t_4 (sqrt (/ d h))))
(if (<= d -4e+107)
t_3
(if (<= d -9.8e+57)
(* t_4 (* t_2 (/ t_1 (sqrt (- l)))))
(if (<= d -1.45e-173)
t_3
(if (<= d 1.05e-293)
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(+ 1.0 (* (/ h l) (* -0.5 (pow (/ (* D M) (* d 2.0)) 2.0)))))
(if (<= d 3.85e+93)
(* t_4 (* t_2 (/ (sqrt d) (sqrt l))))
(* d (* (pow l -0.5) (pow h -0.5))))))))))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 * ((M / d) * 0.5);
double t_1 = sqrt(-d);
double t_2 = fma(-0.5, (t_0 / (l / (h * t_0))), 1.0);
double t_3 = (t_1 / sqrt(-h)) * (sqrt((d / l)) * t_2);
double t_4 = sqrt((d / h));
double tmp;
if (d <= -4e+107) {
tmp = t_3;
} else if (d <= -9.8e+57) {
tmp = t_4 * (t_2 * (t_1 / sqrt(-l)));
} else if (d <= -1.45e-173) {
tmp = t_3;
} else if (d <= 1.05e-293) {
tmp = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 + ((h / l) * (-0.5 * pow(((D * M) / (d * 2.0)), 2.0))));
} else if (d <= 3.85e+93) {
tmp = t_4 * (t_2 * (sqrt(d) / sqrt(l)));
} else {
tmp = d * (pow(l, -0.5) * pow(h, -0.5));
}
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(Float64(M / d) * 0.5)) t_1 = sqrt(Float64(-d)) t_2 = fma(-0.5, Float64(t_0 / Float64(l / Float64(h * t_0))), 1.0) t_3 = Float64(Float64(t_1 / sqrt(Float64(-h))) * Float64(sqrt(Float64(d / l)) * t_2)) t_4 = sqrt(Float64(d / h)) tmp = 0.0 if (d <= -4e+107) tmp = t_3; elseif (d <= -9.8e+57) tmp = Float64(t_4 * Float64(t_2 * Float64(t_1 / sqrt(Float64(-l))))); elseif (d <= -1.45e-173) tmp = t_3; elseif (d <= 1.05e-293) tmp = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(Float64(D * M) / Float64(d * 2.0)) ^ 2.0))))); elseif (d <= 3.85e+93) tmp = Float64(t_4 * Float64(t_2 * Float64(sqrt(d) / sqrt(l)))); else tmp = Float64(d * Float64((l ^ -0.5) * (h ^ -0.5))); 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[(M / d), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[(-0.5 * N[(t$95$0 / N[(l / N[(h * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -4e+107], t$95$3, If[LessEqual[d, -9.8e+57], N[(t$95$4 * N[(t$95$2 * N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.45e-173], t$95$3, If[LessEqual[d, 1.05e-293], N[(N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(N[(D * M), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.85e+93], N[(t$95$4 * N[(t$95$2 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Power[h, -0.5], $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 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\
t_1 := \sqrt{-d}\\
t_2 := \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\\
t_3 := \frac{t_1}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot t_2\right)\\
t_4 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;d \leq -4 \cdot 10^{+107}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;d \leq -9.8 \cdot 10^{+57}:\\
\;\;\;\;t_4 \cdot \left(t_2 \cdot \frac{t_1}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;d \leq -1.45 \cdot 10^{-173}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;d \leq 1.05 \cdot 10^{-293}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\
\mathbf{elif}\;d \leq 3.85 \cdot 10^{+93}:\\
\;\;\;\;t_4 \cdot \left(t_2 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)\\
\end{array}
if d < -3.9999999999999999e107 or -9.7999999999999998e57 < d < -1.4499999999999999e-173Initial program 63.4%
Simplified62.6%
[Start]63.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* [=>]63.1 | \[ \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 [=>]63.1 | \[ {\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 [=>]63.1 | \[ \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 [=>]63.1 | \[ \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 [=>]63.1 | \[ \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)
\] |
sub-neg [=>]63.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(1 + \left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)
\] |
+-commutative [=>]63.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(\left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) + 1\right)}\right)
\] |
associate-*l* [=>]63.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(-\color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right) + 1\right)\right)
\] |
distribute-lft-neg-in [=>]63.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\color{blue}{\left(-\frac{1}{2}\right) \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)} + 1\right)\right)
\] |
fma-def [=>]63.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\mathsf{fma}\left(-\frac{1}{2}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)}\right)
\] |
Applied egg-rr68.3%
[Start]62.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
|---|---|
associate-*r/ [=>]63.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{{\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot h}{\ell}}, 1\right)\right)
\] |
unpow2 [=>]63.9 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{\color{blue}{\left(\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot \left(D \cdot \frac{\frac{M}{d}}{2}\right)\right)} \cdot h}{\ell}, 1\right)\right)
\] |
associate-*l* [=>]66.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{\color{blue}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot \left(\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h\right)}}{\ell}, 1\right)\right)
\] |
associate-/l* [=>]68.3 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{D \cdot \frac{\frac{M}{d}}{2}}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}}, 1\right)\right)
\] |
div-inv [=>]68.3 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}, 1\right)\right)
\] |
metadata-eval [=>]68.3 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot \color{blue}{0.5}\right)}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}, 1\right)\right)
\] |
div-inv [=>]68.3 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{1}{2}\right)}\right) \cdot h}}, 1\right)\right)
\] |
metadata-eval [=>]68.3 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot \color{blue}{0.5}\right)\right) \cdot h}}, 1\right)\right)
\] |
Applied egg-rr79.9%
[Start]68.3 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
|---|---|
frac-2neg [=>]68.3 | \[ \sqrt{\color{blue}{\frac{-d}{-h}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
sqrt-div [=>]79.9 | \[ \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
if -3.9999999999999999e107 < d < -9.7999999999999998e57Initial program 71.5%
Simplified70.8%
[Start]71.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* [=>]71.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 [=>]71.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 [=>]71.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 [=>]71.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 [=>]71.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)
\] |
sub-neg [=>]71.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(1 + \left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)
\] |
+-commutative [=>]71.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(\left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) + 1\right)}\right)
\] |
associate-*l* [=>]71.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(-\color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right) + 1\right)\right)
\] |
distribute-lft-neg-in [=>]71.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\color{blue}{\left(-\frac{1}{2}\right) \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)} + 1\right)\right)
\] |
fma-def [=>]71.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\mathsf{fma}\left(-\frac{1}{2}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)}\right)
\] |
Applied egg-rr76.1%
[Start]70.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
|---|---|
associate-*r/ [=>]72.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{{\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot h}{\ell}}, 1\right)\right)
\] |
unpow2 [=>]72.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{\color{blue}{\left(\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot \left(D \cdot \frac{\frac{M}{d}}{2}\right)\right)} \cdot h}{\ell}, 1\right)\right)
\] |
associate-*l* [=>]74.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{\color{blue}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot \left(\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h\right)}}{\ell}, 1\right)\right)
\] |
associate-/l* [=>]76.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{D \cdot \frac{\frac{M}{d}}{2}}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}}, 1\right)\right)
\] |
div-inv [=>]76.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}, 1\right)\right)
\] |
metadata-eval [=>]76.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot \color{blue}{0.5}\right)}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}, 1\right)\right)
\] |
div-inv [=>]76.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{1}{2}\right)}\right) \cdot h}}, 1\right)\right)
\] |
metadata-eval [=>]76.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot \color{blue}{0.5}\right)\right) \cdot h}}, 1\right)\right)
\] |
Applied egg-rr81.6%
[Start]76.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
|---|---|
frac-2neg [=>]76.1 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\color{blue}{\frac{-d}{-\ell}}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
sqrt-div [=>]81.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
if -1.4499999999999999e-173 < d < 1.05000000000000003e-293Initial program 33.9%
if 1.05000000000000003e-293 < d < 3.85000000000000002e93Initial program 61.1%
Simplified59.5%
[Start]61.1 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
|---|---|
associate-*l* [=>]60.7 | \[ \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 [=>]60.7 | \[ {\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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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 [=>]60.7 | \[ \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)
\] |
sub-neg [=>]60.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(1 + \left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)}\right)
\] |
+-commutative [=>]60.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(\left(-\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) + 1\right)}\right)
\] |
associate-*l* [=>]60.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(-\color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right) + 1\right)\right)
\] |
distribute-lft-neg-in [=>]60.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\color{blue}{\left(-\frac{1}{2}\right) \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)} + 1\right)\right)
\] |
fma-def [=>]60.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\mathsf{fma}\left(-\frac{1}{2}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)}\right)
\] |
Applied egg-rr65.8%
[Start]59.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
|---|---|
associate-*r/ [=>]60.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{{\left(D \cdot \frac{\frac{M}{d}}{2}\right)}^{2} \cdot h}{\ell}}, 1\right)\right)
\] |
unpow2 [=>]60.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{\color{blue}{\left(\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot \left(D \cdot \frac{\frac{M}{d}}{2}\right)\right)} \cdot h}{\ell}, 1\right)\right)
\] |
associate-*l* [=>]63.3 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{\color{blue}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot \left(\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h\right)}}{\ell}, 1\right)\right)
\] |
associate-/l* [=>]65.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{D \cdot \frac{\frac{M}{d}}{2}}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}}, 1\right)\right)
\] |
div-inv [=>]65.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}, 1\right)\right)
\] |
metadata-eval [=>]65.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot \color{blue}{0.5}\right)}{\frac{\ell}{\left(D \cdot \frac{\frac{M}{d}}{2}\right) \cdot h}}, 1\right)\right)
\] |
div-inv [=>]65.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{1}{2}\right)}\right) \cdot h}}, 1\right)\right)
\] |
metadata-eval [=>]65.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot \color{blue}{0.5}\right)\right) \cdot h}}, 1\right)\right)
\] |
Applied egg-rr74.4%
[Start]65.8 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
|---|---|
sqrt-div [=>]74.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
div-inv [=>]74.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\left(\sqrt{d} \cdot \frac{1}{\sqrt{\ell}}\right)} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
Simplified74.4%
[Start]74.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\left(\sqrt{d} \cdot \frac{1}{\sqrt{\ell}}\right) \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
|---|---|
associate-*r/ [=>]74.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\color{blue}{\frac{\sqrt{d} \cdot 1}{\sqrt{\ell}}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
*-rgt-identity [=>]74.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right)
\] |
if 3.85000000000000002e93 < d Initial program 57.4%
Taylor expanded in d around inf 74.2%
Applied egg-rr33.0%
[Start]74.2 | \[ \sqrt{\frac{1}{\ell \cdot h}} \cdot d
\] |
|---|---|
expm1-log1p-u [=>]72.4 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{1}{\ell \cdot h}}\right)\right)} \cdot d
\] |
expm1-udef [=>]32.6 | \[ \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{1}{\ell \cdot h}}\right)} - 1\right)} \cdot d
\] |
inv-pow [=>]32.6 | \[ \left(e^{\mathsf{log1p}\left(\sqrt{\color{blue}{{\left(\ell \cdot h\right)}^{-1}}}\right)} - 1\right) \cdot d
\] |
metadata-eval [<=]32.6 | \[ \left(e^{\mathsf{log1p}\left(\sqrt{{\left(\ell \cdot h\right)}^{\color{blue}{\left(-1\right)}}}\right)} - 1\right) \cdot d
\] |
sqrt-pow1 [=>]33.0 | \[ \left(e^{\mathsf{log1p}\left(\color{blue}{{\left(\ell \cdot h\right)}^{\left(\frac{-1}{2}\right)}}\right)} - 1\right) \cdot d
\] |
metadata-eval [=>]33.0 | \[ \left(e^{\mathsf{log1p}\left({\left(\ell \cdot h\right)}^{\left(\frac{\color{blue}{-1}}{2}\right)}\right)} - 1\right) \cdot d
\] |
metadata-eval [=>]33.0 | \[ \left(e^{\mathsf{log1p}\left({\left(\ell \cdot h\right)}^{\color{blue}{-0.5}}\right)} - 1\right) \cdot d
\] |
Simplified74.5%
[Start]33.0 | \[ \left(e^{\mathsf{log1p}\left({\left(\ell \cdot h\right)}^{-0.5}\right)} - 1\right) \cdot d
\] |
|---|---|
expm1-def [=>]72.8 | \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(\ell \cdot h\right)}^{-0.5}\right)\right)} \cdot d
\] |
expm1-log1p [=>]74.5 | \[ \color{blue}{{\left(\ell \cdot h\right)}^{-0.5}} \cdot d
\] |
Applied egg-rr88.5%
[Start]74.5 | \[ {\left(\ell \cdot h\right)}^{-0.5} \cdot d
\] |
|---|---|
unpow-prod-down [=>]88.5 | \[ \color{blue}{\left({\ell}^{-0.5} \cdot {h}^{-0.5}\right)} \cdot d
\] |
Final simplification74.7%
| Alternative 1 | |
|---|---|
| Accuracy | 70.0% |
| Cost | 28248 |
| Alternative 2 | |
|---|---|
| Accuracy | 72.9% |
| Cost | 27984 |
| Alternative 3 | |
|---|---|
| Accuracy | 70.6% |
| Cost | 27540 |
| Alternative 4 | |
|---|---|
| Accuracy | 70.5% |
| Cost | 27540 |
| Alternative 5 | |
|---|---|
| Accuracy | 69.9% |
| Cost | 27408 |
| Alternative 6 | |
|---|---|
| Accuracy | 69.6% |
| Cost | 21584 |
| Alternative 7 | |
|---|---|
| Accuracy | 69.7% |
| Cost | 21584 |
| Alternative 8 | |
|---|---|
| Accuracy | 65.5% |
| Cost | 21400 |
| Alternative 9 | |
|---|---|
| Accuracy | 67.0% |
| Cost | 21268 |
| Alternative 10 | |
|---|---|
| Accuracy | 68.5% |
| Cost | 21004 |
| Alternative 11 | |
|---|---|
| Accuracy | 63.0% |
| Cost | 15184 |
| Alternative 12 | |
|---|---|
| Accuracy | 63.3% |
| Cost | 15184 |
| Alternative 13 | |
|---|---|
| Accuracy | 66.2% |
| Cost | 15184 |
| Alternative 14 | |
|---|---|
| Accuracy | 62.5% |
| Cost | 14920 |
| Alternative 15 | |
|---|---|
| Accuracy | 62.5% |
| Cost | 14920 |
| Alternative 16 | |
|---|---|
| Accuracy | 64.7% |
| Cost | 14920 |
| Alternative 17 | |
|---|---|
| Accuracy | 67.4% |
| Cost | 14920 |
| Alternative 18 | |
|---|---|
| Accuracy | 61.5% |
| Cost | 13380 |
| Alternative 19 | |
|---|---|
| Accuracy | 61.5% |
| Cost | 13252 |
| Alternative 20 | |
|---|---|
| Accuracy | 56.0% |
| Cost | 7108 |
| Alternative 21 | |
|---|---|
| Accuracy | 56.0% |
| Cost | 7044 |
| Alternative 22 | |
|---|---|
| Accuracy | 46.5% |
| Cost | 6980 |
| Alternative 23 | |
|---|---|
| Accuracy | 47.8% |
| Cost | 6980 |
| Alternative 24 | |
|---|---|
| Accuracy | 47.8% |
| Cost | 6980 |
| Alternative 25 | |
|---|---|
| Accuracy | 32.0% |
| Cost | 6720 |
herbie shell --seed 2023133
(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)))))