
(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}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(*
w0
(sqrt
(+
1.0
(* (* (* M (* D (/ 0.5 d))) (* (* M (* 0.5 (/ D d))) h)) (/ -1.0 l))))))assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 + (((M * (D * (0.5 / d))) * ((M * (0.5 * (D / d))) * h)) * (-1.0 / l))));
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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 * (0.5d0 / d_1))) * ((m * (0.5d0 * (d / d_1))) * h)) * ((-1.0d0) / l))))
end function
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 + (((M * (D * (0.5 / d))) * ((M * (0.5 * (D / d))) * h)) * (-1.0 / l))));
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 + (((M * (D * (0.5 / d))) * ((M * (0.5 * (D / d))) * h)) * (-1.0 / l))))
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(0.5 / d))) * Float64(Float64(M * Float64(0.5 * Float64(D / d))) * h)) * Float64(-1.0 / l))))) end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 + (((M * (D * (0.5 / d))) * ((M * (0.5 * (D / d))) * h)) * (-1.0 / l))));
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(0.5 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
w0 \cdot \sqrt{1 + \left(\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right) \cdot \left(\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right) \cdot h\right)\right) \cdot \frac{-1}{\ell}}
\end{array}
Initial program 80.6%
Simplified81.3%
unpow281.3%
*-commutative81.3%
associate-*l/80.6%
associate-*r/80.6%
associate-*r*79.9%
*-commutative79.9%
associate-*l/79.1%
associate-*r/79.9%
times-frac79.1%
associate-/l*79.9%
div-inv79.9%
associate-/r*79.9%
metadata-eval79.9%
div-inv79.9%
metadata-eval79.9%
Applied egg-rr79.9%
associate-*r/85.0%
associate-*l*85.7%
associate-*r*85.0%
Applied egg-rr85.0%
div-inv85.0%
associate-*l*89.2%
associate-*l*90.3%
associate-*l*90.3%
Applied egg-rr90.3%
Final simplification90.3%
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (/ h l) -2e-278)
(*
w0
(sqrt (- 1.0 (* (/ h l) (* (/ D d) (* (* M (* D (/ 0.5 d))) (* M 0.5)))))))
w0))assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -2e-278) {
tmp = w0 * sqrt((1.0 - ((h / l) * ((D / d) * ((M * (D * (0.5 / d))) * (M * 0.5))))));
} else {
tmp = w0;
}
return tmp;
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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 ((h / l) <= (-2d-278)) then
tmp = w0 * sqrt((1.0d0 - ((h / l) * ((d / d_1) * ((m * (d * (0.5d0 / d_1))) * (m * 0.5d0))))))
else
tmp = w0
end if
code = tmp
end function
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((h / l) <= -2e-278) {
tmp = w0 * Math.sqrt((1.0 - ((h / l) * ((D / d) * ((M * (D * (0.5 / d))) * (M * 0.5))))));
} else {
tmp = w0;
}
return tmp;
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): tmp = 0 if (h / l) <= -2e-278: tmp = w0 * math.sqrt((1.0 - ((h / l) * ((D / d) * ((M * (D * (0.5 / d))) * (M * 0.5)))))) else: tmp = w0 return tmp
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) tmp = 0.0 if (Float64(h / l) <= -2e-278) tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(D / d) * Float64(Float64(M * Float64(D * Float64(0.5 / d))) * Float64(M * 0.5))))))); else tmp = w0; end return tmp end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if ((h / l) <= -2e-278)
tmp = w0 * sqrt((1.0 - ((h / l) * ((D / d) * ((M * (D * (0.5 / d))) * (M * 0.5))))));
else
tmp = w0;
end
tmp_2 = tmp;
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(h / l), $MachinePrecision], -2e-278], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(N[(M * N[(D * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-278}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot \left(\frac{D}{d} \cdot \left(\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right) \cdot \left(M \cdot 0.5\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\end{array}
\end{array}
if (/.f64 h l) < -1.99999999999999988e-278Initial program 80.4%
Simplified81.8%
unpow281.8%
*-commutative81.8%
associate-*l/80.5%
associate-*r/81.2%
associate-*r*80.5%
*-commutative80.5%
associate-*l/79.2%
associate-*r/80.5%
times-frac79.2%
associate-/l*80.5%
div-inv80.5%
associate-/r*80.5%
metadata-eval80.5%
div-inv80.5%
metadata-eval80.5%
Applied egg-rr80.5%
if -1.99999999999999988e-278 < (/.f64 h l) Initial program 80.8%
Simplified80.8%
Taylor expanded in D around 0 92.2%
Final simplification85.5%
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 1.05e+58) w0 (* w0 (* (* (* M D) (* M D)) (* (/ (/ h l) (pow d 2.0)) -0.125)))))
assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.05e+58) {
tmp = w0;
} else {
tmp = w0 * (((M * D) * (M * D)) * (((h / l) / pow(d, 2.0)) * -0.125));
}
return tmp;
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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 <= 1.05d+58) then
tmp = w0
else
tmp = w0 * (((m * d) * (m * d)) * (((h / l) / (d_1 ** 2.0d0)) * (-0.125d0)))
end if
code = tmp
end function
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.05e+58) {
tmp = w0;
} else {
tmp = w0 * (((M * D) * (M * D)) * (((h / l) / Math.pow(d, 2.0)) * -0.125));
}
return tmp;
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.05e+58: tmp = w0 else: tmp = w0 * (((M * D) * (M * D)) * (((h / l) / math.pow(d, 2.0)) * -0.125)) return tmp
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.05e+58) tmp = w0; else tmp = Float64(w0 * Float64(Float64(Float64(M * D) * Float64(M * D)) * Float64(Float64(Float64(h / l) / (d ^ 2.0)) * -0.125))); end return tmp end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.05e+58)
tmp = w0;
else
tmp = w0 * (((M * D) * (M * D)) * (((h / l) / (d ^ 2.0)) * -0.125));
end
tmp_2 = tmp;
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.05e+58], w0, N[(w0 * N[(N[(N[(M * D), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(h / l), $MachinePrecision] / N[Power[d, 2.0], $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.05 \cdot 10^{+58}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \left(\frac{\frac{h}{\ell}}{{d}^{2}} \cdot -0.125\right)\right)\\
\end{array}
\end{array}
if M < 1.05000000000000006e58Initial program 81.4%
Simplified82.4%
Taylor expanded in D around 0 76.0%
if 1.05000000000000006e58 < M Initial program 76.7%
Simplified76.7%
Taylor expanded in D around 0 55.0%
+-commutative55.0%
*-commutative55.0%
fma-define55.0%
associate-*r*57.2%
unpow257.2%
unpow257.2%
swap-sqr68.1%
unpow268.1%
Simplified68.1%
Taylor expanded in D around inf 40.2%
*-commutative40.2%
associate-*r*40.2%
*-commutative40.2%
unpow240.2%
unpow240.2%
swap-sqr43.0%
unpow243.0%
*-commutative43.0%
associate-*r/38.8%
associate-*l*38.8%
*-commutative38.8%
associate-/r*36.5%
Simplified36.5%
unpow236.5%
*-commutative36.5%
*-commutative36.5%
Applied egg-rr36.5%
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (/ (* h (* (* (/ 0.5 d) (* M D)) (* (/ D d) (* M 0.5)))) l)))))
assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt((1.0 - ((h * (((0.5 / d) * (M * D)) * ((D / d) * (M * 0.5)))) / l)));
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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 - ((h * (((0.5d0 / d_1) * (m * d)) * ((d / d_1) * (m * 0.5d0)))) / l)))
end function
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0 * Math.sqrt((1.0 - ((h * (((0.5 / d) * (M * D)) * ((D / d) * (M * 0.5)))) / l)));
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): return w0 * math.sqrt((1.0 - ((h * (((0.5 / d) * (M * D)) * ((D / d) * (M * 0.5)))) / l)))
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(Float64(Float64(0.5 / d) * Float64(M * D)) * Float64(Float64(D / d) * Float64(M * 0.5)))) / l)))) end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0 * sqrt((1.0 - ((h * (((0.5 / d) * (M * D)) * ((D / d) * (M * 0.5)))) / l)));
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(N[(N[(0.5 / d), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
w0 \cdot \sqrt{1 - \frac{h \cdot \left(\left(\frac{0.5}{d} \cdot \left(M \cdot D\right)\right) \cdot \left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)\right)}{\ell}}
\end{array}
Initial program 80.6%
Simplified81.3%
unpow281.3%
*-commutative81.3%
associate-*l/80.6%
associate-*r/80.6%
associate-*r*79.9%
*-commutative79.9%
associate-*l/79.1%
associate-*r/79.9%
times-frac79.1%
associate-/l*79.9%
div-inv79.9%
associate-/r*79.9%
metadata-eval79.9%
div-inv79.9%
metadata-eval79.9%
Applied egg-rr79.9%
associate-*r/85.0%
associate-*l*85.7%
associate-*r*85.0%
Applied egg-rr85.0%
Final simplification85.0%
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 1.3e+90) w0 (/ 1.0 (/ l (* w0 l)))))
assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.3e+90) {
tmp = w0;
} else {
tmp = 1.0 / (l / (w0 * l));
}
return tmp;
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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 <= 1.3d+90) then
tmp = w0
else
tmp = 1.0d0 / (l / (w0 * l))
end if
code = tmp
end function
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 1.3e+90) {
tmp = w0;
} else {
tmp = 1.0 / (l / (w0 * l));
}
return tmp;
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 1.3e+90: tmp = w0 else: tmp = 1.0 / (l / (w0 * l)) return tmp
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 1.3e+90) tmp = w0; else tmp = Float64(1.0 / Float64(l / Float64(w0 * l))); end return tmp end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 1.3e+90)
tmp = w0;
else
tmp = 1.0 / (l / (w0 * l));
end
tmp_2 = tmp;
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.3e+90], w0, N[(1.0 / N[(l / N[(w0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.3 \cdot 10^{+90}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\ell}{w0 \cdot \ell}}\\
\end{array}
\end{array}
if M < 1.2999999999999999e90Initial program 81.4%
Simplified82.3%
Taylor expanded in D around 0 75.2%
if 1.2999999999999999e90 < M Initial program 76.0%
Simplified76.0%
Taylor expanded in D around 0 54.4%
+-commutative54.4%
*-commutative54.4%
fma-define54.4%
associate-*r*54.4%
unpow254.4%
unpow254.4%
swap-sqr67.9%
unpow267.9%
Simplified67.9%
Taylor expanded in l around 0 47.7%
fma-define47.7%
associate-*r*54.4%
*-commutative54.4%
unpow254.4%
unpow254.4%
swap-sqr68.1%
unpow268.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in D around 0 34.4%
clear-num34.3%
inv-pow34.3%
Applied egg-rr34.3%
unpow-134.3%
*-commutative34.3%
Simplified34.3%
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 7.8e+64) w0 (/ (* w0 l) l)))
assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 7.8e+64) {
tmp = w0;
} else {
tmp = (w0 * l) / l;
}
return tmp;
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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 <= 7.8d+64) then
tmp = w0
else
tmp = (w0 * l) / l
end if
code = tmp
end function
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 7.8e+64) {
tmp = w0;
} else {
tmp = (w0 * l) / l;
}
return tmp;
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 7.8e+64: tmp = w0 else: tmp = (w0 * l) / l return tmp
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 7.8e+64) tmp = w0; else tmp = Float64(Float64(w0 * l) / l); end return tmp end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 7.8e+64)
tmp = w0;
else
tmp = (w0 * l) / l;
end
tmp_2 = tmp;
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 7.8e+64], w0, N[(N[(w0 * l), $MachinePrecision] / l), $MachinePrecision]]
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.8 \cdot 10^{+64}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\frac{w0 \cdot \ell}{\ell}\\
\end{array}
\end{array}
if M < 7.7999999999999996e64Initial program 81.1%
Simplified82.0%
Taylor expanded in D around 0 75.3%
if 7.7999999999999996e64 < M Initial program 77.8%
Simplified77.8%
Taylor expanded in D around 0 52.8%
+-commutative52.8%
*-commutative52.8%
fma-define52.8%
associate-*r*55.3%
unpow255.3%
unpow255.3%
swap-sqr67.8%
unpow267.8%
Simplified67.8%
Taylor expanded in l around 0 46.6%
fma-define46.6%
associate-*r*52.8%
*-commutative52.8%
unpow252.8%
unpow252.8%
swap-sqr65.4%
unpow265.4%
*-commutative65.4%
*-commutative65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in D around 0 34.6%
Final simplification69.0%
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 (if (<= M 3.6e+25) w0 (* l (/ w0 l))))
assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.6e+25) {
tmp = w0;
} else {
tmp = l * (w0 / l);
}
return tmp;
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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 <= 3.6d+25) then
tmp = w0
else
tmp = l * (w0 / l)
end if
code = tmp
end function
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if (M <= 3.6e+25) {
tmp = w0;
} else {
tmp = l * (w0 / l);
}
return tmp;
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): tmp = 0 if M <= 3.6e+25: tmp = w0 else: tmp = l * (w0 / l) return tmp
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) tmp = 0.0 if (M <= 3.6e+25) tmp = w0; else tmp = Float64(l * Float64(w0 / l)); end return tmp end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp_2 = code(w0, M, D, h, l, d)
tmp = 0.0;
if (M <= 3.6e+25)
tmp = w0;
else
tmp = l * (w0 / l);
end
tmp_2 = tmp;
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 3.6e+25], w0, N[(l * N[(w0 / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.6 \cdot 10^{+25}:\\
\;\;\;\;w0\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{w0}{\ell}\\
\end{array}
\end{array}
if M < 3.60000000000000015e25Initial program 81.6%
Simplified82.5%
Taylor expanded in D around 0 75.7%
if 3.60000000000000015e25 < M Initial program 76.5%
Simplified76.5%
Taylor expanded in D around 0 56.6%
+-commutative56.6%
*-commutative56.6%
fma-define56.6%
associate-*r*58.6%
unpow258.6%
unpow258.6%
swap-sqr68.6%
unpow268.6%
Simplified68.6%
Taylor expanded in l around 0 45.8%
fma-define45.8%
associate-*r*50.8%
*-commutative50.8%
unpow250.8%
unpow250.8%
swap-sqr60.9%
unpow260.9%
*-commutative60.9%
*-commutative60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in D around 0 35.5%
associate-/l*43.1%
Applied egg-rr43.1%
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. (FPCore (w0 M D h l d) :precision binary64 w0)
assert(w0 < M && M < D && D < h && h < l && l < d);
double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function.
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
assert w0 < M && M < D && D < h && h < l && l < d;
public static double code(double w0, double M, double D, double h, double l, double d) {
return w0;
}
[w0, M, D, h, l, d] = sort([w0, M, D, h, l, d]) def code(w0, M, D, h, l, d): return w0
w0, M, D, h, l, d = sort([w0, M, D, h, l, d]) function code(w0, M, D, h, l, d) return w0 end
w0, M, D, h, l, d = num2cell(sort([w0, M, D, h, l, d])){:}
function tmp = code(w0, M, D, h, l, d)
tmp = w0;
end
NOTE: w0, M, D, h, l, and d should be sorted in increasing order before calling this function. code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
[w0, M, D, h, l, d] = \mathsf{sort}([w0, M, D, h, l, d])\\
\\
w0
\end{array}
Initial program 80.6%
Simplified81.3%
Taylor expanded in D around 0 69.0%
herbie shell --seed 2024132
(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))))))