
(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}
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
:precision binary64
(let* ((t_0 (* D_m (* 0.5 (/ M_m d)))))
(if (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -4e+154)
(* w0 (sqrt (- 1.0 (* t_0 (* (/ h l) t_0)))))
(* w0 (sqrt (- 1.0 (* h (* (* (/ M_m d) (* D_m 0.5)) (/ t_0 l)))))))))M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
double t_0 = D_m * (0.5 * (M_m / d));
double tmp;
if ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -4e+154) {
tmp = w0 * sqrt((1.0 - (t_0 * ((h / l) * t_0))));
} else {
tmp = w0 * sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * (t_0 / l)))));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: t_0
real(8) :: tmp
t_0 = d_m * (0.5d0 * (m_m / d))
if (((((m_m * d_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-4d+154)) then
tmp = w0 * sqrt((1.0d0 - (t_0 * ((h / l) * t_0))))
else
tmp = w0 * sqrt((1.0d0 - (h * (((m_m / d) * (d_m * 0.5d0)) * (t_0 / l)))))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
double t_0 = D_m * (0.5 * (M_m / d));
double tmp;
if ((Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -4e+154) {
tmp = w0 * Math.sqrt((1.0 - (t_0 * ((h / l) * t_0))));
} else {
tmp = w0 * Math.sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * (t_0 / l)))));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): t_0 = D_m * (0.5 * (M_m / d)) tmp = 0 if (math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -4e+154: tmp = w0 * math.sqrt((1.0 - (t_0 * ((h / l) * t_0)))) else: tmp = w0 * math.sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * (t_0 / l))))) return tmp
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) t_0 = Float64(D_m * Float64(0.5 * Float64(M_m / d))) tmp = 0.0 if (Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -4e+154) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(t_0 * Float64(Float64(h / l) * t_0))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(Float64(M_m / d) * Float64(D_m * 0.5)) * Float64(t_0 / l)))))); end return tmp end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp_2 = code(w0, M_m, D_m, h, l, d)
t_0 = D_m * (0.5 * (M_m / d));
tmp = 0.0;
if (((((M_m * D_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -4e+154)
tmp = w0 * sqrt((1.0 - (t_0 * ((h / l) * t_0))));
else
tmp = w0 * sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * (t_0 / l)))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := Block[{t$95$0 = N[(D$95$m * N[(0.5 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -4e+154], N[(w0 * N[Sqrt[N[(1.0 - N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(D$95$m * 0.5), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := D\_m \cdot \left(0.5 \cdot \frac{M\_m}{d}\right)\\
\mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -4 \cdot 10^{+154}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t\_0 \cdot \left(\frac{h}{\ell} \cdot t\_0\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \left(\left(\frac{M\_m}{d} \cdot \left(D\_m \cdot 0.5\right)\right) \cdot \frac{t\_0}{\ell}\right)}\\
\end{array}
\end{array}
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.00000000000000015e154Initial program 58.0%
Simplified61.5%
associate-*r/59.2%
unpow259.2%
associate-*l*62.9%
*-commutative62.9%
associate-/r*62.9%
associate-*l/59.2%
associate-*r/61.6%
*-commutative61.6%
associate-/r*61.6%
associate-*l/59.2%
associate-*r/62.9%
associate-*l*59.1%
unpow259.1%
*-commutative59.1%
Applied egg-rr59.2%
associate-*r/57.9%
frac-times59.2%
associate-*l/61.5%
unpow261.5%
associate-*r*68.8%
frac-times62.8%
associate-*r/68.8%
*-un-lft-identity68.8%
times-frac68.8%
metadata-eval68.8%
frac-times62.8%
associate-*r/68.8%
*-un-lft-identity68.8%
times-frac68.8%
metadata-eval68.8%
Applied egg-rr68.8%
if -4.00000000000000015e154 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) Initial program 87.1%
Simplified87.1%
Applied egg-rr87.1%
unpow187.1%
associate-*l/97.1%
associate-/l*97.0%
associate-*r/96.8%
times-frac97.0%
associate-*r/96.8%
Simplified96.8%
associate-*r/97.0%
unpow297.0%
*-un-lft-identity97.0%
times-frac97.8%
frac-times96.8%
associate-*r/97.8%
*-un-lft-identity97.8%
times-frac97.8%
metadata-eval97.8%
frac-times96.8%
associate-*r/97.8%
*-un-lft-identity97.8%
times-frac97.8%
metadata-eval97.8%
Applied egg-rr97.8%
/-rgt-identity97.8%
associate-*r*97.8%
Applied egg-rr97.8%
Final simplification89.1%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
:precision binary64
(if (<= M_m 2e-170)
(*
w0
(sqrt (- 1.0 (* h (/ (* D_m (* M_m (* D_m (/ (/ M_m d) (* d 4.0))))) l)))))
(*
w0
(sqrt
(- 1.0 (* h (* D_m (/ (* D_m (* M_m (/ M_m d))) (* l (* d 4.0))))))))))M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
double tmp;
if (M_m <= 2e-170) {
tmp = w0 * sqrt((1.0 - (h * ((D_m * (M_m * (D_m * ((M_m / d) / (d * 4.0))))) / l))));
} else {
tmp = w0 * sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0)))))));
}
return tmp;
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: tmp
if (m_m <= 2d-170) then
tmp = w0 * sqrt((1.0d0 - (h * ((d_m * (m_m * (d_m * ((m_m / d) / (d * 4.0d0))))) / l))))
else
tmp = w0 * sqrt((1.0d0 - (h * (d_m * ((d_m * (m_m * (m_m / d))) / (l * (d * 4.0d0)))))))
end if
code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
double tmp;
if (M_m <= 2e-170) {
tmp = w0 * Math.sqrt((1.0 - (h * ((D_m * (M_m * (D_m * ((M_m / d) / (d * 4.0))))) / l))));
} else {
tmp = w0 * Math.sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0)))))));
}
return tmp;
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): tmp = 0 if M_m <= 2e-170: tmp = w0 * math.sqrt((1.0 - (h * ((D_m * (M_m * (D_m * ((M_m / d) / (d * 4.0))))) / l)))) else: tmp = w0 * math.sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0))))))) return tmp
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) tmp = 0.0 if (M_m <= 2e-170) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(D_m * Float64(M_m * Float64(D_m * Float64(Float64(M_m / d) / Float64(d * 4.0))))) / l))))); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(D_m * Float64(Float64(D_m * Float64(M_m * Float64(M_m / d))) / Float64(l * Float64(d * 4.0)))))))); end return tmp end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp_2 = code(w0, M_m, D_m, h, l, d)
tmp = 0.0;
if (M_m <= 2e-170)
tmp = w0 * sqrt((1.0 - (h * ((D_m * (M_m * (D_m * ((M_m / d) / (d * 4.0))))) / l))));
else
tmp = w0 * sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0)))))));
end
tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[M$95$m, 2e-170], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(D$95$m * N[(M$95$m * N[(D$95$m * N[(N[(M$95$m / d), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(D$95$m * N[(N[(D$95$m * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 2 \cdot 10^{-170}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{D\_m \cdot \left(M\_m \cdot \left(D\_m \cdot \frac{\frac{M\_m}{d}}{d \cdot 4}\right)\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \left(D\_m \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)}{\ell \cdot \left(d \cdot 4\right)}\right)}\\
\end{array}
\end{array}
if M < 1.99999999999999997e-170Initial program 79.2%
Simplified79.8%
associate-*r/89.0%
unpow289.0%
associate-*l*89.8%
*-commutative89.8%
associate-/r*89.8%
associate-*l/87.5%
associate-*r/88.6%
*-commutative88.6%
associate-/r*88.6%
associate-*l/87.5%
associate-*r/89.8%
associate-*l*89.0%
unpow289.0%
*-commutative89.0%
Applied egg-rr89.0%
unpow289.0%
*-commutative89.0%
associate-/r/88.4%
associate-*r/88.1%
frac-times88.4%
associate-*l/88.4%
clear-num88.4%
frac-times88.4%
*-un-lft-identity88.4%
clear-num88.4%
associate-/r/89.0%
*-commutative89.0%
associate-*r/87.5%
frac-times89.0%
associate-*r/87.5%
clear-num87.5%
*-un-lft-identity87.5%
times-frac89.0%
clear-num89.0%
Applied egg-rr89.0%
*-commutative89.0%
*-rgt-identity89.0%
times-frac89.0%
times-frac87.5%
associate-/r/87.5%
*-commutative87.5%
associate-*r/87.5%
*-rgt-identity87.5%
times-frac86.1%
*-commutative86.1%
*-commutative86.1%
associate-/l*85.7%
*-commutative85.7%
associate-*r*85.7%
metadata-eval85.7%
Simplified85.7%
associate-/l*85.7%
associate-*r/85.5%
*-commutative85.5%
Applied egg-rr85.5%
associate-*r/86.1%
associate-/l*85.7%
Applied egg-rr85.7%
associate-*r/86.1%
associate-*r*85.8%
*-commutative85.8%
associate-*l/87.2%
*-commutative87.2%
associate-/r/87.2%
associate-/l*88.4%
associate-*r*87.9%
associate-*r/87.2%
associate-*r*87.8%
associate-/l*86.6%
associate-/r/86.0%
*-commutative86.0%
Simplified82.4%
if 1.99999999999999997e-170 < M Initial program 76.9%
Simplified78.9%
associate-*r/80.1%
unpow280.1%
associate-*l*82.1%
*-commutative82.1%
associate-/r*82.1%
associate-*l/81.1%
associate-*r/82.1%
*-commutative82.1%
associate-/r*82.1%
associate-*l/82.0%
associate-*r/83.0%
associate-*l*80.1%
unpow280.1%
*-commutative80.1%
Applied egg-rr80.1%
unpow280.1%
*-commutative80.1%
associate-/r/80.1%
associate-*r/79.1%
frac-times80.1%
associate-*l/80.1%
clear-num80.1%
frac-times80.1%
*-un-lft-identity80.1%
clear-num80.1%
associate-/r/80.1%
*-commutative80.1%
associate-*r/79.1%
frac-times80.1%
associate-*r/79.1%
clear-num79.1%
*-un-lft-identity79.1%
times-frac80.1%
clear-num80.1%
Applied egg-rr80.1%
*-commutative80.1%
*-rgt-identity80.1%
times-frac80.1%
times-frac79.1%
associate-/r/79.1%
*-commutative79.1%
associate-*r/79.1%
*-rgt-identity79.1%
times-frac76.1%
*-commutative76.1%
*-commutative76.1%
associate-/l*79.1%
*-commutative79.1%
associate-*r*79.1%
metadata-eval79.1%
Simplified79.1%
associate-/l*78.1%
associate-*r/76.1%
*-commutative76.1%
Applied egg-rr76.1%
*-un-lft-identity76.1%
associate-/l/76.9%
associate-*l*73.9%
Applied egg-rr73.9%
*-lft-identity73.9%
associate-/l*73.9%
*-commutative73.9%
associate-*l*70.8%
Simplified70.8%
Final simplification78.1%
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
:precision binary64
(*
w0
(sqrt
(-
1.0
(* h (* (* (/ M_m d) (* D_m 0.5)) (/ (* D_m (* 0.5 (/ M_m d))) l)))))))M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * ((D_m * (0.5 * (M_m / d))) / l)))));
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
code = w0 * sqrt((1.0d0 - (h * (((m_m / d) * (d_m * 0.5d0)) * ((d_m * (0.5d0 * (m_m / d))) / l)))))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * ((D_m * (0.5 * (M_m / d))) / l)))));
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): return w0 * math.sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * ((D_m * (0.5 * (M_m / d))) / l)))))
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(Float64(M_m / d) * Float64(D_m * 0.5)) * Float64(Float64(D_m * Float64(0.5 * Float64(M_m / d))) / l)))))) end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp = code(w0, M_m, D_m, h, l, d)
tmp = w0 * sqrt((1.0 - (h * (((M_m / d) * (D_m * 0.5)) * ((D_m * (0.5 * (M_m / d))) / l)))));
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(D$95$m * 0.5), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(0.5 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
w0 \cdot \sqrt{1 - h \cdot \left(\left(\frac{M\_m}{d} \cdot \left(D\_m \cdot 0.5\right)\right) \cdot \frac{D\_m \cdot \left(0.5 \cdot \frac{M\_m}{d}\right)}{\ell}\right)}
\end{array}
Initial program 78.3%
Simplified79.4%
Applied egg-rr79.4%
unpow179.4%
associate-*l/85.7%
associate-/l*84.5%
associate-*r/84.4%
times-frac84.5%
associate-*r/84.4%
Simplified84.4%
associate-*r/84.5%
unpow284.5%
*-un-lft-identity84.5%
times-frac86.9%
frac-times85.1%
associate-*r/86.9%
*-un-lft-identity86.9%
times-frac86.9%
metadata-eval86.9%
frac-times85.1%
associate-*r/86.9%
*-un-lft-identity86.9%
times-frac86.9%
metadata-eval86.9%
Applied egg-rr86.9%
/-rgt-identity86.9%
associate-*r*86.9%
Applied egg-rr86.9%
Final simplification86.9%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D_m h l d) :precision binary64 (let* ((t_0 (* D_m (/ M_m d)))) (* w0 (sqrt (- 1.0 (/ (* h (/ (* t_0 t_0) 4.0)) l))))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
double t_0 = D_m * (M_m / d);
return w0 * sqrt((1.0 - ((h * ((t_0 * t_0) / 4.0)) / l)));
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
real(8) :: t_0
t_0 = d_m * (m_m / d)
code = w0 * sqrt((1.0d0 - ((h * ((t_0 * t_0) / 4.0d0)) / l)))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
double t_0 = D_m * (M_m / d);
return w0 * Math.sqrt((1.0 - ((h * ((t_0 * t_0) / 4.0)) / l)));
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): t_0 = D_m * (M_m / d) return w0 * math.sqrt((1.0 - ((h * ((t_0 * t_0) / 4.0)) / l)))
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) t_0 = Float64(D_m * Float64(M_m / d)) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(Float64(t_0 * t_0) / 4.0)) / l)))) end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp = code(w0, M_m, D_m, h, l, d)
t_0 = D_m * (M_m / d);
tmp = w0 * sqrt((1.0 - ((h * ((t_0 * t_0) / 4.0)) / l)));
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := Block[{t$95$0 = N[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(N[(t$95$0 * t$95$0), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := D\_m \cdot \frac{M\_m}{d}\\
w0 \cdot \sqrt{1 - \frac{h \cdot \frac{t\_0 \cdot t\_0}{4}}{\ell}}
\end{array}
\end{array}
Initial program 78.3%
Simplified79.4%
associate-*r/85.7%
unpow285.7%
associate-*l*86.9%
*-commutative86.9%
associate-/r*86.9%
associate-*l/85.1%
associate-*r/86.2%
*-commutative86.2%
associate-/r*86.2%
associate-*l/85.5%
associate-*r/87.3%
associate-*l*85.6%
unpow285.6%
*-commutative85.6%
Applied egg-rr85.7%
associate-*r/85.1%
frac-times85.7%
unpow285.7%
associate-*l/85.7%
associate-*l/85.7%
frac-times85.7%
metadata-eval85.7%
Applied egg-rr85.7%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D_m h l d) :precision binary64 (* w0 (sqrt (- 1.0 (/ (* h (* (* D_m (/ M_m d)) (/ M_m (* 4.0 (/ d D_m))))) l)))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * sqrt((1.0 - ((h * ((D_m * (M_m / d)) * (M_m / (4.0 * (d / D_m))))) / l)));
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
code = w0 * sqrt((1.0d0 - ((h * ((d_m * (m_m / d)) * (m_m / (4.0d0 * (d / d_m))))) / l)))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - ((h * ((D_m * (M_m / d)) * (M_m / (4.0 * (d / D_m))))) / l)));
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): return w0 * math.sqrt((1.0 - ((h * ((D_m * (M_m / d)) * (M_m / (4.0 * (d / D_m))))) / l)))
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(Float64(D_m * Float64(M_m / d)) * Float64(M_m / Float64(4.0 * Float64(d / D_m))))) / l)))) end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp = code(w0, M_m, D_m, h, l, d)
tmp = w0 * sqrt((1.0 - ((h * ((D_m * (M_m / d)) * (M_m / (4.0 * (d / D_m))))) / l)));
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(N[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / N[(4.0 * N[(d / D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
w0 \cdot \sqrt{1 - \frac{h \cdot \left(\left(D\_m \cdot \frac{M\_m}{d}\right) \cdot \frac{M\_m}{4 \cdot \frac{d}{D\_m}}\right)}{\ell}}
\end{array}
Initial program 78.3%
Simplified79.4%
associate-*r/85.7%
unpow285.7%
associate-*l*86.9%
*-commutative86.9%
associate-/r*86.9%
associate-*l/85.1%
associate-*r/86.2%
*-commutative86.2%
associate-/r*86.2%
associate-*l/85.5%
associate-*r/87.3%
associate-*l*85.6%
unpow285.6%
*-commutative85.6%
Applied egg-rr85.7%
unpow285.7%
*-commutative85.7%
associate-/r/85.3%
associate-*r/84.8%
frac-times85.3%
associate-*l/85.3%
frac-times84.1%
associate-/l*84.1%
Applied egg-rr84.1%
*-commutative84.1%
*-commutative84.1%
associate-/l*85.3%
associate-*r*85.3%
metadata-eval85.3%
Simplified85.3%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D_m h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* h (/ (* D_m (* (/ M_m d) (/ M_m (/ (* d 4.0) D_m)))) l))))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * sqrt((1.0 - (h * ((D_m * ((M_m / d) * (M_m / ((d * 4.0) / D_m)))) / l))));
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
code = w0 * sqrt((1.0d0 - (h * ((d_m * ((m_m / d) * (m_m / ((d * 4.0d0) / d_m)))) / l))))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h * ((D_m * ((M_m / d) * (M_m / ((d * 4.0) / D_m)))) / l))));
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): return w0 * math.sqrt((1.0 - (h * ((D_m * ((M_m / d) * (M_m / ((d * 4.0) / D_m)))) / l))))
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(D_m * Float64(Float64(M_m / d) * Float64(M_m / Float64(Float64(d * 4.0) / D_m)))) / l))))) end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp = code(w0, M_m, D_m, h, l, d)
tmp = w0 * sqrt((1.0 - (h * ((D_m * ((M_m / d) * (M_m / ((d * 4.0) / D_m)))) / l))));
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(D$95$m * N[(N[(M$95$m / d), $MachinePrecision] * N[(M$95$m / N[(N[(d * 4.0), $MachinePrecision] / D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
w0 \cdot \sqrt{1 - h \cdot \frac{D\_m \cdot \left(\frac{M\_m}{d} \cdot \frac{M\_m}{\frac{d \cdot 4}{D\_m}}\right)}{\ell}}
\end{array}
Initial program 78.3%
Simplified79.4%
associate-*r/85.7%
unpow285.7%
associate-*l*86.9%
*-commutative86.9%
associate-/r*86.9%
associate-*l/85.1%
associate-*r/86.2%
*-commutative86.2%
associate-/r*86.2%
associate-*l/85.5%
associate-*r/87.3%
associate-*l*85.6%
unpow285.6%
*-commutative85.6%
Applied egg-rr85.7%
unpow285.7%
*-commutative85.7%
associate-/r/85.3%
associate-*r/84.8%
frac-times85.3%
associate-*l/85.3%
frac-times84.1%
associate-/l*84.1%
Applied egg-rr84.1%
*-commutative84.1%
*-commutative84.1%
associate-/l*85.3%
associate-*r*85.3%
metadata-eval85.3%
Simplified85.3%
associate-/l*84.5%
associate-*l*83.0%
associate-*r/83.0%
*-commutative83.0%
Applied egg-rr83.0%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D_m h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* h (* D_m (/ (* D_m (* M_m (/ M_m d))) (* l (* d 4.0)))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0)))))));
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
code = w0 * sqrt((1.0d0 - (h * (d_m * ((d_m * (m_m * (m_m / d))) / (l * (d * 4.0d0)))))))
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0)))))));
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): return w0 * math.sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0)))))))
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(D_m * Float64(Float64(D_m * Float64(M_m * Float64(M_m / d))) / Float64(l * Float64(d * 4.0)))))))) end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp = code(w0, M_m, D_m, h, l, d)
tmp = w0 * sqrt((1.0 - (h * (D_m * ((D_m * (M_m * (M_m / d))) / (l * (d * 4.0)))))));
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(D$95$m * N[(N[(D$95$m * N[(M$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
w0 \cdot \sqrt{1 - h \cdot \left(D\_m \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{M\_m}{d}\right)}{\ell \cdot \left(d \cdot 4\right)}\right)}
\end{array}
Initial program 78.3%
Simplified79.4%
associate-*r/85.7%
unpow285.7%
associate-*l*86.9%
*-commutative86.9%
associate-/r*86.9%
associate-*l/85.1%
associate-*r/86.2%
*-commutative86.2%
associate-/r*86.2%
associate-*l/85.5%
associate-*r/87.3%
associate-*l*85.6%
unpow285.6%
*-commutative85.6%
Applied egg-rr85.7%
unpow285.7%
*-commutative85.7%
associate-/r/85.3%
associate-*r/84.8%
frac-times85.3%
associate-*l/85.3%
clear-num85.3%
frac-times85.3%
*-un-lft-identity85.3%
clear-num85.3%
associate-/r/85.7%
*-commutative85.7%
associate-*r/84.4%
frac-times85.7%
associate-*r/84.4%
clear-num84.4%
*-un-lft-identity84.4%
times-frac85.6%
clear-num85.6%
Applied egg-rr85.6%
*-commutative85.6%
*-rgt-identity85.6%
times-frac85.6%
times-frac84.4%
associate-/r/84.4%
*-commutative84.4%
associate-*r/84.4%
*-rgt-identity84.4%
times-frac82.3%
*-commutative82.3%
*-commutative82.3%
associate-/l*83.3%
*-commutative83.3%
associate-*r*83.3%
metadata-eval83.3%
Simplified83.3%
associate-/l*82.9%
associate-*r/82.0%
*-commutative82.0%
Applied egg-rr82.0%
*-un-lft-identity82.0%
associate-/l/80.9%
associate-*l*79.4%
Applied egg-rr79.4%
*-lft-identity79.4%
associate-/l*80.3%
*-commutative80.3%
associate-*l*77.2%
Simplified77.2%
Final simplification77.2%
M_m = (fabs.f64 M) D_m = (fabs.f64 D) NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M_m D_m h l d) :precision binary64 w0)
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0;
}
M_m = abs(m)
D_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d)
real(8), intent (in) :: w0
real(8), intent (in) :: m_m
real(8), intent (in) :: d_m
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d
code = w0
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
return w0;
}
M_m = math.fabs(M) D_m = math.fabs(D) [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d]) def code(w0, M_m, D_m, h, l, d): return w0
M_m = abs(M) D_m = abs(D) w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d]) function code(w0, M_m, D_m, h, l, d) return w0 end
M_m = abs(M);
D_m = abs(D);
w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
function tmp = code(w0, M_m, D_m, h, l, d)
tmp = w0;
end
M_m = N[Abs[M], $MachinePrecision] D_m = N[Abs[D], $MachinePrecision] NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := w0
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
w0
\end{array}
Initial program 78.3%
Simplified79.4%
Taylor expanded in D around 0 63.5%
herbie shell --seed 2024167
(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))))))