(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
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))))
(if (<= t_0 (- INFINITY))
(* D (* w0 (sqrt (* (* (/ h l) -0.25) (* (/ M d) (/ M d))))))
(if (<= t_0 1.6820622892440524e+307)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (* M (/ D (* 2.0 d))) 2.0)))))
(if (<= t_0 INFINITY)
(* w0 (* M (- (sqrt (* -0.25 (* (/ h l) (* (/ D d) (/ D d))))))))
(*
w0
(sqrt
(-
1.0
(/ (* (* M 0.5) (* h (/ (* M 0.5) (* l (/ d D))))) (/ 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 = w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = D * (w0 * sqrt((((h / l) * -0.25) * ((M / d) * (M / d)))));
} else if (t_0 <= 1.6820622892440524e+307) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow((M * (D / (2.0 * d))), 2.0))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = w0 * (M * -sqrt((-0.25 * ((h / l) * ((D / d) * (D / d))))));
} else {
tmp = w0 * sqrt((1.0 - (((M * 0.5) * (h * ((M * 0.5) / (l * (d / D))))) / (d / D))));
}
return tmp;
}
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 = w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = D * (w0 * Math.sqrt((((h / l) * -0.25) * ((M / d) * (M / d)))));
} else if (t_0 <= 1.6820622892440524e+307) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow((M * (D / (2.0 * d))), 2.0))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = w0 * (M * -Math.sqrt((-0.25 * ((h / l) * ((D / d) * (D / d))))));
} else {
tmp = w0 * Math.sqrt((1.0 - (((M * 0.5) * (h * ((M * 0.5) / (l * (d / D))))) / (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 = w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)))) tmp = 0 if t_0 <= -math.inf: tmp = D * (w0 * math.sqrt((((h / l) * -0.25) * ((M / d) * (M / d))))) elif t_0 <= 1.6820622892440524e+307: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow((M * (D / (2.0 * d))), 2.0)))) elif t_0 <= math.inf: tmp = w0 * (M * -math.sqrt((-0.25 * ((h / l) * ((D / d) * (D / d)))))) else: tmp = w0 * math.sqrt((1.0 - (((M * 0.5) * (h * ((M * 0.5) / (l * (d / D))))) / (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(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(D * Float64(w0 * sqrt(Float64(Float64(Float64(h / l) * -0.25) * Float64(Float64(M / d) * Float64(M / d)))))); elseif (t_0 <= 1.6820622892440524e+307) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(M * Float64(D / Float64(2.0 * d))) ^ 2.0))))); elseif (t_0 <= Inf) tmp = Float64(w0 * Float64(M * Float64(-sqrt(Float64(-0.25 * Float64(Float64(h / l) * Float64(Float64(D / d) * Float64(D / d)))))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(M * 0.5) * Float64(h * Float64(Float64(M * 0.5) / Float64(l * Float64(d / D))))) / 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 = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); tmp = 0.0; if (t_0 <= -Inf) tmp = D * (w0 * sqrt((((h / l) * -0.25) * ((M / d) * (M / d))))); elseif (t_0 <= 1.6820622892440524e+307) tmp = w0 * sqrt((1.0 - ((h / l) * ((M * (D / (2.0 * d))) ^ 2.0)))); elseif (t_0 <= Inf) tmp = w0 * (M * -sqrt((-0.25 * ((h / l) * ((D / d) * (D / d)))))); else tmp = w0 * sqrt((1.0 - (((M * 0.5) * (h * ((M * 0.5) / (l * (d / D))))) / (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[(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]}, If[LessEqual[t$95$0, (-Infinity)], N[(D * N[(w0 * N[Sqrt[N[(N[(N[(h / l), $MachinePrecision] * -0.25), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.6820622892440524e+307], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(M * N[(D / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(w0 * N[(M * (-N[Sqrt[N[(-0.25 * N[(N[(h / l), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(M * 0.5), $MachinePrecision] * N[(h * N[(N[(M * 0.5), $MachinePrecision] / N[(l * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $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 := w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;D \cdot \left(w0 \cdot \sqrt{\left(\frac{h}{\ell} \cdot -0.25\right) \cdot \left(\frac{M}{d} \cdot \frac{M}{d}\right)}\right)\\
\mathbf{elif}\;t_0 \leq 1.6820622892440524 \cdot 10^{+307}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(M \cdot \frac{D}{2 \cdot d}\right)}^{2}}\\
\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;w0 \cdot \left(M \cdot \left(-\sqrt{-0.25 \cdot \left(\frac{h}{\ell} \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{\left(M \cdot 0.5\right) \cdot \left(h \cdot \frac{M \cdot 0.5}{\ell \cdot \frac{d}{D}}\right)}{\frac{d}{D}}}\\
\end{array}



Bits error versus w0



Bits error versus M



Bits error versus D



Bits error versus h



Bits error versus l



Bits error versus d
Results
if (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < -inf.0Initial program 64.0
Simplified62.0
Taylor expanded in D around inf 55.0
Simplified46.3
if -inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < 1.6820622892440524e307Initial program 0.1
Simplified0.9
if 1.6820622892440524e307 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < +inf.0Initial program 63.4
Simplified61.8
Applied egg-rr58.2
Applied egg-rr57.4
Taylor expanded in M around -inf 58.3
Simplified50.0
if +inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) Initial program 64.0
Simplified60.9
Applied egg-rr23.6
Applied egg-rr23.6
Applied egg-rr15.0
Applied egg-rr8.2
Final simplification8.0
herbie shell --seed 2022151
(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))))))