
(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 10 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}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (* 0.5 (/ M_m (/ d D))) (* (/ (* M_m (/ D d)) (* 2.0 l)) h))))))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - ((0.5 * (M_m / (d / D))) * (((M_m * (D / d)) / (2.0 * l)) * h))));
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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 - ((0.5d0 * (m_m / (d_1 / d))) * (((m_m * (d / d_1)) / (2.0d0 * l)) * h))))
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - ((0.5 * (M_m / (d / D))) * (((M_m * (D / d)) / (2.0 * l)) * h))));
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): return w0 * math.sqrt((1.0 - ((0.5 * (M_m / (d / D))) * (((M_m * (D / d)) / (2.0 * l)) * h))))
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.5 * Float64(M_m / Float64(d / D))) * Float64(Float64(Float64(M_m * Float64(D / d)) / Float64(2.0 * l)) * h))))) end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp = code(w0, M_m, D, h, l, d)
tmp = w0 * sqrt((1.0 - ((0.5 * (M_m / (d / D))) * (((M_m * (D / d)) / (2.0 * l)) * h))));
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.5 * N[(M$95$m / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(D / d), $MachinePrecision]), $MachinePrecision] / N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
w0 \cdot \sqrt{1 - \left(0.5 \cdot \frac{M_m}{\frac{d}{D}}\right) \cdot \left(\frac{M_m \cdot \frac{D}{d}}{2 \cdot \ell} \cdot h\right)}
\end{array}
M_m = (fabs.f64 M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D h l d)
:precision binary64
(let* ((t_0 (/ D (/ d M_m))))
(if (<= (/ h l) 2e+40)
(* w0 (sqrt (- 1.0 (* t_0 (/ t_0 (* (/ l h) 4.0))))))
w0)))M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D / (d / M_m);
double tmp;
if ((h / l) <= 2e+40) {
tmp = w0 * sqrt((1.0 - (t_0 * (t_0 / ((l / h) * 4.0)))));
} else {
tmp = w0;
}
return tmp;
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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 = d / (d_1 / m_m)
if ((h / l) <= 2d+40) then
tmp = w0 * sqrt((1.0d0 - (t_0 * (t_0 / ((l / h) * 4.0d0)))))
else
tmp = w0
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D / (d / M_m);
double tmp;
if ((h / l) <= 2e+40) {
tmp = w0 * Math.sqrt((1.0 - (t_0 * (t_0 / ((l / h) * 4.0)))));
} else {
tmp = w0;
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): t_0 = D / (d / M_m) tmp = 0 if (h / l) <= 2e+40: tmp = w0 * math.sqrt((1.0 - (t_0 * (t_0 / ((l / h) * 4.0))))) else: tmp = w0 return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) t_0 = Float64(D / Float64(d / M_m)) tmp = 0.0 if (Float64(h / l) <= 2e+40) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(t_0 * Float64(t_0 / Float64(Float64(l / h) * 4.0)))))); else tmp = w0; end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
t_0 = D / (d / M_m);
tmp = 0.0;
if ((h / l) <= 2e+40)
tmp = w0 * sqrt((1.0 - (t_0 * (t_0 / ((l / h) * 4.0)))));
else
tmp = w0;
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D / N[(d / M$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(h / l), $MachinePrecision], 2e+40], N[(w0 * N[Sqrt[N[(1.0 - N[(t$95$0 * N[(t$95$0 / N[(N[(l / h), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
t_0 := \frac{D}{\frac{d}{M_m}}\\
\mathbf{if}\;\frac{h}{\ell} \leq 2 \cdot 10^{+40}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t_0 \cdot \frac{t_0}{\frac{\ell}{h} \cdot 4}}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (let* ((t_0 (* M_m (/ D d)))) (* w0 (sqrt (- 1.0 (* (* (/ t_0 (* 2.0 l)) h) (* 0.5 t_0)))))))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = M_m * (D / d);
return w0 * sqrt((1.0 - (((t_0 / (2.0 * l)) * h) * (0.5 * t_0))));
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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
t_0 = m_m * (d / d_1)
code = w0 * sqrt((1.0d0 - (((t_0 / (2.0d0 * l)) * h) * (0.5d0 * t_0))))
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = M_m * (D / d);
return w0 * Math.sqrt((1.0 - (((t_0 / (2.0 * l)) * h) * (0.5 * t_0))));
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): t_0 = M_m * (D / d) return w0 * math.sqrt((1.0 - (((t_0 / (2.0 * l)) * h) * (0.5 * t_0))))
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) t_0 = Float64(M_m * Float64(D / d)) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(t_0 / Float64(2.0 * l)) * h) * Float64(0.5 * t_0))))) end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp = code(w0, M_m, D, h, l, d)
t_0 = M_m * (D / d);
tmp = w0 * sqrt((1.0 - (((t_0 / (2.0 * l)) * h) * (0.5 * t_0))));
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(M$95$m * N[(D / d), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(t$95$0 / N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
t_0 := M_m \cdot \frac{D}{d}\\
w0 \cdot \sqrt{1 - \left(\frac{t_0}{2 \cdot \ell} \cdot h\right) \cdot \left(0.5 \cdot t_0\right)}
\end{array}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (if (<= (/ h l) -4e-249) (+ w0 (* -0.125 (* (* w0 h) (/ (pow (* D (/ M_m d)) 2.0) l)))) w0))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -4e-249) {
tmp = w0 + (-0.125 * ((w0 * h) * (pow((D * (M_m / d)), 2.0) / l)));
} else {
tmp = w0;
}
return tmp;
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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) <= (-4d-249)) then
tmp = w0 + ((-0.125d0) * ((w0 * h) * (((d * (m_m / d_1)) ** 2.0d0) / l)))
else
tmp = w0
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -4e-249) {
tmp = w0 + (-0.125 * ((w0 * h) * (Math.pow((D * (M_m / d)), 2.0) / l)));
} else {
tmp = w0;
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): tmp = 0 if (h / l) <= -4e-249: tmp = w0 + (-0.125 * ((w0 * h) * (math.pow((D * (M_m / d)), 2.0) / l))) else: tmp = w0 return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -4e-249) tmp = Float64(w0 + Float64(-0.125 * Float64(Float64(w0 * h) * Float64((Float64(D * Float64(M_m / d)) ^ 2.0) / l)))); else tmp = w0; end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -4e-249)
tmp = w0 + (-0.125 * ((w0 * h) * (((D * (M_m / d)) ^ 2.0) / l)));
else
tmp = w0;
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -4e-249], N[(w0 + N[(-0.125 * N[(N[(w0 * h), $MachinePrecision] * N[(N[Power[N[(D * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -4 \cdot 10^{-249}:\\
\;\;\;\;w0 + -0.125 \cdot \left(\left(w0 \cdot h\right) \cdot \frac{{\left(D \cdot \frac{M_m}{d}\right)}^{2}}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (if (<= (/ h l) -4e-249) (+ w0 (* -0.125 (/ (* (pow (* M_m (/ D d)) 2.0) (* w0 h)) l))) w0))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -4e-249) {
tmp = w0 + (-0.125 * ((pow((M_m * (D / d)), 2.0) * (w0 * h)) / l));
} else {
tmp = w0;
}
return tmp;
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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) <= (-4d-249)) then
tmp = w0 + ((-0.125d0) * ((((m_m * (d / d_1)) ** 2.0d0) * (w0 * h)) / l))
else
tmp = w0
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -4e-249) {
tmp = w0 + (-0.125 * ((Math.pow((M_m * (D / d)), 2.0) * (w0 * h)) / l));
} else {
tmp = w0;
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): tmp = 0 if (h / l) <= -4e-249: tmp = w0 + (-0.125 * ((math.pow((M_m * (D / d)), 2.0) * (w0 * h)) / l)) else: tmp = w0 return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -4e-249) tmp = Float64(w0 + Float64(-0.125 * Float64(Float64((Float64(M_m * Float64(D / d)) ^ 2.0) * Float64(w0 * h)) / l))); else tmp = w0; end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -4e-249)
tmp = w0 + (-0.125 * ((((M_m * (D / d)) ^ 2.0) * (w0 * h)) / l));
else
tmp = w0;
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -4e-249], N[(w0 + N[(-0.125 * N[(N[(N[Power[N[(M$95$m * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(w0 * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -4 \cdot 10^{-249}:\\
\;\;\;\;w0 + -0.125 \cdot \frac{{\left(M_m \cdot \frac{D}{d}\right)}^{2} \cdot \left(w0 \cdot h\right)}{\ell}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (- w0 (* -0.125 (/ w0 (/ (/ (- l) (pow (* M_m (/ D d)) 2.0)) h)))))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 - (-0.125 * (w0 / ((-l / pow((M_m * (D / d)), 2.0)) / h)));
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 - ((-0.125d0) * (w0 / ((-l / ((m_m * (d / d_1)) ** 2.0d0)) / h)))
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 - (-0.125 * (w0 / ((-l / Math.pow((M_m * (D / d)), 2.0)) / h)));
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): return w0 - (-0.125 * (w0 / ((-l / math.pow((M_m * (D / d)), 2.0)) / h)))
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) return Float64(w0 - Float64(-0.125 * Float64(w0 / Float64(Float64(Float64(-l) / (Float64(M_m * Float64(D / d)) ^ 2.0)) / h)))) end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp = code(w0, M_m, D, h, l, d)
tmp = w0 - (-0.125 * (w0 / ((-l / ((M_m * (D / d)) ^ 2.0)) / h)));
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := N[(w0 - N[(-0.125 * N[(w0 / N[(N[((-l) / N[Power[N[(M$95$m * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
w0 - -0.125 \cdot \frac{w0}{\frac{\frac{-\ell}{{\left(M_m \cdot \frac{D}{d}\right)}^{2}}}{h}}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (if (<= D 5.5e+89) w0 (+ w0 (* -0.125 (* (/ h (/ l w0)) (* (/ D d) (* M_m (/ D (/ d M_m)))))))))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if (D <= 5.5e+89) {
tmp = w0;
} else {
tmp = w0 + (-0.125 * ((h / (l / w0)) * ((D / d) * (M_m * (D / (d / M_m))))));
}
return tmp;
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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 (d <= 5.5d+89) then
tmp = w0
else
tmp = w0 + ((-0.125d0) * ((h / (l / w0)) * ((d / d_1) * (m_m * (d / (d_1 / m_m))))))
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if (D <= 5.5e+89) {
tmp = w0;
} else {
tmp = w0 + (-0.125 * ((h / (l / w0)) * ((D / d) * (M_m * (D / (d / M_m))))));
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): tmp = 0 if D <= 5.5e+89: tmp = w0 else: tmp = w0 + (-0.125 * ((h / (l / w0)) * ((D / d) * (M_m * (D / (d / M_m)))))) return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) tmp = 0.0 if (D <= 5.5e+89) tmp = w0; else tmp = Float64(w0 + Float64(-0.125 * Float64(Float64(h / Float64(l / w0)) * Float64(Float64(D / d) * Float64(M_m * Float64(D / Float64(d / M_m))))))); end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
tmp = 0.0;
if (D <= 5.5e+89)
tmp = w0;
else
tmp = w0 + (-0.125 * ((h / (l / w0)) * ((D / d) * (M_m * (D / (d / M_m))))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[D, 5.5e+89], w0, N[(w0 + N[(-0.125 * N[(N[(h / N[(l / w0), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(M$95$m * N[(D / N[(d / M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;D \leq 5.5 \cdot 10^{+89}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 + -0.125 \cdot \left(\frac{h}{\frac{\ell}{w0}} \cdot \left(\frac{D}{d} \cdot \left(M_m \cdot \frac{D}{\frac{d}{M_m}}\right)\right)\right)\\
\end{array}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (let* ((t_0 (/ D (/ d M_m)))) (if (<= D 7.4e+89) w0 (+ w0 (* -0.125 (* (* t_0 t_0) (/ h (/ l w0))))))))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D / (d / M_m);
double tmp;
if (D <= 7.4e+89) {
tmp = w0;
} else {
tmp = w0 + (-0.125 * ((t_0 * t_0) * (h / (l / w0))));
}
return tmp;
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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 = d / (d_1 / m_m)
if (d <= 7.4d+89) then
tmp = w0
else
tmp = w0 + ((-0.125d0) * ((t_0 * t_0) * (h / (l / w0))))
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D / (d / M_m);
double tmp;
if (D <= 7.4e+89) {
tmp = w0;
} else {
tmp = w0 + (-0.125 * ((t_0 * t_0) * (h / (l / w0))));
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): t_0 = D / (d / M_m) tmp = 0 if D <= 7.4e+89: tmp = w0 else: tmp = w0 + (-0.125 * ((t_0 * t_0) * (h / (l / w0)))) return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) t_0 = Float64(D / Float64(d / M_m)) tmp = 0.0 if (D <= 7.4e+89) tmp = w0; else tmp = Float64(w0 + Float64(-0.125 * Float64(Float64(t_0 * t_0) * Float64(h / Float64(l / w0))))); end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
t_0 = D / (d / M_m);
tmp = 0.0;
if (D <= 7.4e+89)
tmp = w0;
else
tmp = w0 + (-0.125 * ((t_0 * t_0) * (h / (l / w0))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D / N[(d / M$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, 7.4e+89], w0, N[(w0 + N[(-0.125 * N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[(h / N[(l / w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
t_0 := \frac{D}{\frac{d}{M_m}}\\
\mathbf{if}\;D \leq 7.4 \cdot 10^{+89}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 + -0.125 \cdot \left(\left(t_0 \cdot t_0\right) \cdot \frac{h}{\frac{\ell}{w0}}\right)\\
\end{array}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 (let* ((t_0 (/ D (/ d M_m)))) (if (<= D 2.9e+89) w0 (+ w0 (* -0.125 (* t_0 (* t_0 (* w0 (/ h l)))))))))
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D / (d / M_m);
double tmp;
if (D <= 2.9e+89) {
tmp = w0;
} else {
tmp = w0 + (-0.125 * (t_0 * (t_0 * (w0 * (h / l)))));
}
return tmp;
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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 = d / (d_1 / m_m)
if (d <= 2.9d+89) then
tmp = w0
else
tmp = w0 + ((-0.125d0) * (t_0 * (t_0 * (w0 * (h / l)))))
end if
code = tmp
end function
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D / (d / M_m);
double tmp;
if (D <= 2.9e+89) {
tmp = w0;
} else {
tmp = w0 + (-0.125 * (t_0 * (t_0 * (w0 * (h / l)))));
}
return tmp;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): t_0 = D / (d / M_m) tmp = 0 if D <= 2.9e+89: tmp = w0 else: tmp = w0 + (-0.125 * (t_0 * (t_0 * (w0 * (h / l))))) return tmp
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) t_0 = Float64(D / Float64(d / M_m)) tmp = 0.0 if (D <= 2.9e+89) tmp = w0; else tmp = Float64(w0 + Float64(-0.125 * Float64(t_0 * Float64(t_0 * Float64(w0 * Float64(h / l)))))); end return tmp end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp_2 = code(w0, M_m, D, h, l, d)
t_0 = D / (d / M_m);
tmp = 0.0;
if (D <= 2.9e+89)
tmp = w0;
else
tmp = w0 + (-0.125 * (t_0 * (t_0 * (w0 * (h / l)))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D / N[(d / M$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, 2.9e+89], w0, N[(w0 + N[(-0.125 * N[(t$95$0 * N[(t$95$0 * N[(w0 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
\begin{array}{l}
t_0 := \frac{D}{\frac{d}{M_m}}\\
\mathbf{if}\;D \leq 2.9 \cdot 10^{+89}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 + -0.125 \cdot \left(t_0 \cdot \left(t_0 \cdot \left(w0 \cdot \frac{h}{\ell}\right)\right)\right)\\
\end{array}
\end{array}
M_m = (fabs.f64 M) NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D h l d) :precision binary64 w0)
M_m = fabs(M);
assert(w0 < M_m && M_m < D && D < h && h < l && l < d);
double code(double w0, double M_m, double D, double h, double l, double d) {
return w0;
}
M_m = abs(M)
NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m_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
M_m = Math.abs(M);
assert w0 < M_m && M_m < D && D < h && h < l && l < d;
public static double code(double w0, double M_m, double D, double h, double l, double d) {
return w0;
}
M_m = math.fabs(M) [w0, M_m, D, h, l, d] = sort([w0, M_m, D, h, l, d]) def code(w0, M_m, D, h, l, d): return w0
M_m = abs(M) w0, M_m, D, h, l, d = sort([w0, M_m, D, h, l, d]) function code(w0, M_m, D, h, l, d) return w0 end
M_m = abs(M);
w0, M_m, D, h, l, d = num2cell(sort([w0, M_m, D, h, l, d])){:}
function tmp = code(w0, M_m, D, h, l, d)
tmp = w0;
end
M_m = N[Abs[M], $MachinePrecision] NOTE: w0, M_m, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D_, h_, l_, d_] := w0
\begin{array}{l}
M_m = \left|M\right|
\\
[w0, M_m, D, h, l, d] = \mathsf{sort}([w0, M_m, D, h, l, d])\\
\\
w0
\end{array}
herbie shell --seed 2024010
(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))))))