| Alternative 1 | |
|---|---|
| Accuracy | 81.1% |
| Cost | 8272 |
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (/ (* M D) (* 2.0 d))))
(if (<= t_0 -5e+98)
(*
w0
(sqrt (+ 1.0 (/ (* D (* (/ M d) -0.25)) (* d (/ (/ (/ l h) M) D))))))
(if (<= t_0 2e+149)
(* w0 (sqrt (- 1.0 (/ h (* l (pow (* 2.0 (/ d (* M D))) 2.0))))))
(*
w0
(sqrt
(+
1.0
(* M (/ (* M (* (/ D d) -0.5)) (/ (/ 2.0 (/ h l)) (/ D d)))))))))))double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
double tmp;
if (t_0 <= -5e+98) {
tmp = w0 * sqrt((1.0 + ((D * ((M / d) * -0.25)) / (d * (((l / h) / M) / D)))));
} else if (t_0 <= 2e+149) {
tmp = w0 * sqrt((1.0 - (h / (l * pow((2.0 * (d / (M * D))), 2.0)))));
} else {
tmp = w0 * sqrt((1.0 + (M * ((M * ((D / d) * -0.5)) / ((2.0 / (h / l)) / (D / d))))));
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (m * d) / (2.0d0 * d_1)
if (t_0 <= (-5d+98)) then
tmp = w0 * sqrt((1.0d0 + ((d * ((m / d_1) * (-0.25d0))) / (d_1 * (((l / h) / m) / d)))))
else if (t_0 <= 2d+149) then
tmp = w0 * sqrt((1.0d0 - (h / (l * ((2.0d0 * (d_1 / (m * d))) ** 2.0d0)))))
else
tmp = w0 * sqrt((1.0d0 + (m * ((m * ((d / d_1) * (-0.5d0))) / ((2.0d0 / (h / l)) / (d / d_1))))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * D) / (2.0 * d);
double tmp;
if (t_0 <= -5e+98) {
tmp = w0 * Math.sqrt((1.0 + ((D * ((M / d) * -0.25)) / (d * (((l / h) / M) / D)))));
} else if (t_0 <= 2e+149) {
tmp = w0 * Math.sqrt((1.0 - (h / (l * Math.pow((2.0 * (d / (M * D))), 2.0)))));
} else {
tmp = w0 * Math.sqrt((1.0 + (M * ((M * ((D / d) * -0.5)) / ((2.0 / (h / l)) / (D / d))))));
}
return tmp;
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
def code(w0, M, D, h, l, d): t_0 = (M * D) / (2.0 * d) tmp = 0 if t_0 <= -5e+98: tmp = w0 * math.sqrt((1.0 + ((D * ((M / d) * -0.25)) / (d * (((l / h) / M) / D))))) elif t_0 <= 2e+149: tmp = w0 * math.sqrt((1.0 - (h / (l * math.pow((2.0 * (d / (M * D))), 2.0))))) else: tmp = w0 * math.sqrt((1.0 + (M * ((M * ((D / d) * -0.5)) / ((2.0 / (h / l)) / (D / d)))))) return tmp
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) tmp = 0.0 if (t_0 <= -5e+98) tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D * Float64(Float64(M / d) * -0.25)) / Float64(d * Float64(Float64(Float64(l / h) / M) / D)))))); elseif (t_0 <= 2e+149) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h / Float64(l * (Float64(2.0 * Float64(d / Float64(M * D))) ^ 2.0)))))); else tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(M * Float64(Float64(M * Float64(Float64(D / d) * -0.5)) / Float64(Float64(2.0 / Float64(h / l)) / Float64(D / d))))))); end return tmp end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = (M * D) / (2.0 * d); tmp = 0.0; if (t_0 <= -5e+98) tmp = w0 * sqrt((1.0 + ((D * ((M / d) * -0.25)) / (d * (((l / h) / M) / D))))); elseif (t_0 <= 2e+149) tmp = w0 * sqrt((1.0 - (h / (l * ((2.0 * (d / (M * D))) ^ 2.0))))); else tmp = w0 * sqrt((1.0 + (M * ((M * ((D / d) * -0.5)) / ((2.0 / (h / l)) / (D / d)))))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+98], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D * N[(N[(M / d), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * N[(N[(N[(l / h), $MachinePrecision] / M), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+149], N[(w0 * N[Sqrt[N[(1.0 - N[(h / N[(l * N[Power[N[(2.0 * N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(M * N[(N[(M * N[(N[(D / d), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 / N[(h / l), $MachinePrecision]), $MachinePrecision] / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{+98}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot \left(\frac{M}{d} \cdot -0.25\right)}{d \cdot \frac{\frac{\frac{\ell}{h}}{M}}{D}}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+149}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell \cdot {\left(2 \cdot \frac{d}{M \cdot D}\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + M \cdot \frac{M \cdot \left(\frac{D}{d} \cdot -0.5\right)}{\frac{\frac{2}{\frac{h}{\ell}}}{\frac{D}{d}}}}\\
\end{array}
Results
if (/.f64 (*.f64 M D) (*.f64 2 d)) < -4.9999999999999998e98Initial program 19.3%
Simplified20.4%
[Start]19.3 | \[ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\] |
|---|---|
associate-*l/ [<=]20.4 | \[ w0 \cdot \sqrt{1 - {\color{blue}{\left(\frac{M}{2 \cdot d} \cdot D\right)}}^{2} \cdot \frac{h}{\ell}}
\] |
*-commutative [=>]20.4 | \[ w0 \cdot \sqrt{1 - {\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right)}}^{2} \cdot \frac{h}{\ell}}
\] |
Applied egg-rr11.8%
[Start]20.4 | \[ w0 \cdot \sqrt{1 - {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\] |
|---|---|
associate-*r/ [=>]18.7 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}}
\] |
associate-/l* [=>]20.4 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}}
\] |
unpow2 [=>]20.4 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\left(D \cdot \frac{M}{2 \cdot d}\right) \cdot \left(D \cdot \frac{M}{2 \cdot d}\right)}}{\frac{\ell}{h}}}
\] |
associate-*r/ [=>]15.8 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{D \cdot M}{2 \cdot d}} \cdot \left(D \cdot \frac{M}{2 \cdot d}\right)}{\frac{\ell}{h}}}
\] |
associate-*r/ [=>]19.2 | \[ w0 \cdot \sqrt{1 - \frac{\frac{D \cdot M}{2 \cdot d} \cdot \color{blue}{\frac{D \cdot M}{2 \cdot d}}}{\frac{\ell}{h}}}
\] |
frac-times [=>]8.1 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\left(2 \cdot d\right) \cdot \left(2 \cdot d\right)}}}{\frac{\ell}{h}}}
\] |
associate-/l/ [=>]11.8 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{\ell}{h} \cdot \left(\left(2 \cdot d\right) \cdot \left(2 \cdot d\right)\right)}}}
\] |
*-commutative [=>]11.8 | \[ w0 \cdot \sqrt{1 - \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{\ell}{h} \cdot \left(\color{blue}{\left(d \cdot 2\right)} \cdot \left(2 \cdot d\right)\right)}}
\] |
*-commutative [=>]11.8 | \[ w0 \cdot \sqrt{1 - \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{\ell}{h} \cdot \left(\left(d \cdot 2\right) \cdot \color{blue}{\left(d \cdot 2\right)}\right)}}
\] |
swap-sqr [=>]11.8 | \[ w0 \cdot \sqrt{1 - \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{\ell}{h} \cdot \color{blue}{\left(\left(d \cdot d\right) \cdot \left(2 \cdot 2\right)\right)}}}
\] |
metadata-eval [=>]11.8 | \[ w0 \cdot \sqrt{1 - \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{\ell}{h} \cdot \left(\left(d \cdot d\right) \cdot \color{blue}{4}\right)}}
\] |
Simplified5.2%
[Start]11.8 | \[ w0 \cdot \sqrt{1 - \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{\ell}{h} \cdot \left(\left(d \cdot d\right) \cdot 4\right)}}
\] |
|---|---|
associate-/r* [=>]11.8 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{\ell}{h}}}{\left(d \cdot d\right) \cdot 4}}}
\] |
swap-sqr [=>]5.2 | \[ w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}}{\frac{\ell}{h}}}{\left(d \cdot d\right) \cdot 4}}
\] |
associate-*l* [=>]5.2 | \[ w0 \cdot \sqrt{1 - \frac{\frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{\ell}{h}}}{\color{blue}{d \cdot \left(d \cdot 4\right)}}}
\] |
Applied egg-rr18.9%
[Start]5.2 | \[ w0 \cdot \sqrt{1 - \frac{\frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{\ell}{h}}}{d \cdot \left(d \cdot 4\right)}}
\] |
|---|---|
associate-/l/ [=>]5.2 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\left(d \cdot \left(d \cdot 4\right)\right) \cdot \frac{\ell}{h}}}}
\] |
unswap-sqr [=>]11.8 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}}{\left(d \cdot \left(d \cdot 4\right)\right) \cdot \frac{\ell}{h}}}
\] |
times-frac [=>]18.9 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{D \cdot M}{d \cdot \left(d \cdot 4\right)} \cdot \frac{D \cdot M}{\frac{\ell}{h}}}}
\] |
Applied egg-rr29.8%
[Start]18.9 | \[ w0 \cdot \sqrt{1 - \frac{D \cdot M}{d \cdot \left(d \cdot 4\right)} \cdot \frac{D \cdot M}{\frac{\ell}{h}}}
\] |
|---|---|
associate-*r/ [=>]13.0 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{D \cdot M}{d \cdot \left(d \cdot 4\right)} \cdot \left(D \cdot M\right)}{\frac{\ell}{h}}}}
\] |
associate-/l* [=>]18.9 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{D \cdot M}{d \cdot \left(d \cdot 4\right)}}{\frac{\frac{\ell}{h}}{D \cdot M}}}}
\] |
times-frac [=>]16.2 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{D}{d} \cdot \frac{M}{d \cdot 4}}}{\frac{\frac{\ell}{h}}{D \cdot M}}}
\] |
associate-*l/ [=>]17.8 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{D \cdot \frac{M}{d \cdot 4}}{d}}}{\frac{\frac{\ell}{h}}{D \cdot M}}}
\] |
associate-/l/ [=>]25.8 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{D \cdot \frac{M}{d \cdot 4}}{\frac{\frac{\ell}{h}}{D \cdot M} \cdot d}}}
\] |
*-un-lft-identity [=>]25.8 | \[ w0 \cdot \sqrt{1 - \frac{D \cdot \frac{\color{blue}{1 \cdot M}}{d \cdot 4}}{\frac{\frac{\ell}{h}}{D \cdot M} \cdot d}}
\] |
*-commutative [=>]25.8 | \[ w0 \cdot \sqrt{1 - \frac{D \cdot \frac{1 \cdot M}{\color{blue}{4 \cdot d}}}{\frac{\frac{\ell}{h}}{D \cdot M} \cdot d}}
\] |
times-frac [=>]25.8 | \[ w0 \cdot \sqrt{1 - \frac{D \cdot \color{blue}{\left(\frac{1}{4} \cdot \frac{M}{d}\right)}}{\frac{\frac{\ell}{h}}{D \cdot M} \cdot d}}
\] |
metadata-eval [=>]25.8 | \[ w0 \cdot \sqrt{1 - \frac{D \cdot \left(\color{blue}{0.25} \cdot \frac{M}{d}\right)}{\frac{\frac{\ell}{h}}{D \cdot M} \cdot d}}
\] |
associate-/l/ [<=]29.8 | \[ w0 \cdot \sqrt{1 - \frac{D \cdot \left(0.25 \cdot \frac{M}{d}\right)}{\color{blue}{\frac{\frac{\frac{\ell}{h}}{M}}{D}} \cdot d}}
\] |
if -4.9999999999999998e98 < (/.f64 (*.f64 M D) (*.f64 2 d)) < 2.0000000000000001e149Initial program 90.4%
Applied egg-rr90.9%
[Start]90.4 | \[ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\] |
|---|---|
associate-*r/ [=>]96.1 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}}
\] |
associate-/l* [=>]91.2 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}}
\] |
unpow2 [=>]91.2 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}}
\] |
clear-num [=>]91.2 | \[ w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}}}{\frac{\ell}{h}}}
\] |
clear-num [=>]91.2 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{1}{\frac{2 \cdot d}{M \cdot D}}}{\frac{\ell}{h}}}
\] |
frac-times [=>]91.2 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{1 \cdot 1}{\frac{2 \cdot d}{M \cdot D} \cdot \frac{2 \cdot d}{M \cdot D}}}}{\frac{\ell}{h}}}
\] |
metadata-eval [=>]91.2 | \[ w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{1}}{\frac{2 \cdot d}{M \cdot D} \cdot \frac{2 \cdot d}{M \cdot D}}}{\frac{\ell}{h}}}
\] |
associate-/l/ [=>]91.2 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{\ell}{h} \cdot \left(\frac{2 \cdot d}{M \cdot D} \cdot \frac{2 \cdot d}{M \cdot D}\right)}}}
\] |
*-commutative [=>]91.2 | \[ w0 \cdot \sqrt{1 - \frac{1}{\frac{\ell}{h} \cdot \left(\frac{2 \cdot d}{\color{blue}{D \cdot M}} \cdot \frac{2 \cdot d}{M \cdot D}\right)}}
\] |
times-frac [=>]90.8 | \[ w0 \cdot \sqrt{1 - \frac{1}{\frac{\ell}{h} \cdot \left(\color{blue}{\left(\frac{2}{D} \cdot \frac{d}{M}\right)} \cdot \frac{2 \cdot d}{M \cdot D}\right)}}
\] |
*-commutative [=>]90.8 | \[ w0 \cdot \sqrt{1 - \frac{1}{\frac{\ell}{h} \cdot \left(\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \frac{2 \cdot d}{\color{blue}{D \cdot M}}\right)}}
\] |
times-frac [=>]90.9 | \[ w0 \cdot \sqrt{1 - \frac{1}{\frac{\ell}{h} \cdot \left(\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \color{blue}{\left(\frac{2}{D} \cdot \frac{d}{M}\right)}\right)}}
\] |
Applied egg-rr89.7%
[Start]90.9 | \[ w0 \cdot \sqrt{1 - \frac{1}{\frac{\ell}{h} \cdot \left(\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \left(\frac{2}{D} \cdot \frac{d}{M}\right)\right)}}
\] |
|---|---|
expm1-log1p-u [=>]90.5 | \[ w0 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{1 - \frac{1}{\frac{\ell}{h} \cdot \left(\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \left(\frac{2}{D} \cdot \frac{d}{M}\right)\right)}}\right)\right)}
\] |
expm1-udef [=>]90.5 | \[ w0 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{1 - \frac{1}{\frac{\ell}{h} \cdot \left(\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \left(\frac{2}{D} \cdot \frac{d}{M}\right)\right)}}\right)} - 1\right)}
\] |
associate-/r* [=>]89.7 | \[ w0 \cdot \left(e^{\mathsf{log1p}\left(\sqrt{1 - \color{blue}{\frac{\frac{1}{\frac{\ell}{h}}}{\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \left(\frac{2}{D} \cdot \frac{d}{M}\right)}}}\right)} - 1\right)
\] |
clear-num [<=]89.7 | \[ w0 \cdot \left(e^{\mathsf{log1p}\left(\sqrt{1 - \frac{\color{blue}{\frac{h}{\ell}}}{\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \left(\frac{2}{D} \cdot \frac{d}{M}\right)}}\right)} - 1\right)
\] |
pow2 [=>]89.7 | \[ w0 \cdot \left(e^{\mathsf{log1p}\left(\sqrt{1 - \frac{\frac{h}{\ell}}{\color{blue}{{\left(\frac{2}{D} \cdot \frac{d}{M}\right)}^{2}}}}\right)} - 1\right)
\] |
Simplified96.2%
[Start]89.7 | \[ w0 \cdot \left(e^{\mathsf{log1p}\left(\sqrt{1 - \frac{\frac{h}{\ell}}{{\left(\frac{2}{D} \cdot \frac{d}{M}\right)}^{2}}}\right)} - 1\right)
\] |
|---|---|
expm1-def [=>]89.7 | \[ w0 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{1 - \frac{\frac{h}{\ell}}{{\left(\frac{2}{D} \cdot \frac{d}{M}\right)}^{2}}}\right)\right)}
\] |
expm1-log1p [=>]90.1 | \[ w0 \cdot \color{blue}{\sqrt{1 - \frac{\frac{h}{\ell}}{{\left(\frac{2}{D} \cdot \frac{d}{M}\right)}^{2}}}}
\] |
associate-/r* [<=]95.9 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{h}{\ell \cdot {\left(\frac{2}{D} \cdot \frac{d}{M}\right)}^{2}}}}
\] |
times-frac [<=]96.2 | \[ w0 \cdot \sqrt{1 - \frac{h}{\ell \cdot {\color{blue}{\left(\frac{2 \cdot d}{D \cdot M}\right)}}^{2}}}
\] |
associate-*r/ [<=]96.2 | \[ w0 \cdot \sqrt{1 - \frac{h}{\ell \cdot {\color{blue}{\left(2 \cdot \frac{d}{D \cdot M}\right)}}^{2}}}
\] |
if 2.0000000000000001e149 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 0.6%
Applied egg-rr13.5%
[Start]0.6 | \[ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\] |
|---|---|
associate-*r/ [=>]0.0 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}}
\] |
associate-/l* [=>]0.6 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}}}
\] |
unpow2 [=>]0.6 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}}
\] |
associate-/l* [=>]0.2 | \[ w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \color{blue}{\frac{M}{\frac{2 \cdot d}{D}}}}{\frac{\ell}{h}}}
\] |
associate-*r/ [=>]0.2 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot M}{\frac{2 \cdot d}{D}}}}{\frac{\ell}{h}}}
\] |
associate-/l/ [=>]7.2 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot M}{\frac{\ell}{h} \cdot \frac{2 \cdot d}{D}}}}
\] |
associate-/l* [=>]13.7 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M}{\frac{2 \cdot d}{D}}} \cdot M}{\frac{\ell}{h} \cdot \frac{2 \cdot d}{D}}}
\] |
div-inv [=>]13.3 | \[ w0 \cdot \sqrt{1 - \frac{\color{blue}{\left(M \cdot \frac{1}{\frac{2 \cdot d}{D}}\right)} \cdot M}{\frac{\ell}{h} \cdot \frac{2 \cdot d}{D}}}
\] |
associate-/l* [=>]13.3 | \[ w0 \cdot \sqrt{1 - \frac{\left(M \cdot \frac{1}{\color{blue}{\frac{2}{\frac{D}{d}}}}\right) \cdot M}{\frac{\ell}{h} \cdot \frac{2 \cdot d}{D}}}
\] |
associate-/r/ [=>]13.3 | \[ w0 \cdot \sqrt{1 - \frac{\left(M \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{D}{d}\right)}\right) \cdot M}{\frac{\ell}{h} \cdot \frac{2 \cdot d}{D}}}
\] |
metadata-eval [=>]13.3 | \[ w0 \cdot \sqrt{1 - \frac{\left(M \cdot \left(\color{blue}{0.5} \cdot \frac{D}{d}\right)\right) \cdot M}{\frac{\ell}{h} \cdot \frac{2 \cdot d}{D}}}
\] |
*-un-lft-identity [=>]13.3 | \[ w0 \cdot \sqrt{1 - \frac{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot M}{\frac{\ell}{h} \cdot \frac{2 \cdot d}{\color{blue}{1 \cdot D}}}}
\] |
times-frac [=>]13.5 | \[ w0 \cdot \sqrt{1 - \frac{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot M}{\frac{\ell}{h} \cdot \color{blue}{\left(\frac{2}{1} \cdot \frac{d}{D}\right)}}}
\] |
metadata-eval [=>]13.5 | \[ w0 \cdot \sqrt{1 - \frac{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot M}{\frac{\ell}{h} \cdot \left(\color{blue}{2} \cdot \frac{d}{D}\right)}}
\] |
Applied egg-rr24.1%
[Start]13.5 | \[ w0 \cdot \sqrt{1 - \frac{\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot M}{\frac{\ell}{h} \cdot \left(2 \cdot \frac{d}{D}\right)}}
\] |
|---|---|
associate-/l* [=>]24.1 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\frac{\frac{\ell}{h} \cdot \left(2 \cdot \frac{d}{D}\right)}{M}}}}
\] |
associate-/r/ [=>]24.1 | \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\frac{\ell}{h} \cdot \left(2 \cdot \frac{d}{D}\right)} \cdot M}}
\] |
associate-*r* [=>]24.1 | \[ w0 \cdot \sqrt{1 - \frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\color{blue}{\left(\frac{\ell}{h} \cdot 2\right) \cdot \frac{d}{D}}} \cdot M}
\] |
clear-num [=>]24.1 | \[ w0 \cdot \sqrt{1 - \frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\left(\frac{\ell}{h} \cdot 2\right) \cdot \color{blue}{\frac{1}{\frac{D}{d}}}} \cdot M}
\] |
un-div-inv [=>]24.1 | \[ w0 \cdot \sqrt{1 - \frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\color{blue}{\frac{\frac{\ell}{h} \cdot 2}{\frac{D}{d}}}} \cdot M}
\] |
clear-num [=>]24.1 | \[ w0 \cdot \sqrt{1 - \frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\frac{\color{blue}{\frac{1}{\frac{h}{\ell}}} \cdot 2}{\frac{D}{d}}} \cdot M}
\] |
associate-*l/ [=>]24.1 | \[ w0 \cdot \sqrt{1 - \frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\frac{\color{blue}{\frac{1 \cdot 2}{\frac{h}{\ell}}}}{\frac{D}{d}}} \cdot M}
\] |
metadata-eval [=>]24.1 | \[ w0 \cdot \sqrt{1 - \frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\frac{\frac{\color{blue}{2}}{\frac{h}{\ell}}}{\frac{D}{d}}} \cdot M}
\] |
Final simplification86.2%
| Alternative 1 | |
|---|---|
| Accuracy | 81.1% |
| Cost | 8272 |
| Alternative 2 | |
|---|---|
| Accuracy | 84.0% |
| Cost | 8264 |
| Alternative 3 | |
|---|---|
| Accuracy | 77.9% |
| Cost | 8141 |
| Alternative 4 | |
|---|---|
| Accuracy | 79.3% |
| Cost | 64 |
herbie shell --seed 2023131
(FPCore (w0 M D h l d)
:name "Henrywood and Agarwal, Equation (9a)"
:precision binary64
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))