
(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 7 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)
(FPCore (w0 M_m D h l d)
:precision binary64
(let* ((t_0 (* D (/ M_m d))))
(if (<= M_m 1.35e-239)
(* w0 (fma 0.125 (* h (/ (* t_0 t_0) (- l))) 1.0))
(*
w0
(sqrt
(-
1.0
(* h (* (* (* M_m 0.5) (/ D d)) (* (* M_m 0.5) (/ (/ D d) l))))))))))M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D * (M_m / d);
double tmp;
if (M_m <= 1.35e-239) {
tmp = w0 * fma(0.125, (h * ((t_0 * t_0) / -l)), 1.0);
} else {
tmp = w0 * sqrt((1.0 - (h * (((M_m * 0.5) * (D / d)) * ((M_m * 0.5) * ((D / d) / l))))));
}
return tmp;
}
M_m = abs(M) function code(w0, M_m, D, h, l, d) t_0 = Float64(D * Float64(M_m / d)) tmp = 0.0 if (M_m <= 1.35e-239) tmp = Float64(w0 * fma(0.125, Float64(h * Float64(Float64(t_0 * t_0) / Float64(-l))), 1.0)); else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(Float64(M_m * 0.5) * Float64(D / d)) * Float64(Float64(M_m * 0.5) * Float64(Float64(D / d) / l))))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1.35e-239], N[(w0 * N[(0.125 * N[(h * N[(N[(t$95$0 * t$95$0), $MachinePrecision] / (-l)), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := D \cdot \frac{M\_m}{d}\\
\mathbf{if}\;M\_m \leq 1.35 \cdot 10^{-239}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(0.125, h \cdot \frac{t\_0 \cdot t\_0}{-\ell}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \left(\left(\left(M\_m \cdot 0.5\right) \cdot \frac{D}{d}\right) \cdot \left(\left(M\_m \cdot 0.5\right) \cdot \frac{\frac{D}{d}}{\ell}\right)\right)}\\
\end{array}
\end{array}
if M < 1.35e-239Initial program 78.8%
Simplified78.8%
clear-num78.8%
un-div-inv80.2%
clear-num80.2%
un-div-inv80.2%
associate-/r/80.2%
Applied egg-rr80.2%
associate-/r/86.0%
associate-*l/86.0%
*-commutative86.0%
associate-/l*86.0%
associate-*l/86.0%
*-commutative86.0%
associate-*l/86.0%
associate-/l/86.7%
associate-/r/86.7%
associate-*l/86.7%
*-commutative86.7%
associate-*r/86.0%
*-commutative86.0%
associate-/l/86.0%
associate-/l*86.0%
Simplified86.0%
add-sqr-sqrt64.5%
pow264.5%
sqrt-div46.2%
sqrt-pow146.8%
metadata-eval46.8%
pow146.8%
associate-/r*46.8%
Applied egg-rr46.8%
Taylor expanded in l around -inf 0.0%
+-commutative0.0%
fma-define0.0%
Simplified84.5%
unpow284.5%
Applied egg-rr84.5%
if 1.35e-239 < M Initial program 85.6%
Simplified83.9%
clear-num83.9%
un-div-inv84.8%
clear-num84.7%
un-div-inv86.2%
associate-/r/86.1%
Applied egg-rr86.1%
associate-/r/88.9%
associate-*l/88.1%
*-commutative88.1%
associate-/l*88.9%
associate-*l/89.0%
*-commutative89.0%
associate-*l/89.0%
associate-/l/90.1%
associate-/r/90.1%
associate-*l/90.1%
*-commutative90.1%
associate-*r/90.0%
*-commutative90.0%
associate-/l/90.0%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in D around 0 90.0%
associate-*l/90.1%
*-commutative90.1%
Simplified90.1%
unpow290.1%
*-un-lft-identity90.1%
times-frac90.9%
associate-*r*90.9%
associate-*r*90.9%
Applied egg-rr90.9%
associate-/l*90.9%
Applied egg-rr90.9%
Final simplification87.4%
M_m = (fabs.f64 M) (FPCore (w0 M_m D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* h (/ (pow (* D (/ M_m (* 2.0 d))) 2.0) l))))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (h * (pow((D * (M_m / (2.0 * d))), 2.0) / l))));
}
M_m = abs(m)
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 - (h * (((d * (m_m / (2.0d0 * d_1))) ** 2.0d0) / l))))
end function
M_m = Math.abs(M);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (h * (Math.pow((D * (M_m / (2.0 * d))), 2.0) / l))));
}
M_m = math.fabs(M) def code(w0, M_m, D, h, l, d): return w0 * math.sqrt((1.0 - (h * (math.pow((D * (M_m / (2.0 * d))), 2.0) / l))))
M_m = abs(M) function code(w0, M_m, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64((Float64(D * Float64(M_m / Float64(2.0 * d))) ^ 2.0) / l))))) end
M_m = abs(M); function tmp = code(w0, M_m, D, h, l, d) tmp = w0 * sqrt((1.0 - (h * (((D * (M_m / (2.0 * d))) ^ 2.0) / l)))); end
M_m = N[Abs[M], $MachinePrecision] code[w0_, M$95$m_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[Power[N[(D * N[(M$95$m / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
w0 \cdot \sqrt{1 - h \cdot \frac{{\left(D \cdot \frac{M\_m}{2 \cdot d}\right)}^{2}}{\ell}}
\end{array}
Initial program 81.8%
Simplified81.1%
clear-num81.0%
un-div-inv82.2%
clear-num82.2%
un-div-inv82.8%
associate-/r/82.8%
Applied egg-rr82.8%
associate-/r/87.3%
associate-*l/86.9%
*-commutative86.9%
associate-/l*87.3%
associate-*l/87.3%
*-commutative87.3%
associate-*l/87.3%
associate-/l/88.2%
associate-/r/88.2%
associate-*l/88.2%
*-commutative88.2%
associate-*r/87.8%
*-commutative87.8%
associate-/l/87.8%
associate-/l*86.7%
Simplified86.7%
Final simplification86.7%
M_m = (fabs.f64 M)
(FPCore (w0 M_m D h l d)
:precision binary64
(let* ((t_0 (* D (/ M_m d))))
(if (<= (/ h l) -2e-313)
(* w0 (fma -0.125 (* (* t_0 t_0) (/ h l)) 1.0))
w0)))M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D * (M_m / d);
double tmp;
if ((h / l) <= -2e-313) {
tmp = w0 * fma(-0.125, ((t_0 * t_0) * (h / l)), 1.0);
} else {
tmp = w0;
}
return tmp;
}
M_m = abs(M) function code(w0, M_m, D, h, l, d) t_0 = Float64(D * Float64(M_m / d)) tmp = 0.0 if (Float64(h / l) <= -2e-313) tmp = Float64(w0 * fma(-0.125, Float64(Float64(t_0 * t_0) * Float64(h / l)), 1.0)); else tmp = w0; end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(h / l), $MachinePrecision], -2e-313], N[(w0 * N[(-0.125 * N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], w0]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := D \cdot \frac{M\_m}{d}\\
\mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-313}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(-0.125, \left(t\_0 \cdot t\_0\right) \cdot \frac{h}{\ell}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -1.99999999998e-313Initial program 79.9%
Simplified79.3%
Taylor expanded in D around 0 52.9%
associate-/l*53.6%
associate-/l*52.8%
Simplified52.8%
*-un-lft-identity52.8%
cancel-sign-sub-inv52.8%
metadata-eval52.8%
associate-*r*51.4%
pow-prod-down65.7%
associate-/r*67.1%
Applied egg-rr67.1%
*-lft-identity67.1%
Simplified67.1%
Taylor expanded in D around 0 52.3%
+-commutative52.3%
fma-define52.3%
Simplified73.3%
unpow275.4%
Applied egg-rr73.3%
if -1.99999999998e-313 < (/.f64 h l) Initial program 84.2%
Simplified83.3%
Taylor expanded in D around 0 96.6%
Final simplification83.7%
M_m = (fabs.f64 M) (FPCore (w0 M_m D h l d) :precision binary64 (let* ((t_0 (* (* M_m 0.5) (/ D d)))) (* w0 (sqrt (- 1.0 (* h (* t_0 (/ t_0 l))))))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = (M_m * 0.5) * (D / d);
return w0 * sqrt((1.0 - (h * (t_0 * (t_0 / l)))));
}
M_m = abs(m)
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 * 0.5d0) * (d / d_1)
code = w0 * sqrt((1.0d0 - (h * (t_0 * (t_0 / l)))))
end function
M_m = Math.abs(M);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = (M_m * 0.5) * (D / d);
return w0 * Math.sqrt((1.0 - (h * (t_0 * (t_0 / l)))));
}
M_m = math.fabs(M) def code(w0, M_m, D, h, l, d): t_0 = (M_m * 0.5) * (D / d) return w0 * math.sqrt((1.0 - (h * (t_0 * (t_0 / l)))))
M_m = abs(M) function code(w0, M_m, D, h, l, d) t_0 = Float64(Float64(M_m * 0.5) * Float64(D / d)) return Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(t_0 * Float64(t_0 / l)))))) end
M_m = abs(M); function tmp = code(w0, M_m, D, h, l, d) t_0 = (M_m * 0.5) * (D / d); tmp = w0 * sqrt((1.0 - (h * (t_0 * (t_0 / l))))); end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(t$95$0 * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \left(M\_m \cdot 0.5\right) \cdot \frac{D}{d}\\
w0 \cdot \sqrt{1 - h \cdot \left(t\_0 \cdot \frac{t\_0}{\ell}\right)}
\end{array}
\end{array}
Initial program 81.8%
Simplified81.1%
clear-num81.0%
un-div-inv82.2%
clear-num82.2%
un-div-inv82.8%
associate-/r/82.8%
Applied egg-rr82.8%
associate-/r/87.3%
associate-*l/86.9%
*-commutative86.9%
associate-/l*87.3%
associate-*l/87.3%
*-commutative87.3%
associate-*l/87.3%
associate-/l/88.2%
associate-/r/88.2%
associate-*l/88.2%
*-commutative88.2%
associate-*r/87.8%
*-commutative87.8%
associate-/l/87.8%
associate-/l*86.7%
Simplified86.7%
Taylor expanded in D around 0 87.8%
associate-*l/88.2%
*-commutative88.2%
Simplified88.2%
unpow288.2%
*-un-lft-identity88.2%
times-frac89.3%
associate-*r*89.3%
associate-*r*89.3%
Applied egg-rr89.3%
Final simplification89.3%
M_m = (fabs.f64 M) (FPCore (w0 M_m D h l d) :precision binary64 (let* ((t_0 (* D (/ M_m d)))) (* w0 (fma 0.125 (* h (/ (* t_0 t_0) (- l))) 1.0))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
double t_0 = D * (M_m / d);
return w0 * fma(0.125, (h * ((t_0 * t_0) / -l)), 1.0);
}
M_m = abs(M) function code(w0, M_m, D, h, l, d) t_0 = Float64(D * Float64(M_m / d)) return Float64(w0 * fma(0.125, Float64(h * Float64(Float64(t_0 * t_0) / Float64(-l))), 1.0)) end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(D * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[(0.125 * N[(h * N[(N[(t$95$0 * t$95$0), $MachinePrecision] / (-l)), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := D \cdot \frac{M\_m}{d}\\
w0 \cdot \mathsf{fma}\left(0.125, h \cdot \frac{t\_0 \cdot t\_0}{-\ell}, 1\right)
\end{array}
\end{array}
Initial program 81.8%
Simplified81.1%
clear-num81.0%
un-div-inv82.2%
clear-num82.2%
un-div-inv82.8%
associate-/r/82.8%
Applied egg-rr82.8%
associate-/r/87.3%
associate-*l/86.9%
*-commutative86.9%
associate-/l*87.3%
associate-*l/87.3%
*-commutative87.3%
associate-*l/87.3%
associate-/l/88.2%
associate-/r/88.2%
associate-*l/88.2%
*-commutative88.2%
associate-*r/87.8%
*-commutative87.8%
associate-/l/87.8%
associate-/l*86.7%
Simplified86.7%
add-sqr-sqrt67.6%
pow267.6%
sqrt-div47.3%
sqrt-pow148.0%
metadata-eval48.0%
pow148.0%
associate-/r*48.0%
Applied egg-rr48.0%
Taylor expanded in l around -inf 0.0%
+-commutative0.0%
fma-define0.0%
Simplified83.8%
unpow283.8%
Applied egg-rr83.8%
Final simplification83.8%
M_m = (fabs.f64 M) (FPCore (w0 M_m D h l d) :precision binary64 (if (<= M_m 9.8e+51) w0 (* -0.125 (* (pow (* M_m (/ D d)) 2.0) (/ (* w0 h) l)))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if (M_m <= 9.8e+51) {
tmp = w0;
} else {
tmp = -0.125 * (pow((M_m * (D / d)), 2.0) * ((w0 * h) / l));
}
return tmp;
}
M_m = abs(m)
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 (m_m <= 9.8d+51) then
tmp = w0
else
tmp = (-0.125d0) * (((m_m * (d / d_1)) ** 2.0d0) * ((w0 * h) / l))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
double tmp;
if (M_m <= 9.8e+51) {
tmp = w0;
} else {
tmp = -0.125 * (Math.pow((M_m * (D / d)), 2.0) * ((w0 * h) / l));
}
return tmp;
}
M_m = math.fabs(M) def code(w0, M_m, D, h, l, d): tmp = 0 if M_m <= 9.8e+51: tmp = w0 else: tmp = -0.125 * (math.pow((M_m * (D / d)), 2.0) * ((w0 * h) / l)) return tmp
M_m = abs(M) function code(w0, M_m, D, h, l, d) tmp = 0.0 if (M_m <= 9.8e+51) tmp = w0; else tmp = Float64(-0.125 * Float64((Float64(M_m * Float64(D / d)) ^ 2.0) * Float64(Float64(w0 * h) / l))); end return tmp end
M_m = abs(M); function tmp_2 = code(w0, M_m, D, h, l, d) tmp = 0.0; if (M_m <= 9.8e+51) tmp = w0; else tmp = -0.125 * (((M_m * (D / d)) ^ 2.0) * ((w0 * h) / l)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 9.8e+51], w0, N[(-0.125 * N[(N[Power[N[(M$95$m * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(w0 * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 9.8 \cdot 10^{+51}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left({\left(M\_m \cdot \frac{D}{d}\right)}^{2} \cdot \frac{w0 \cdot h}{\ell}\right)\\
\end{array}
\end{array}
if M < 9.79999999999999967e51Initial program 83.1%
Simplified83.1%
Taylor expanded in D around 0 75.8%
if 9.79999999999999967e51 < M Initial program 76.2%
Simplified72.1%
Taylor expanded in D around 0 42.4%
associate-/l*42.4%
associate-/l*44.3%
Simplified44.3%
*-un-lft-identity44.3%
cancel-sign-sub-inv44.3%
metadata-eval44.3%
associate-*r*44.3%
pow-prod-down73.7%
associate-/r*73.7%
Applied egg-rr73.7%
*-lft-identity73.7%
Simplified73.7%
Taylor expanded in D around 0 42.4%
+-commutative42.4%
fma-define42.4%
Simplified68.4%
Taylor expanded in D around inf 28.3%
associate-*r*28.3%
times-frac26.2%
associate-/l*26.2%
unpow226.2%
unpow226.2%
unpow226.2%
times-frac27.5%
swap-sqr28.3%
unpow228.3%
associate-*r/28.4%
*-commutative28.4%
associate-*r/28.4%
Simplified28.4%
Final simplification66.9%
M_m = (fabs.f64 M) (FPCore (w0 M_m D h l d) :precision binary64 w0)
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
return w0;
}
M_m = abs(m)
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);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
return w0;
}
M_m = math.fabs(M) def code(w0, M_m, D, h, l, d): return w0
M_m = abs(M) function code(w0, M_m, D, h, l, d) return w0 end
M_m = abs(M); function tmp = code(w0, M_m, D, h, l, d) tmp = w0; end
M_m = N[Abs[M], $MachinePrecision] code[w0_, M$95$m_, D_, h_, l_, d_] := w0
\begin{array}{l}
M_m = \left|M\right|
\\
w0
\end{array}
Initial program 81.8%
Simplified81.1%
Taylor expanded in D around 0 70.7%
Final simplification70.7%
herbie shell --seed 2024072
(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))))))