| Alternative 1 | |
|---|---|
| Error | 18.7 |
| 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)))))
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (- d)))
(t_2
(*
(+ 1.0 (* (* (pow (* (/ M 2.0) (/ D d)) 2.0) (/ h l)) -0.5))
(* t_0 (/ t_1 (sqrt (- l)))))))
(if (<= l -8.5e+194)
t_2
(if (<= l -8e+165)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= l -4.5e+136)
(*
(* (/ t_1 (sqrt (- h))) (sqrt (/ d l)))
(+ 1.0 (* (* (/ D d) (/ D d)) (* (/ (* M M) (/ l h)) -0.125))))
(if (<= l -2.2e+53)
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(+ 1.0 (/ (* (/ D d) (* M (* M -0.125))) (* (/ l h) (/ d D)))))
(if (<= l -5e-310)
t_2
(if (<= l 1.46e-64)
(*
(* t_0 (/ (sqrt d) (sqrt l)))
(+ 1.0 (* -0.5 (/ (* h (pow (* M (* 0.5 (/ D d))) 2.0)) l))))
(*
(/ d (sqrt l))
(*
(fma (pow (* 0.5 (/ D (/ d M))) 2.0) (* (/ h l) -0.5) 1.0)
(/ -1.0 (- (sqrt h)))))))))))))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 / h));
double t_1 = sqrt(-d);
double t_2 = (1.0 + ((pow(((M / 2.0) * (D / d)), 2.0) * (h / l)) * -0.5)) * (t_0 * (t_1 / sqrt(-l)));
double tmp;
if (l <= -8.5e+194) {
tmp = t_2;
} else if (l <= -8e+165) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (l <= -4.5e+136) {
tmp = ((t_1 / sqrt(-h)) * sqrt((d / l))) * (1.0 + (((D / d) * (D / d)) * (((M * M) / (l / h)) * -0.125)));
} else if (l <= -2.2e+53) {
tmp = (pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 + (((D / d) * (M * (M * -0.125))) / ((l / h) * (d / D))));
} else if (l <= -5e-310) {
tmp = t_2;
} else if (l <= 1.46e-64) {
tmp = (t_0 * (sqrt(d) / sqrt(l))) * (1.0 + (-0.5 * ((h * pow((M * (0.5 * (D / d))), 2.0)) / l)));
} else {
tmp = (d / sqrt(l)) * (fma(pow((0.5 * (D / (d / M))), 2.0), ((h / l) * -0.5), 1.0) * (-1.0 / -sqrt(h)));
}
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 / h)) t_1 = sqrt(Float64(-d)) t_2 = Float64(Float64(1.0 + Float64(Float64((Float64(Float64(M / 2.0) * Float64(D / d)) ^ 2.0) * Float64(h / l)) * -0.5)) * Float64(t_0 * Float64(t_1 / sqrt(Float64(-l))))) tmp = 0.0 if (l <= -8.5e+194) tmp = t_2; elseif (l <= -8e+165) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (l <= -4.5e+136) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * Float64(1.0 + Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(Float64(M * M) / Float64(l / h)) * -0.125)))); elseif (l <= -2.2e+53) tmp = Float64(Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)) * Float64(1.0 + Float64(Float64(Float64(D / d) * Float64(M * Float64(M * -0.125))) / Float64(Float64(l / h) * Float64(d / D))))); elseif (l <= -5e-310) tmp = t_2; elseif (l <= 1.46e-64) tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(l))) * Float64(1.0 + Float64(-0.5 * Float64(Float64(h * (Float64(M * Float64(0.5 * Float64(D / d))) ^ 2.0)) / l)))); else tmp = Float64(Float64(d / sqrt(l)) * Float64(fma((Float64(0.5 * Float64(D / Float64(d / M))) ^ 2.0), Float64(Float64(h / l) * -0.5), 1.0) * Float64(-1.0 / Float64(-sqrt(h))))); 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[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 + N[(N[(N[Power[N[(N[(M / 2.0), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -8.5e+194], t$95$2, If[LessEqual[l, -8e+165], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.5e+136], N[(N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.2e+53], 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[(N[(D / d), $MachinePrecision] * N[(M * N[(M * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(l / h), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], t$95$2, If[LessEqual[l, 1.46e-64], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.5 * N[(N[(h * N[Power[N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[N[(0.5 * N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-1.0 / (-N[Sqrt[h], $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 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{-d}\\
t_2 := \left(1 + \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right) \cdot -0.5\right) \cdot \left(t_0 \cdot \frac{t_1}{\sqrt{-\ell}}\right)\\
\mathbf{if}\;\ell \leq -8.5 \cdot 10^{+194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq -8 \cdot 10^{+165}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -4.5 \cdot 10^{+136}:\\
\;\;\;\;\left(\frac{t_1}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot -0.125\right)\right)\\
\mathbf{elif}\;\ell \leq -2.2 \cdot 10^{+53}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{\frac{D}{d} \cdot \left(M \cdot \left(M \cdot -0.125\right)\right)}{\frac{\ell}{h} \cdot \frac{d}{D}}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq 1.46 \cdot 10^{-64}:\\
\;\;\;\;\left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 + -0.5 \cdot \frac{h \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell}} \cdot \left(\mathsf{fma}\left({\left(0.5 \cdot \frac{D}{\frac{d}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \frac{-1}{-\sqrt{h}}\right)\\
\end{array}
if l < -8.50000000000000026e194 or -2.19999999999999999e53 < l < -4.999999999999985e-310Initial program 28.1
Simplified28.5
[Start]28.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)
\] |
|---|---|
metadata-eval [=>]28.1 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]28.1 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
metadata-eval [=>]28.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]28.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
associate-*l* [=>]28.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
metadata-eval [=>]28.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{0.5} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
times-frac [=>]28.5 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
Applied egg-rr23.8
if -8.50000000000000026e194 < l < -7.9999999999999992e165Initial program 26.0
Simplified26.6
[Start]26.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)
\] |
|---|---|
metadata-eval [=>]26.0 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]26.0 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
metadata-eval [=>]26.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]26.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
associate-*l* [=>]26.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
metadata-eval [=>]26.0 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{0.5} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
times-frac [=>]26.6 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
Applied egg-rr27.1
Taylor expanded in d around -inf 24.5
Simplified24.5
[Start]24.5 | \[ -1 \cdot \left(d \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)
\] |
|---|---|
associate-*r* [=>]24.5 | \[ \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}}
\] |
neg-mul-1 [<=]24.5 | \[ \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{\ell \cdot h}}
\] |
*-commutative [=>]24.5 | \[ \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)}
\] |
*-commutative [=>]24.5 | \[ \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot \left(-d\right)
\] |
if -7.9999999999999992e165 < l < -4.4999999999999999e136Initial program 28.8
Taylor expanded in M around 0 42.0
Simplified35.5
[Start]42.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 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}\right)
\] |
|---|---|
*-commutative [=>]42.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 - \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}} \cdot 0.125}\right)
\] |
*-commutative [=>]42.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 - \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{\ell \cdot {d}^{2}} \cdot 0.125\right)
\] |
*-commutative [<=]42.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 - \frac{{D}^{2} \cdot \color{blue}{\left({M}^{2} \cdot h\right)}}{\ell \cdot {d}^{2}} \cdot 0.125\right)
\] |
*-commutative [=>]42.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 - \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}} \cdot 0.125\right)
\] |
times-frac [=>]42.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 - \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)} \cdot 0.125\right)
\] |
associate-*l* [=>]42.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 - \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)}\right)
\] |
unpow2 [=>]42.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 - \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)\right)
\] |
unpow2 [=>]42.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 - \frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)\right)
\] |
times-frac [=>]37.8 | \[ \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 - \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)\right)
\] |
associate-/l* [=>]35.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{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}} \cdot 0.125\right)\right)
\] |
unpow2 [=>]35.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{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}} \cdot 0.125\right)\right)
\] |
Applied egg-rr52.0
Simplified35.5
[Start]52.0 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)} - 1\right)\right) \cdot \left(1 - \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot 0.125\right)\right)
\] |
|---|---|
expm1-def [=>]35.9 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)\right)}\right) \cdot \left(1 - \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot 0.125\right)\right)
\] |
expm1-log1p [=>]35.5 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{M \cdot M}{\frac{\ell}{h}} \cdot 0.125\right)\right)
\] |
Applied egg-rr29.2
if -4.4999999999999999e136 < l < -2.19999999999999999e53Initial program 22.1
Taylor expanded in M around 0 40.7
Simplified31.5
[Start]40.7 | \[ \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 - 0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}}\right)
\] |
|---|---|
*-commutative [=>]40.7 | \[ \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 - \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\ell \cdot {d}^{2}} \cdot 0.125}\right)
\] |
*-commutative [=>]40.7 | \[ \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 - \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{\ell \cdot {d}^{2}} \cdot 0.125\right)
\] |
*-commutative [<=]40.7 | \[ \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 - \frac{{D}^{2} \cdot \color{blue}{\left({M}^{2} \cdot h\right)}}{\ell \cdot {d}^{2}} \cdot 0.125\right)
\] |
*-commutative [=>]40.7 | \[ \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 - \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}} \cdot 0.125\right)
\] |
times-frac [=>]40.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 - \color{blue}{\left(\frac{{D}^{2}}{{d}^{2}} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)} \cdot 0.125\right)
\] |
associate-*l* [=>]40.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 - \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)}\right)
\] |
unpow2 [=>]40.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 - \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)\right)
\] |
unpow2 [=>]40.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 - \frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)\right)
\] |
times-frac [=>]32.2 | \[ \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 - \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(\frac{{M}^{2} \cdot h}{\ell} \cdot 0.125\right)\right)
\] |
associate-/l* [=>]31.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{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\color{blue}{\frac{{M}^{2}}{\frac{\ell}{h}}} \cdot 0.125\right)\right)
\] |
unpow2 [=>]31.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{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{\color{blue}{M \cdot M}}{\frac{\ell}{h}} \cdot 0.125\right)\right)
\] |
Applied egg-rr28.0
if -4.999999999999985e-310 < l < 1.46e-64Initial program 30.4
Simplified30.9
[Start]30.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)
\] |
|---|---|
metadata-eval [=>]30.4 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]30.4 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
metadata-eval [=>]30.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]30.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
associate-*l* [=>]30.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
metadata-eval [=>]30.4 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{0.5} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
times-frac [=>]30.9 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
Applied egg-rr25.0
Applied egg-rr13.2
Simplified13.1
[Start]13.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \left(\sqrt{d} \cdot \frac{1}{\sqrt{\ell}}\right)\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right)
\] |
|---|---|
associate-*r/ [=>]13.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d} \cdot 1}{\sqrt{\ell}}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right)
\] |
*-rgt-identity [=>]13.1 | \[ \left(\sqrt{\frac{d}{h}} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\ell}}\right) \cdot \left(1 - 0.5 \cdot \frac{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot h}{\ell}\right)
\] |
if 1.46e-64 < l Initial program 26.2
Simplified26.5
[Start]26.2 | \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
|---|---|
metadata-eval [=>]26.2 | \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]26.2 | \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
metadata-eval [=>]26.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
unpow1/2 [=>]26.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\] |
associate-*l* [=>]26.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{\frac{1}{2} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)
\] |
metadata-eval [=>]26.2 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \color{blue}{0.5} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
times-frac [=>]26.5 | \[ \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2} \cdot \frac{h}{\ell}\right)\right)
\] |
Applied egg-rr18.4
Simplified18.4
[Start]18.4 | \[ \frac{\sqrt{d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)\right)}{\sqrt{h}}
\] |
|---|---|
associate-*r* [=>]18.4 | \[ \frac{\color{blue}{\left(\sqrt{d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\right)}}{\sqrt{h}}
\] |
*-commutative [=>]18.4 | \[ \frac{\left(\sqrt{d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + \color{blue}{{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)}\right)}{\sqrt{h}}
\] |
*-commutative [=>]18.4 | \[ \frac{\left(\sqrt{d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \color{blue}{\left(\frac{h}{\ell} \cdot -0.5\right)}\right)}{\sqrt{h}}
\] |
Applied egg-rr15.7
Simplified15.0
[Start]15.7 | \[ \left(\frac{d}{\sqrt{\ell}} \cdot \left(-\mathsf{fma}\left({\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\right) \cdot \frac{1}{-\sqrt{h}}
\] |
|---|---|
associate-*l* [=>]15.2 | \[ \color{blue}{\frac{d}{\sqrt{\ell}} \cdot \left(\left(-\mathsf{fma}\left({\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right) \cdot \frac{1}{-\sqrt{h}}\right)}
\] |
associate-*r* [=>]15.2 | \[ \frac{d}{\sqrt{\ell}} \cdot \left(\left(-\mathsf{fma}\left({\color{blue}{\left(\left(\frac{D}{d} \cdot M\right) \cdot 0.5\right)}}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right) \cdot \frac{1}{-\sqrt{h}}\right)
\] |
*-commutative [=>]15.2 | \[ \frac{d}{\sqrt{\ell}} \cdot \left(\left(-\mathsf{fma}\left({\color{blue}{\left(0.5 \cdot \left(\frac{D}{d} \cdot M\right)\right)}}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right) \cdot \frac{1}{-\sqrt{h}}\right)
\] |
associate-*l/ [=>]14.9 | \[ \frac{d}{\sqrt{\ell}} \cdot \left(\left(-\mathsf{fma}\left({\left(0.5 \cdot \color{blue}{\frac{D \cdot M}{d}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right) \cdot \frac{1}{-\sqrt{h}}\right)
\] |
associate-/l* [=>]15.0 | \[ \frac{d}{\sqrt{\ell}} \cdot \left(\left(-\mathsf{fma}\left({\left(0.5 \cdot \color{blue}{\frac{D}{\frac{d}{M}}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right) \cdot \frac{1}{-\sqrt{h}}\right)
\] |
Final simplification19.7
| Alternative 1 | |
|---|---|
| Error | 18.7 |
| Cost | 33800 |
| Alternative 2 | |
|---|---|
| Error | 19.4 |
| Cost | 27796 |
| Alternative 3 | |
|---|---|
| Error | 19.5 |
| Cost | 27796 |
| Alternative 4 | |
|---|---|
| Error | 18.8 |
| Cost | 27596 |
| Alternative 5 | |
|---|---|
| Error | 18.7 |
| Cost | 27596 |
| Alternative 6 | |
|---|---|
| Error | 19.1 |
| Cost | 27532 |
| Alternative 7 | |
|---|---|
| Error | 20.5 |
| Cost | 27408 |
| Alternative 8 | |
|---|---|
| Error | 20.7 |
| Cost | 21392 |
| Alternative 9 | |
|---|---|
| Error | 23.4 |
| Cost | 21004 |
| Alternative 10 | |
|---|---|
| Error | 21.4 |
| Cost | 21004 |
| Alternative 11 | |
|---|---|
| Error | 20.5 |
| Cost | 21004 |
| Alternative 12 | |
|---|---|
| Error | 20.9 |
| Cost | 21004 |
| Alternative 13 | |
|---|---|
| Error | 20.5 |
| Cost | 21004 |
| Alternative 14 | |
|---|---|
| Error | 20.7 |
| Cost | 21004 |
| Alternative 15 | |
|---|---|
| Error | 24.9 |
| Cost | 15576 |
| Alternative 16 | |
|---|---|
| Error | 24.9 |
| Cost | 15184 |
| Alternative 17 | |
|---|---|
| Error | 23.4 |
| Cost | 15184 |
| Alternative 18 | |
|---|---|
| Error | 23.5 |
| Cost | 15052 |
| Alternative 19 | |
|---|---|
| Error | 24.7 |
| Cost | 14788 |
| Alternative 20 | |
|---|---|
| Error | 23.9 |
| Cost | 13512 |
| Alternative 21 | |
|---|---|
| Error | 23.8 |
| Cost | 13512 |
| Alternative 22 | |
|---|---|
| Error | 23.9 |
| Cost | 13448 |
| Alternative 23 | |
|---|---|
| Error | 23.9 |
| Cost | 13384 |
| Alternative 24 | |
|---|---|
| Error | 33.1 |
| Cost | 7244 |
| Alternative 25 | |
|---|---|
| Error | 27.6 |
| Cost | 7176 |
| Alternative 26 | |
|---|---|
| Error | 27.6 |
| Cost | 7176 |
| Alternative 27 | |
|---|---|
| Error | 34.9 |
| Cost | 6980 |
| Alternative 28 | |
|---|---|
| Error | 43.7 |
| Cost | 6784 |
| Alternative 29 | |
|---|---|
| Error | 43.7 |
| Cost | 6720 |
herbie shell --seed 2023039
(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)))))