
(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 4 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 (/ M_m (* d 2.0))))) (* w0 (sqrt (+ 1.0 (* (/ t_0 l) (/ t_0 (/ -1.0 h))))))))
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 * 2.0));
return w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
}
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 * 2.0d0))
code = w0 * sqrt((1.0d0 + ((t_0 / l) * (t_0 / ((-1.0d0) / h)))))
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 * 2.0));
return w0 * Math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
}
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 * 2.0)) return w0 * math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))))
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 / Float64(d * 2.0))) return Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(t_0 / l) * Float64(t_0 / Float64(-1.0 / h)))))) 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 * 2.0));
tmp = w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
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 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 + N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / N[(-1.0 / h), $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 \frac{M\_m}{d \cdot 2}\\
w0 \cdot \sqrt{1 + \frac{t\_0}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}}
\end{array}
\end{array}
Initial program 81.1%
Simplified81.4%
associate-*r/86.2%
clear-num86.2%
add-sqr-sqrt86.2%
pow286.2%
unpow286.2%
sqrt-prod51.6%
add-sqr-sqrt86.2%
*-un-lft-identity86.2%
times-frac86.2%
metadata-eval86.2%
Applied egg-rr86.2%
associate-/r/86.3%
*-commutative86.3%
associate-*r/86.3%
*-commutative86.3%
associate-/l*86.0%
associate-*l/85.5%
*-commutative85.5%
associate-*l*85.5%
Simplified85.5%
*-commutative85.5%
*-commutative85.5%
associate-*r*85.5%
*-commutative85.5%
associate-*r*80.6%
div-inv80.6%
clear-num80.6%
un-div-inv80.6%
*-commutative80.6%
associate-*r*80.6%
clear-num80.6%
un-div-inv81.0%
Applied egg-rr81.0%
associate-/r/81.0%
Simplified81.0%
unpow281.0%
div-inv81.0%
times-frac87.0%
*-commutative87.0%
clear-num87.0%
un-div-inv87.0%
div-inv87.0%
metadata-eval87.0%
*-commutative87.0%
clear-num87.0%
un-div-inv87.0%
div-inv87.0%
metadata-eval87.0%
Applied egg-rr87.0%
Final simplification87.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 (let* ((t_0 (* D_m (/ M_m (* d 2.0))))) (if (<= D_m 5.6e-94) w0 (* w0 (sqrt (- 1.0 (* t_0 (* t_0 (/ h 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 * 2.0));
double tmp;
if (D_m <= 5.6e-94) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (t_0 * (t_0 * (h / 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 * (m_m / (d * 2.0d0))
if (d_m <= 5.6d-94) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (t_0 * (t_0 * (h / 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 * (M_m / (d * 2.0));
double tmp;
if (D_m <= 5.6e-94) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (t_0 * (t_0 * (h / 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 * (M_m / (d * 2.0)) tmp = 0 if D_m <= 5.6e-94: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (t_0 * (t_0 * (h / 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(M_m / Float64(d * 2.0))) tmp = 0.0 if (D_m <= 5.6e-94) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(t_0 * Float64(t_0 * Float64(h / 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 * (M_m / (d * 2.0));
tmp = 0.0;
if (D_m <= 5.6e-94)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (t_0 * (t_0 * (h / 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[(M$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D$95$m, 5.6e-94], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(t$95$0 * N[(t$95$0 * N[(h / 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 \frac{M\_m}{d \cdot 2}\\
\mathbf{if}\;D\_m \leq 5.6 \cdot 10^{-94}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t\_0 \cdot \left(t\_0 \cdot \frac{h}{\ell}\right)}\\
\end{array}
\end{array}
if D < 5.5999999999999995e-94Initial program 83.7%
Simplified84.2%
Taylor expanded in M around 0 77.2%
if 5.5999999999999995e-94 < D Initial program 74.1%
Simplified73.9%
associate-*r/75.6%
clear-num75.6%
add-sqr-sqrt75.6%
pow275.6%
unpow275.6%
sqrt-prod50.3%
add-sqr-sqrt75.6%
*-un-lft-identity75.6%
times-frac75.6%
metadata-eval75.6%
Applied egg-rr75.6%
associate-/r/75.6%
*-commutative75.6%
associate-*r/75.6%
*-commutative75.6%
associate-/l*75.8%
associate-*l/77.0%
*-commutative77.0%
associate-*l*77.0%
Simplified77.0%
*-commutative77.0%
*-commutative77.0%
associate-*r*77.0%
*-commutative77.0%
associate-*r*75.3%
div-inv75.2%
clear-num75.2%
un-div-inv75.2%
*-commutative75.2%
associate-*r*75.2%
clear-num75.2%
un-div-inv75.2%
Applied egg-rr75.2%
associate-/r/75.3%
Simplified75.3%
div-inv75.3%
unpow275.3%
clear-num75.3%
associate-*l*76.7%
*-commutative76.7%
clear-num76.7%
un-div-inv76.8%
div-inv76.8%
metadata-eval76.8%
*-commutative76.8%
clear-num76.8%
un-div-inv76.7%
div-inv76.7%
metadata-eval76.7%
Applied egg-rr76.7%
Final simplification77.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 (let* ((t_0 (* D_m (/ M_m (* d 2.0))))) (if (<= D_m 9.2e-97) w0 (* w0 (sqrt (- 1.0 (* t_0 (/ t_0 (/ l h)))))))))
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 * 2.0));
double tmp;
if (D_m <= 9.2e-97) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - (t_0 * (t_0 / (l / h)))));
}
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 * (m_m / (d * 2.0d0))
if (d_m <= 9.2d-97) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - (t_0 * (t_0 / (l / h)))))
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 * (M_m / (d * 2.0));
double tmp;
if (D_m <= 9.2e-97) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - (t_0 * (t_0 / (l / h)))));
}
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 * (M_m / (d * 2.0)) tmp = 0 if D_m <= 9.2e-97: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - (t_0 * (t_0 / (l / h))))) 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(M_m / Float64(d * 2.0))) tmp = 0.0 if (D_m <= 9.2e-97) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(t_0 * Float64(t_0 / Float64(l / h)))))); 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 * (M_m / (d * 2.0));
tmp = 0.0;
if (D_m <= 9.2e-97)
tmp = w0;
else
tmp = w0 * sqrt((1.0 - (t_0 * (t_0 / (l / h)))));
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[(M$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D$95$m, 9.2e-97], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(t$95$0 * N[(t$95$0 / N[(l / h), $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 \frac{M\_m}{d \cdot 2}\\
\mathbf{if}\;D\_m \leq 9.2 \cdot 10^{-97}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t\_0 \cdot \frac{t\_0}{\frac{\ell}{h}}}\\
\end{array}
\end{array}
if D < 9.19999999999999976e-97Initial program 83.7%
Simplified84.1%
Taylor expanded in M around 0 77.1%
if 9.19999999999999976e-97 < D Initial program 74.4%
Simplified74.2%
associate-*r/75.9%
clear-num75.9%
add-sqr-sqrt75.9%
pow275.9%
unpow275.9%
sqrt-prod51.0%
add-sqr-sqrt75.9%
*-un-lft-identity75.9%
times-frac75.9%
metadata-eval75.9%
Applied egg-rr75.9%
associate-/r/76.0%
*-commutative76.0%
associate-*r/76.0%
*-commutative76.0%
associate-/l*76.1%
associate-*l/77.3%
*-commutative77.3%
associate-*l*77.3%
Simplified77.3%
*-commutative77.3%
*-commutative77.3%
associate-*r*77.3%
*-commutative77.3%
associate-*r*75.6%
div-inv75.6%
clear-num75.6%
un-div-inv75.6%
*-commutative75.6%
associate-*r*75.6%
clear-num75.6%
un-div-inv75.6%
Applied egg-rr75.6%
associate-/r/75.6%
Simplified75.6%
unpow275.6%
*-un-lft-identity75.6%
times-frac77.1%
*-commutative77.1%
clear-num77.1%
un-div-inv77.1%
div-inv77.1%
metadata-eval77.1%
*-commutative77.1%
clear-num77.1%
un-div-inv77.1%
div-inv77.1%
metadata-eval77.1%
Applied egg-rr77.1%
Final simplification77.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)
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 81.1%
Simplified81.4%
Taylor expanded in M around 0 69.7%
Final simplification69.7%
herbie shell --seed 2024045
(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))))))