
(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 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (/ (* (* M (/ 0.5 d)) D) l) (* (/ (* D (* M 0.5)) d) h))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - ((((M * (0.5 / d)) * D) / l) * (((D * (M * 0.5)) / d) * h))));
}
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 * (0.5d0 / d_1)) * d) / l) * (((d * (m * 0.5d0)) / d_1) * h))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - ((((M * (0.5 / d)) * D) / l) * (((D * (M * 0.5)) / d) * h))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((((M * (0.5 / d)) * D) / l) * (((D * (M * 0.5)) / d) * h))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(M * Float64(0.5 / d)) * D) / l) * Float64(Float64(Float64(D * Float64(M * 0.5)) / d) * h))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - ((((M * (0.5 / d)) * D) / l) * (((D * (M * 0.5)) / d) * h)))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(D * N[(M * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - \frac{\left(M \cdot \frac{0.5}{d}\right) \cdot D}{\ell} \cdot \left(\frac{D \cdot \left(M \cdot 0.5\right)}{d} \cdot h\right)}
\end{array}
Initial program 83.6%
Simplified83.2%
clear-num82.8%
un-div-inv83.2%
*-commutative83.2%
associate-*l/83.6%
associate-*r/83.2%
div-inv83.2%
metadata-eval83.2%
Applied egg-rr83.2%
*-commutative83.2%
associate-*l/83.6%
associate-/l*83.2%
associate-*r/83.2%
Simplified83.2%
unpow283.2%
div-inv83.2%
times-frac91.4%
*-commutative91.4%
associate-*l*88.8%
*-commutative88.8%
associate-*l*89.2%
Applied egg-rr89.2%
associate-*r*88.8%
associate-/r/88.8%
/-rgt-identity88.8%
associate-*r*91.4%
Simplified91.4%
associate-*r*88.8%
associate-/r/88.8%
div-inv88.8%
clear-num88.8%
associate-*l*88.8%
associate-*r/91.4%
Applied egg-rr91.4%
Final simplification91.4%
(FPCore (w0 M D h l d)
:precision binary64
(let* ((t_0 (* M (/ 0.5 (/ d D)))))
(if (<= (/ h l) -5e+233)
(*
w0
(sqrt
(- 1.0 (* (* (* (* M (/ 0.5 d)) D) h) (* M (/ (* 0.5 (/ D d)) l))))))
(if (<= (/ h l) -1e-323)
(* w0 (sqrt (- 1.0 (* t_0 (* (/ h l) t_0)))))
w0))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = M * (0.5 / (d / D));
double tmp;
if ((h / l) <= -5e+233) {
tmp = w0 * sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l)))));
} else if ((h / l) <= -1e-323) {
tmp = w0 * sqrt((1.0 - (t_0 * ((h / l) * t_0))));
} else {
tmp = w0;
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = m * (0.5d0 / (d_1 / d))
if ((h / l) <= (-5d+233)) then
tmp = w0 * sqrt((1.0d0 - ((((m * (0.5d0 / d_1)) * d) * h) * (m * ((0.5d0 * (d / d_1)) / l)))))
else if ((h / l) <= (-1d-323)) then
tmp = w0 * sqrt((1.0d0 - (t_0 * ((h / l) * t_0))))
else
tmp = w0
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = M * (0.5 / (d / D));
double tmp;
if ((h / l) <= -5e+233) {
tmp = w0 * Math.sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l)))));
} else if ((h / l) <= -1e-323) {
tmp = w0 * Math.sqrt((1.0 - (t_0 * ((h / l) * t_0))));
} else {
tmp = w0;
}
return tmp;
}
def code(w0, M, D, h, l, d): t_0 = M * (0.5 / (d / D)) tmp = 0 if (h / l) <= -5e+233: tmp = w0 * math.sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l))))) elif (h / l) <= -1e-323: tmp = w0 * math.sqrt((1.0 - (t_0 * ((h / l) * t_0)))) else: tmp = w0 return tmp
function code(w0, M, D, h, l, d) t_0 = Float64(M * Float64(0.5 / Float64(d / D))) tmp = 0.0 if (Float64(h / l) <= -5e+233) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(M * Float64(0.5 / d)) * D) * h) * Float64(M * Float64(Float64(0.5 * Float64(D / d)) / l)))))); elseif (Float64(h / l) <= -1e-323) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(t_0 * Float64(Float64(h / l) * t_0))))); else tmp = w0; end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) t_0 = M * (0.5 / (d / D)); tmp = 0.0; if ((h / l) <= -5e+233) tmp = w0 * sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l))))); elseif ((h / l) <= -1e-323) tmp = w0 * sqrt((1.0 - (t_0 * ((h / l) * t_0)))); else tmp = w0; end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(M * N[(0.5 / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(h / l), $MachinePrecision], -5e+233], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] * h), $MachinePrecision] * N[(M * N[(N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(h / l), $MachinePrecision], -1e-323], N[(w0 * N[Sqrt[N[(1.0 - N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{0.5}{\frac{d}{D}}\\
\mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{+233}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D\right) \cdot h\right) \cdot \left(M \cdot \frac{0.5 \cdot \frac{D}{d}}{\ell}\right)}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-323}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t\_0 \cdot \left(\frac{h}{\ell} \cdot t\_0\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -5.00000000000000009e233Initial program 68.2%
Simplified68.2%
clear-num68.3%
un-div-inv71.2%
*-commutative71.2%
associate-*l/71.2%
associate-*r/71.1%
div-inv71.1%
metadata-eval71.1%
Applied egg-rr71.1%
*-commutative71.1%
associate-*l/71.2%
associate-/l*71.2%
associate-*r/71.2%
Simplified71.2%
unpow271.2%
div-inv71.3%
times-frac94.4%
*-commutative94.4%
associate-*l*89.0%
*-commutative89.0%
associate-*l*89.0%
Applied egg-rr89.0%
associate-*r*89.0%
associate-/r/88.9%
/-rgt-identity88.9%
associate-*r*94.3%
Simplified94.3%
associate-*r*88.9%
associate-/r/89.0%
associate-/l*89.0%
div-inv89.0%
clear-num89.1%
Applied egg-rr89.1%
if -5.00000000000000009e233 < (/.f64 h l) < -9.88131e-324Initial program 84.9%
Simplified84.8%
associate-*r/84.0%
*-commutative84.0%
associate-*l/84.0%
associate-*r/83.2%
div-inv83.2%
metadata-eval83.2%
Applied egg-rr83.2%
associate-/l*84.0%
*-commutative84.0%
unpow284.0%
associate-*r*84.8%
associate-*l*84.8%
clear-num84.8%
un-div-inv84.8%
associate-*l*84.8%
clear-num84.8%
un-div-inv84.8%
Applied egg-rr84.8%
if -9.88131e-324 < (/.f64 h l) Initial program 87.0%
Simplified86.1%
Taylor expanded in D around 0 94.8%
Final simplification89.6%
(FPCore (w0 M D h l d)
:precision binary64
(if (<= M 2.25e-240)
w0
(*
w0
(sqrt
(- 1.0 (* (* (* (* M (/ 0.5 d)) D) h) (* M (/ (* 0.5 (/ D d)) l))))))))
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.25e-240) {
tmp = w0;
} else {
tmp = w0 * sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l)))));
}
return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: tmp
if (m <= 2.25d-240) then
tmp = w0
else
tmp = w0 * sqrt((1.0d0 - ((((m * (0.5d0 / d_1)) * d) * h) * (m * ((0.5d0 * (d / d_1)) / l)))))
end if
code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 2.25e-240) {
tmp = w0;
} else {
tmp = w0 * Math.sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l)))));
}
return tmp;
}
def code(w0, M, D, h, l, d): tmp = 0 if M <= 2.25e-240: tmp = w0 else: tmp = w0 * math.sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l))))) return tmp
function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 2.25e-240) tmp = w0; else tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(M * Float64(0.5 / d)) * D) * h) * Float64(M * Float64(Float64(0.5 * Float64(D / d)) / l)))))); end return tmp end
function tmp_2 = code(w0, M, D, h, l, d) tmp = 0.0; if (M <= 2.25e-240) tmp = w0; else tmp = w0 * sqrt((1.0 - ((((M * (0.5 / d)) * D) * h) * (M * ((0.5 * (D / d)) / l))))); end tmp_2 = tmp; end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.25e-240], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] * h), $MachinePrecision] * N[(M * N[(N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.25 \cdot 10^{-240}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D\right) \cdot h\right) \cdot \left(M \cdot \frac{0.5 \cdot \frac{D}{d}}{\ell}\right)}\\
\end{array}
\end{array}
if M < 2.2500000000000001e-240Initial program 86.7%
Simplified86.7%
Taylor expanded in D around 0 68.3%
if 2.2500000000000001e-240 < M Initial program 79.2%
Simplified78.3%
clear-num77.4%
un-div-inv78.3%
*-commutative78.3%
associate-*l/79.2%
associate-*r/78.3%
div-inv78.3%
metadata-eval78.3%
Applied egg-rr78.3%
*-commutative78.3%
associate-*l/79.2%
associate-/l*78.3%
associate-*r/78.3%
Simplified78.3%
unpow278.3%
div-inv78.3%
times-frac90.2%
*-commutative90.2%
associate-*l*87.6%
*-commutative87.6%
associate-*l*88.6%
Applied egg-rr88.6%
associate-*r*87.7%
associate-/r/87.7%
/-rgt-identity87.7%
associate-*r*90.2%
Simplified90.2%
associate-*r*87.7%
associate-/r/87.7%
associate-/l*85.9%
div-inv85.9%
clear-num85.9%
Applied egg-rr85.9%
Final simplification75.7%
(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (/ (* M (* (/ 0.5 d) D)) l) (* h (* M (* 0.5 (/ D d)))))))))
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - (((M * ((0.5 / d) * D)) / l) * (h * (M * (0.5 * (D / d)))))));
}
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 * ((0.5d0 / d_1) * d)) / l) * (h * (m * (0.5d0 * (d / d_1)))))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - (((M * ((0.5 / d) * D)) / l) * (h * (M * (0.5 * (D / d)))))));
}
def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - (((M * ((0.5 / d) * D)) / l) * (h * (M * (0.5 * (D / d)))))))
function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(M * Float64(Float64(0.5 / d) * D)) / l) * Float64(h * Float64(M * Float64(0.5 * Float64(D / d)))))))) end
function tmp = code(w0, M, D, h, l, d) tmp = w0 * sqrt((1.0 - (((M * ((0.5 / d) * D)) / l) * (h * (M * (0.5 * (D / d))))))); end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(M * N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(h * N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
w0 \cdot \sqrt{1 - \frac{M \cdot \left(\frac{0.5}{d} \cdot D\right)}{\ell} \cdot \left(h \cdot \left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)\right)}
\end{array}
Initial program 83.6%
Simplified83.2%
clear-num82.8%
un-div-inv83.2%
*-commutative83.2%
associate-*l/83.6%
associate-*r/83.2%
div-inv83.2%
metadata-eval83.2%
Applied egg-rr83.2%
*-commutative83.2%
associate-*l/83.6%
associate-/l*83.2%
associate-*r/83.2%
Simplified83.2%
unpow283.2%
div-inv83.2%
times-frac91.4%
*-commutative91.4%
associate-*l*88.8%
*-commutative88.8%
associate-*l*89.2%
Applied egg-rr89.2%
associate-/r/89.2%
/-rgt-identity89.2%
associate-/r/89.2%
div-inv89.2%
clear-num89.2%
Applied egg-rr89.2%
Final simplification89.2%
(FPCore (w0 M D h l d) :precision binary64 (let* ((t_0 (* (* M (/ 0.5 d)) D))) (* w0 (sqrt (- 1.0 (* (/ t_0 l) (* t_0 h)))))))
double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * (0.5 / d)) * D;
return w0 * sqrt((1.0 - ((t_0 / l) * (t_0 * h))));
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
real(8) :: t_0
t_0 = (m * (0.5d0 / d_1)) * d
code = w0 * sqrt((1.0d0 - ((t_0 / l) * (t_0 * h))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
double t_0 = (M * (0.5 / d)) * D;
return w0 * Math.sqrt((1.0 - ((t_0 / l) * (t_0 * h))));
}
def code(w0, M, D, h, l, d): t_0 = (M * (0.5 / d)) * D return w0 * math.sqrt((1.0 - ((t_0 / l) * (t_0 * h))))
function code(w0, M, D, h, l, d) t_0 = Float64(Float64(M * Float64(0.5 / d)) * D) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(t_0 / l) * Float64(t_0 * h))))) end
function tmp = code(w0, M, D, h, l, d) t_0 = (M * (0.5 / d)) * D; tmp = w0 * sqrt((1.0 - ((t_0 / l) * (t_0 * h)))); end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 - N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(M \cdot \frac{0.5}{d}\right) \cdot D\\
w0 \cdot \sqrt{1 - \frac{t\_0}{\ell} \cdot \left(t\_0 \cdot h\right)}
\end{array}
\end{array}
Initial program 83.6%
Simplified83.2%
clear-num82.8%
un-div-inv83.2%
*-commutative83.2%
associate-*l/83.6%
associate-*r/83.2%
div-inv83.2%
metadata-eval83.2%
Applied egg-rr83.2%
*-commutative83.2%
associate-*l/83.6%
associate-/l*83.2%
associate-*r/83.2%
Simplified83.2%
unpow283.2%
div-inv83.2%
times-frac91.4%
*-commutative91.4%
associate-*l*88.8%
*-commutative88.8%
associate-*l*89.2%
Applied egg-rr89.2%
associate-*r*88.8%
associate-/r/88.8%
/-rgt-identity88.8%
associate-*r*91.4%
Simplified91.4%
Final simplification91.4%
(FPCore (w0 M D h l d) :precision binary64 w0)
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
real(8) function code(w0, m, d, h, l, d_1)
real(8), intent (in) :: w0
real(8), intent (in) :: m
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: d_1
code = w0
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
def code(w0, M, D, h, l, d): return w0
function code(w0, M, D, h, l, d) return w0 end
function tmp = code(w0, M, D, h, l, d) tmp = w0; end
code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
\\
w0
\end{array}
Initial program 83.6%
Simplified83.2%
Taylor expanded in D around 0 67.1%
Final simplification67.1%
herbie shell --seed 2024053
(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))))))