\[ \begin{array}{c}[M, D] = \mathsf{sort}([M, D])\\ \end{array} \]
\[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 -1 \cdot 10^{+115} \lor \neg \left(t_0 \leq 2 \cdot 10^{+137}\right):\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\ell}{M \cdot h}} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2}}{\ell}}\\
\end{array}
\]
(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 (or (<= t_0 -1e+115) (not (<= t_0 2e+137)))
(*
w0
(sqrt (+ 1.0 (* (/ M (* (* (/ d D) (/ d D)) (/ l (* M h)))) -0.25))))
(* w0 (sqrt (- 1.0 (/ (* h (pow (/ (* D (* M 0.5)) d) 2.0)) l)))))))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 <= -1e+115) || !(t_0 <= 2e+137)) {
tmp = w0 * sqrt((1.0 + ((M / (((d / D) * (d / D)) * (l / (M * h)))) * -0.25)));
} else {
tmp = w0 * sqrt((1.0 - ((h * pow(((D * (M * 0.5)) / d), 2.0)) / l)));
}
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 <= (-1d+115)) .or. (.not. (t_0 <= 2d+137))) then
tmp = w0 * sqrt((1.0d0 + ((m / (((d_1 / d) * (d_1 / d)) * (l / (m * h)))) * (-0.25d0))))
else
tmp = w0 * sqrt((1.0d0 - ((h * (((d * (m * 0.5d0)) / d_1) ** 2.0d0)) / l)))
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 <= -1e+115) || !(t_0 <= 2e+137)) {
tmp = w0 * Math.sqrt((1.0 + ((M / (((d / D) * (d / D)) * (l / (M * h)))) * -0.25)));
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow(((D * (M * 0.5)) / d), 2.0)) / l)));
}
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 <= -1e+115) or not (t_0 <= 2e+137):
tmp = w0 * math.sqrt((1.0 + ((M / (((d / D) * (d / D)) * (l / (M * h)))) * -0.25)))
else:
tmp = w0 * math.sqrt((1.0 - ((h * math.pow(((D * (M * 0.5)) / d), 2.0)) / l)))
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 <= -1e+115) || !(t_0 <= 2e+137))
tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(M / Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(l / Float64(M * h)))) * -0.25))));
else
tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(Float64(D * Float64(M * 0.5)) / d) ^ 2.0)) / l))));
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 <= -1e+115) || ~((t_0 <= 2e+137)))
tmp = w0 * sqrt((1.0 + ((M / (((d / D) * (d / D)) * (l / (M * h)))) * -0.25)));
else
tmp = w0 * sqrt((1.0 - ((h * (((D * (M * 0.5)) / d) ^ 2.0)) / l)));
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[Or[LessEqual[t$95$0, -1e+115], N[Not[LessEqual[t$95$0, 2e+137]], $MachinePrecision]], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(M / N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(l / N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $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 -1 \cdot 10^{+115} \lor \neg \left(t_0 \leq 2 \cdot 10^{+137}\right):\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\ell}{M \cdot h}} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{D \cdot \left(M \cdot 0.5\right)}{d}\right)}^{2}}{\ell}}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 10.1 |
|---|
| Cost | 14088 |
|---|
\[\begin{array}{l}
t_0 := \frac{M \cdot D}{d}\\
\mathbf{if}\;\ell \leq -4 \cdot 10^{+122}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{t_0 \cdot \frac{h \cdot \left(M \cdot D\right)}{\ell}}{d \cdot 4}}\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+136}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{t_0 \cdot \left(M \cdot \left(D \cdot \frac{h}{\ell}\right)\right)}{d \cdot 4}}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 15.3 |
|---|
| Cost | 8524 |
|---|
\[\begin{array}{l}
t_0 := w0 \cdot \sqrt{1 + \frac{M}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\ell}{M \cdot h}} \cdot -0.25}\\
\mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{+296}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-13}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(M \cdot D\right) \cdot \frac{M \cdot D}{\left(d \cdot d\right) \cdot \left(4 \cdot \frac{\ell}{h}\right)}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 10.7 |
|---|
| Cost | 8264 |
|---|
\[\begin{array}{l}
\mathbf{if}\;2 \cdot d \leq -2 \cdot 10^{+52}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M}{\frac{\ell}{D \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d \cdot 4}{M}\right)}}\\
\mathbf{elif}\;2 \cdot d \leq 5 \cdot 10^{+125}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot D\right)}{\ell}}{d \cdot 4}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 16.1 |
|---|
| Cost | 8141 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d \leq 1.18 \cdot 10^{-66} \lor \neg \left(d \leq 24000000\right) \land d \leq 5 \cdot 10^{+74}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\ell}{M \cdot h}} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 16.1 |
|---|
| Cost | 8140 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d \leq 1.3 \cdot 10^{-66}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\ell}{M \cdot h}} \cdot -0.25}\\
\mathbf{elif}\;d \leq 1.05 \cdot 10^{+15}:\\
\;\;\;\;w0\\
\mathbf{elif}\;d \leq 1.58 \cdot 10^{+71}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell \cdot \frac{d}{\frac{D}{d}}} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 12.4 |
|---|
| Cost | 8009 |
|---|
\[\begin{array}{l}
\mathbf{if}\;M \leq -1.9 \cdot 10^{-105} \lor \neg \left(M \leq 3.3 \cdot 10^{-155}\right):\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M}{\frac{\ell}{D \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d \cdot 4}{M}\right)}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 13.9 |
|---|
| Cost | 8008 |
|---|
\[\begin{array}{l}
t_0 := \frac{\ell}{D \cdot h}\\
\mathbf{if}\;d \leq -8.8 \cdot 10^{+21}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M}{t_0 \cdot \left(\frac{d}{D} \cdot \frac{d \cdot 4}{M}\right)}}\\
\mathbf{elif}\;d \leq 7.6 \cdot 10^{-123}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{d} \cdot \left(D \cdot \left(M \cdot \frac{h}{\ell}\right)\right)}{d \cdot 4}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot \left(\frac{M}{d \cdot d} \cdot \frac{D}{4}\right)}{t_0}}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 13.0 |
|---|
| Cost | 8004 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{-232}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot \frac{M \cdot D}{d}}{\left(d \cdot 4\right) \cdot \frac{\ell}{D \cdot h}}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 16.8 |
|---|
| Cost | 7876 |
|---|
\[\begin{array}{l}
\mathbf{if}\;d \leq 1.9 \cdot 10^{-125}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\ell}{M \cdot h}} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot \left(\frac{M}{d \cdot d} \cdot \frac{D}{4}\right)}{\frac{\ell}{D \cdot h}}}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 14.0 |
|---|
| Cost | 64 |
|---|
\[w0
\]