| Alternative 1 | |
|---|---|
| Error | 18.3 |
| Cost | 89292 |
(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 (sqrt (- d)))
(t_1 (* D (* (/ M d) 0.5)))
(t_2 (fma -0.5 (/ t_1 (/ l (* h t_1))) 1.0))
(t_3 (* (sqrt (/ d l)) t_2)))
(if (<= d -1.45e+46)
(* (/ 1.0 (/ (sqrt (- h)) t_0)) t_3)
(if (<= d -2e-310)
(* (sqrt (/ d h)) (* t_2 (/ t_0 (sqrt (- l)))))
(if (<= d 1.15e-144)
(*
-0.125
(pow (* (* D (/ M (sqrt d))) (/ (pow h 0.25) (pow l 0.75))) 2.0))
(if (<= d 6.5e+191)
(* t_3 (/ (sqrt d) (sqrt h)))
(/ d (* (sqrt 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 = sqrt(-d);
double t_1 = D * ((M / d) * 0.5);
double t_2 = fma(-0.5, (t_1 / (l / (h * t_1))), 1.0);
double t_3 = sqrt((d / l)) * t_2;
double tmp;
if (d <= -1.45e+46) {
tmp = (1.0 / (sqrt(-h) / t_0)) * t_3;
} else if (d <= -2e-310) {
tmp = sqrt((d / h)) * (t_2 * (t_0 / sqrt(-l)));
} else if (d <= 1.15e-144) {
tmp = -0.125 * pow(((D * (M / sqrt(d))) * (pow(h, 0.25) / pow(l, 0.75))), 2.0);
} else if (d <= 6.5e+191) {
tmp = t_3 * (sqrt(d) / sqrt(h));
} else {
tmp = d / (sqrt(h) * 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 = sqrt(Float64(-d)) t_1 = Float64(D * Float64(Float64(M / d) * 0.5)) t_2 = fma(-0.5, Float64(t_1 / Float64(l / Float64(h * t_1))), 1.0) t_3 = Float64(sqrt(Float64(d / l)) * t_2) tmp = 0.0 if (d <= -1.45e+46) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(-h)) / t_0)) * t_3); elseif (d <= -2e-310) tmp = Float64(sqrt(Float64(d / h)) * Float64(t_2 * Float64(t_0 / sqrt(Float64(-l))))); elseif (d <= 1.15e-144) tmp = Float64(-0.125 * (Float64(Float64(D * Float64(M / sqrt(d))) * Float64((h ^ 0.25) / (l ^ 0.75))) ^ 2.0)); elseif (d <= 6.5e+191) tmp = Float64(t_3 * Float64(sqrt(d) / sqrt(h))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); 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[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(D * N[(N[(M / d), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.5 * N[(t$95$1 / N[(l / N[(h * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[d, -1.45e+46], N[(N[(1.0 / N[(N[Sqrt[(-h)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-144], N[(-0.125 * N[Power[N[(N[(D * N[(M / N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[h, 0.25], $MachinePrecision] / N[Power[l, 0.75], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.5e+191], N[(t$95$3 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $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 := \sqrt{-d}\\
t_1 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\
t_2 := \mathsf{fma}\left(-0.5, \frac{t_1}{\frac{\ell}{h \cdot t_1}}, 1\right)\\
t_3 := \sqrt{\frac{d}{\ell}} \cdot t_2\\
\mathbf{if}\;d \leq -1.45 \cdot 10^{+46}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{-h}}{t_0}} \cdot t_3\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_2 \cdot \frac{t_0}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-144}:\\
\;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\
\mathbf{elif}\;d \leq 6.5 \cdot 10^{+191}:\\
\;\;\;\;t_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
if d < -1.4500000000000001e46Initial program 24.4
Simplified24.2
[Start]24.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* [=>]24.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 [=>]24.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 [=>]24.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 [=>]24.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 [=>]24.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 [=>]24.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 [=>]24.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* [=>]24.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 [=>]24.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 [=>]24.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)
\] |
metadata-eval [=>]24.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-\color{blue}{0.5}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
metadata-eval [=>]24.5 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\color{blue}{-0.5}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
associate-*l/ [<=]24.2 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\color{blue}{\left(\frac{M}{2 \cdot d} \cdot D\right)}}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
*-commutative [=>]24.2 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
associate-/l/ [<=]24.2 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
Applied egg-rr22.3
Applied egg-rr21.2
Applied egg-rr9.7
if -1.4500000000000001e46 < d < -1.999999999999994e-310Initial program 28.6
Simplified29.4
[Start]28.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* [=>]28.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 [=>]28.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 [=>]28.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 [=>]28.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 [=>]28.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 [=>]28.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 [=>]28.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* [=>]28.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 [=>]28.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 [=>]28.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)
\] |
metadata-eval [=>]28.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-\color{blue}{0.5}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
metadata-eval [=>]28.7 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\color{blue}{-0.5}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
associate-*l/ [<=]29.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\color{blue}{\left(\frac{M}{2 \cdot d} \cdot D\right)}}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
*-commutative [=>]29.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
associate-/l/ [<=]29.4 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
Applied egg-rr25.4
Applied egg-rr18.9
if -1.999999999999994e-310 < d < 1.15e-144Initial program 40.4
Taylor expanded in d around 0 52.0
Simplified52.9
[Start]52.0 | \[ -0.125 \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)
\] |
|---|---|
associate-/l* [=>]52.9 | \[ -0.125 \cdot \left(\color{blue}{\frac{{D}^{2}}{\frac{d}{{M}^{2}}}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)
\] |
unpow2 [=>]52.9 | \[ -0.125 \cdot \left(\frac{\color{blue}{D \cdot D}}{\frac{d}{{M}^{2}}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)
\] |
unpow2 [=>]52.9 | \[ -0.125 \cdot \left(\frac{D \cdot D}{\frac{d}{\color{blue}{M \cdot M}}} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right)
\] |
Applied egg-rr43.0
Simplified34.2
[Start]43.0 | \[ -0.125 \cdot \left(e^{\mathsf{log1p}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot {\left(\frac{D}{\sqrt{d}} \cdot M\right)}^{2}\right)} - 1\right)
\] |
|---|---|
expm1-def [=>]36.5 | \[ -0.125 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot {\left(\frac{D}{\sqrt{d}} \cdot M\right)}^{2}\right)\right)}
\] |
expm1-log1p [=>]35.5 | \[ -0.125 \cdot \color{blue}{\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot {\left(\frac{D}{\sqrt{d}} \cdot M\right)}^{2}\right)}
\] |
associate-*l/ [=>]34.2 | \[ -0.125 \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot {\color{blue}{\left(\frac{D \cdot M}{\sqrt{d}}\right)}}^{2}\right)
\] |
Applied egg-rr22.3
if 1.15e-144 < d < 6.50000000000000008e191Initial program 19.9
Simplified20.6
[Start]19.9 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
|---|---|
associate-*l* [=>]20.2 | \[ \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 [=>]20.2 | \[ {\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 [=>]20.2 | \[ \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 [=>]20.2 | \[ \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 [=>]20.2 | \[ \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 [=>]20.2 | \[ \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 [=>]20.2 | \[ \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* [=>]20.2 | \[ \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 [=>]20.2 | \[ \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 [=>]20.2 | \[ \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)
\] |
metadata-eval [=>]20.2 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-\color{blue}{0.5}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
metadata-eval [=>]20.2 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\color{blue}{-0.5}, {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
associate-*l/ [<=]20.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\color{blue}{\left(\frac{M}{2 \cdot d} \cdot D\right)}}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
*-commutative [=>]20.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
associate-/l/ [<=]20.6 | \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right)
\] |
Applied egg-rr16.7
Applied egg-rr11.1
Simplified11.0
[Start]11.1 | \[ \left(\sqrt{d} \cdot \frac{1}{\sqrt{h}}\right) \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)
\] |
|---|---|
associate-*r/ [=>]11.0 | \[ \color{blue}{\frac{\sqrt{d} \cdot 1}{\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)
\] |
*-rgt-identity [=>]11.0 | \[ \frac{\color{blue}{\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 6.50000000000000008e191 < d Initial program 30.0
Taylor expanded in d around inf 15.4
Simplified15.0
[Start]15.4 | \[ \sqrt{\frac{1}{\ell \cdot h}} \cdot d
\] |
|---|---|
*-commutative [=>]15.4 | \[ \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}}
\] |
associate-/l/ [<=]15.0 | \[ d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}
\] |
Applied egg-rr14.8
Simplified4.8
[Start]14.8 | \[ \frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}
\] |
|---|---|
associate-/l/ [=>]4.8 | \[ \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}}
\] |
Final simplification13.7
| Alternative 1 | |
|---|---|
| Error | 18.3 |
| Cost | 89292 |
| Alternative 2 | |
|---|---|
| Error | 15.8 |
| Cost | 27984 |
| Alternative 3 | |
|---|---|
| Error | 14.2 |
| Cost | 27984 |
| Alternative 4 | |
|---|---|
| Error | 13.7 |
| Cost | 27984 |
| Alternative 5 | |
|---|---|
| Error | 16.7 |
| Cost | 27528 |
| Alternative 6 | |
|---|---|
| Error | 19.1 |
| Cost | 27024 |
| Alternative 7 | |
|---|---|
| Error | 20.2 |
| Cost | 26960 |
| Alternative 8 | |
|---|---|
| Error | 20.7 |
| Cost | 21716 |
| Alternative 9 | |
|---|---|
| Error | 20.4 |
| Cost | 21452 |
| Alternative 10 | |
|---|---|
| Error | 25.3 |
| Cost | 21136 |
| Alternative 11 | |
|---|---|
| Error | 20.9 |
| Cost | 21060 |
| Alternative 12 | |
|---|---|
| Error | 21.0 |
| Cost | 21000 |
| Alternative 13 | |
|---|---|
| Error | 27.4 |
| Cost | 20872 |
| Alternative 14 | |
|---|---|
| Error | 21.9 |
| Cost | 20872 |
| Alternative 15 | |
|---|---|
| Error | 21.4 |
| Cost | 20872 |
| Alternative 16 | |
|---|---|
| Error | 27.4 |
| Cost | 15056 |
| Alternative 17 | |
|---|---|
| Error | 27.0 |
| Cost | 14924 |
| Alternative 18 | |
|---|---|
| Error | 26.9 |
| Cost | 14600 |
| Alternative 19 | |
|---|---|
| Error | 26.6 |
| Cost | 14348 |
| Alternative 20 | |
|---|---|
| Error | 26.2 |
| Cost | 13380 |
| Alternative 21 | |
|---|---|
| Error | 29.8 |
| Cost | 13252 |
| Alternative 22 | |
|---|---|
| Error | 33.4 |
| Cost | 7113 |
| Alternative 23 | |
|---|---|
| Error | 35.9 |
| Cost | 6980 |
| Alternative 24 | |
|---|---|
| Error | 44.0 |
| Cost | 6720 |
| Alternative 25 | |
|---|---|
| Error | 61.5 |
| Cost | 64 |
herbie shell --seed 2023002
(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)))))