
(FPCore (w0 M D h l d) :precision binary64 (* 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) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
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
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))));
}
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))))
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 tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); 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]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* 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) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
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
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))));
}
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))))
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 tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); 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]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 5e+210)
(* w0 (sqrt t_0))
(*
w0
(sqrt (- 1.0 (/ 0.25 (* l (/ (* d (/ d h)) (pow (* M D) 2.0))))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+210) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - (0.25 / (l * ((d * (d / h)) / pow((M * D), 2.0))))));
}
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
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 5d+210) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - (0.25d0 / (l * ((d_1 * (d_1 / h)) / ((m * d) ** 2.0d0))))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+210) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - (0.25 / (l * ((d * (d / h)) / Math.pow((M * D), 2.0))))));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 5e+210: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - (0.25 / (l * ((d * (d / h)) / math.pow((M * D), 2.0)))))) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 5e+210) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 / Float64(l * Float64(Float64(d * Float64(d / h)) / (Float64(M * D) ^ 2.0))))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= 5e+210) tmp = w0 * sqrt(t_0); else tmp = w0 * sqrt((1.0 - (0.25 / (l * ((d * (d / h)) / ((M * D) ^ 2.0)))))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+210], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 / N[(l * N[(N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision] / N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25}{\ell \cdot \frac{d \cdot \frac{d}{h}}{{\left(M \cdot D\right)}^{2}}}}\\
\end{array}
\end{array}
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 5e+210)
(* w0 (sqrt t_0))
(*
w0
(sqrt (- 1.0 (* (/ 0.25 l) (* (/ h d) (/ (pow (* M D) 2.0) d)))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+210) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - ((0.25 / l) * ((h / d) * (pow((M * D), 2.0) / 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
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 5d+210) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - ((0.25d0 / l) * ((h / d_1) * (((m * d) ** 2.0d0) / d_1)))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+210) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((0.25 / l) * ((h / d) * (Math.pow((M * D), 2.0) / d)))));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 5e+210: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - ((0.25 / l) * ((h / d) * (math.pow((M * D), 2.0) / d))))) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 5e+210) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 / l) * Float64(Float64(h / d) * Float64((Float64(M * D) ^ 2.0) / d)))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= 5e+210) tmp = w0 * sqrt(t_0); else tmp = w0 * sqrt((1.0 - ((0.25 / l) * ((h / d) * (((M * D) ^ 2.0) / d))))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+210], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 / l), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25}{\ell} \cdot \left(\frac{h}{d} \cdot \frac{{\left(M \cdot D\right)}^{2}}{d}\right)}\\
\end{array}
\end{array}
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 5e+210)
(* w0 (sqrt t_0))
(*
w0
(sqrt (- 1.0 (* (/ 0.25 l) (/ (* (pow (* M D) 2.0) (/ h d)) d))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+210) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - ((0.25 / l) * ((pow((M * D), 2.0) * (h / 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
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 5d+210) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - ((0.25d0 / l) * ((((m * d) ** 2.0d0) * (h / d_1)) / d_1))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+210) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((0.25 / l) * ((Math.pow((M * D), 2.0) * (h / d)) / d))));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 5e+210: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - ((0.25 / l) * ((math.pow((M * D), 2.0) * (h / d)) / d)))) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 5e+210) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 / l) * Float64(Float64((Float64(M * D) ^ 2.0) * Float64(h / d)) / d))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= 5e+210) tmp = w0 * sqrt(t_0); else tmp = w0 * sqrt((1.0 - ((0.25 / l) * ((((M * D) ^ 2.0) * (h / d)) / d)))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+210], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 / l), $MachinePrecision] * N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25}{\ell} \cdot \frac{{\left(M \cdot D\right)}^{2} \cdot \frac{h}{d}}{d}}\\
\end{array}
\end{array}
(FPCore (w0 M D h l d) :precision binary64 (let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))) (if (<= t_0 INFINITY) (* w0 (sqrt t_0)) w0)))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0;
}
return tmp;
}
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= math.inf: tmp = w0 * math.sqrt(t_0) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= Inf) tmp = Float64(w0 * sqrt(t_0)); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= Inf) tmp = w0 * sqrt(t_0); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, Infinity], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
(if (<= t_0 5e+256)
(* w0 (sqrt t_0))
(* w0 (sqrt (- 1.0 (/ (* h (pow (* M (* D (/ 0.5 d))) 2.0)) l)))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = 1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+256) {
tmp = w0 * sqrt(t_0);
} else {
tmp = w0 * sqrt((1.0 - ((h * pow((M * (D * (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
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))
if (t_0 <= 5d+256) then
tmp = w0 * sqrt(t_0)
else
tmp = w0 * sqrt((1.0d0 - ((h * ((m * (d * (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) {
double t_0 = 1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l));
double tmp;
if (t_0 <= 5e+256) {
tmp = w0 * Math.sqrt(t_0);
} else {
tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow((M * (D * (0.5 / d))), 2.0)) / l)));
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = 1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) tmp = 0 if t_0 <= 5e+256: tmp = w0 * math.sqrt(t_0) else: tmp = w0 * math.sqrt((1.0 - ((h * math.pow((M * (D * (0.5 / d))), 2.0)) / l))) return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))) tmp = 0.0 if (t_0 <= 5e+256) tmp = Float64(w0 * sqrt(t_0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(M * Float64(D * Float64(0.5 / d))) ^ 2.0)) / l)))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = 1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)); tmp = 0.0; if (t_0 <= 5e+256) tmp = w0 * sqrt(t_0); else tmp = w0 * sqrt((1.0 - ((h * ((M * (D * (0.5 / d))) ^ 2.0)) / l))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, 5e+256], N[(w0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+256}:\\
\;\;\;\;w0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}}{\ell}}\\
\end{array}
\end{array}
(FPCore (w0 M D h l d) :precision binary64 (if (<= (/ h l) -7.2e-287) (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* D (/ M (* 2.0 d))) 2.0))))) w0))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -7.2e-287) {
tmp = w0 * sqrt((1.0 - ((h / l) * pow((D * (M / (2.0 * d))), 2.0))));
} else {
tmp = w0;
}
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
real(8) :: tmp
if ((h / l) <= (-7.2d-287)) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * ((d * (m / (2.0d0 * d_1))) ** 2.0d0))))
else
tmp = w0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -7.2e-287) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow((D * (M / (2.0 * d))), 2.0))));
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -7.2e-287: tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow((D * (M / (2.0 * d))), 2.0)))) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -7.2e-287) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(D * Float64(M / Float64(2.0 * d))) ^ 2.0))))); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if ((h / l) <= -7.2e-287) tmp = w0 * sqrt((1.0 - ((h / l) * ((D * (M / (2.0 * d))) ^ 2.0)))); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -7.2e-287], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(D * N[(M / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -7.2 \cdot 10^{-287}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(D \cdot \frac{M}{2 \cdot d}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
(FPCore (w0 M D h l d) :precision binary64 (if (<= M 9.5e+52) w0 (log (exp w0))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9.5e+52) {
tmp = w0;
} else {
tmp = log(exp(w0));
}
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
real(8) :: tmp
if (m <= 9.5d+52) then
tmp = w0
else
tmp = log(exp(w0))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 9.5e+52) {
tmp = w0;
} else {
tmp = Math.log(Math.exp(w0));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if M <= 9.5e+52: tmp = w0 else: tmp = math.log(math.exp(w0)) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 9.5e+52) tmp = w0; else tmp = log(exp(w0)); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 9.5e+52) tmp = w0; else tmp = log(exp(w0)); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 9.5e+52], w0, N[Log[N[Exp[w0], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9.5 \cdot 10^{+52}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{w0}\right)\\
\end{array}
\end{array}
(FPCore (w0 M D h l d) :precision binary64 w0)
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
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
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
def code(w0, M, D, h, l, d): return w0
function code(w0, M, D, h, l, d) return w0 end
function tmp = code(w0, M, D, h, l, d) tmp = w0; end
code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
\\
w0
\end{array}
herbie shell --seed 2023342
(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))))))