
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ (* c0 (* d d)) (* (* D D) (* w h))))
(t_2 (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
(if (<= t_2 -1e-242)
(* t_0 (* 2.0 (/ (* c0 (/ d D)) (* (* w h) (/ D d)))))
(if (<= t_2 0.0)
(* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))
(if (<= t_2 INFINITY)
(* t_0 (* 2.0 (* (/ c0 (* w h)) (/ (/ d D) (/ D d)))))
(* (pow (/ (* D M) d) 2.0) (* h 0.25)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((D * D) * (w * h));
double t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -1e-242) {
tmp = t_0 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d))));
} else if (t_2 <= 0.0) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d))));
} else {
tmp = pow(((D * M) / d), 2.0) * (h * 0.25);
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((D * D) * (w * h));
double t_2 = t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -1e-242) {
tmp = t_0 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d))));
} else if (t_2 <= 0.0) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d))));
} else {
tmp = Math.pow(((D * M) / d), 2.0) * (h * 0.25);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((D * D) * (w * h)) t_2 = t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M)))) tmp = 0 if t_2 <= -1e-242: tmp = t_0 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d)))) elif t_2 <= 0.0: tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))) elif t_2 <= math.inf: tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d)))) else: tmp = math.pow(((D * M) / d), 2.0) * (h * 0.25) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(D * D) * Float64(w * h))) t_2 = Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) tmp = 0.0 if (t_2 <= -1e-242) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 * Float64(d / D)) / Float64(Float64(w * h) * Float64(D / d))))); elseif (t_2 <= 0.0) tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d)))); elseif (t_2 <= Inf) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d / D) / Float64(D / d))))); else tmp = Float64((Float64(Float64(D * M) / d) ^ 2.0) * Float64(h * 0.25)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((D * D) * (w * h)); t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M)))); tmp = 0.0; if (t_2 <= -1e-242) tmp = t_0 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d)))); elseif (t_2 <= 0.0) tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))); elseif (t_2 <= Inf) tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d)))); else tmp = (((D * M) / d) ^ 2.0) * (h * 0.25); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-242], N[(t$95$0 * N[(2.0 * N[(N[(c0 * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\\
t_2 := t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{-242}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d}{D}}{\left(w \cdot h\right) \cdot \frac{D}{d}}\right)\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d}{D}}{\frac{D}{d}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{D \cdot M}{d}\right)}^{2} \cdot \left(h \cdot 0.25\right)\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -1e-242Initial program 81.5%
Simplified81.1%
Taylor expanded in c0 around inf 84.2%
unpow284.2%
*-commutative84.2%
associate-/l/84.2%
unpow284.2%
unpow284.2%
associate-*l/83.9%
times-frac84.0%
associate-*l/84.0%
unpow284.0%
associate-*l/84.0%
associate-*r/83.9%
*-commutative83.9%
associate-*r/83.9%
unpow283.9%
Simplified83.9%
associate-/r*78.3%
div-inv78.3%
Applied egg-rr78.3%
pow278.3%
Applied egg-rr78.3%
un-div-inv78.3%
associate-/r*83.9%
clear-num83.9%
div-inv83.9%
frac-times86.8%
Applied egg-rr86.8%
if -1e-242 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 0.0Initial program 65.5%
Simplified63.7%
Taylor expanded in c0 around -inf 63.1%
fma-def63.1%
distribute-lft1-in63.1%
metadata-eval63.1%
unpow263.1%
unpow263.1%
associate-/l*63.1%
unpow263.1%
unpow263.1%
*-commutative63.1%
unpow263.1%
Simplified63.1%
Taylor expanded in c0 around 0 87.3%
associate-/l*87.3%
unpow287.3%
unpow287.3%
*-commutative87.3%
unpow287.3%
Simplified87.3%
div-inv87.1%
Applied egg-rr87.1%
Taylor expanded in d around 0 87.3%
unpow287.3%
*-commutative87.3%
associate-*r*87.1%
unpow287.1%
times-frac99.8%
Simplified99.8%
if 0.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 74.0%
Simplified76.8%
Taylor expanded in c0 around inf 74.2%
unpow274.2%
*-commutative74.2%
associate-/l/77.1%
unpow277.1%
unpow277.1%
associate-*l/77.1%
times-frac79.9%
associate-*l/80.0%
unpow280.0%
associate-*l/79.9%
associate-*r/82.8%
*-commutative82.8%
associate-*r/85.5%
unpow285.5%
Simplified85.5%
pow285.5%
associate-*r/82.8%
Applied egg-rr82.8%
*-un-lft-identity82.8%
associate-/l*85.5%
Applied egg-rr85.5%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified2.7%
Taylor expanded in c0 around -inf 2.8%
fma-def2.8%
distribute-lft1-in2.8%
metadata-eval2.8%
unpow22.8%
unpow22.8%
associate-/l*2.8%
unpow22.8%
unpow22.8%
*-commutative2.8%
unpow22.8%
Simplified2.8%
Taylor expanded in c0 around 0 42.6%
associate-/l*43.1%
unpow243.1%
unpow243.1%
*-commutative43.1%
unpow243.1%
Simplified43.1%
Taylor expanded in D around 0 42.6%
unpow242.6%
*-commutative42.6%
associate-*l/41.4%
unpow241.4%
unpow241.4%
*-commutative41.4%
times-frac56.3%
Simplified56.3%
expm1-log1p-u52.2%
expm1-udef45.6%
*-commutative45.6%
associate-*l*46.8%
pow246.8%
pow246.8%
pow-prod-down53.3%
Applied egg-rr53.3%
expm1-def64.5%
expm1-log1p69.9%
*-commutative69.9%
associate-*l*69.9%
*-commutative69.9%
associate-*l/72.0%
Simplified72.0%
Final simplification76.7%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* (* h 0.25) (pow (* M (/ D d)) 2.0))))
(if (<= d 5.2e-109)
t_2
(if (<= d 8200000000000.0)
(* t_1 (* 2.0 (* (* (/ c0 h) (/ 1.0 w)) t_0)))
(if (<= d 8.8e+131)
t_2
(if (<= d 1.35e+151)
(* t_1 (* 2.0 (* t_0 (/ (/ c0 h) w))))
(if (<= d 1.4e+273)
t_2
(* t_1 (* 2.0 (* (/ c0 (* w h)) (/ (/ d D) (/ D d))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = (h * 0.25) * pow((M * (D / d)), 2.0);
double tmp;
if (d <= 5.2e-109) {
tmp = t_2;
} else if (d <= 8200000000000.0) {
tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
} else if (d <= 8.8e+131) {
tmp = t_2;
} else if (d <= 1.35e+151) {
tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
} else if (d <= 1.4e+273) {
tmp = t_2;
} else {
tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
t_1 = c0 / (2.0d0 * w)
t_2 = (h * 0.25d0) * ((m * (d / d_1)) ** 2.0d0)
if (d_1 <= 5.2d-109) then
tmp = t_2
else if (d_1 <= 8200000000000.0d0) then
tmp = t_1 * (2.0d0 * (((c0 / h) * (1.0d0 / w)) * t_0))
else if (d_1 <= 8.8d+131) then
tmp = t_2
else if (d_1 <= 1.35d+151) then
tmp = t_1 * (2.0d0 * (t_0 * ((c0 / h) / w)))
else if (d_1 <= 1.4d+273) then
tmp = t_2
else
tmp = t_1 * (2.0d0 * ((c0 / (w * h)) * ((d_1 / d) / (d / d_1))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = (h * 0.25) * Math.pow((M * (D / d)), 2.0);
double tmp;
if (d <= 5.2e-109) {
tmp = t_2;
} else if (d <= 8200000000000.0) {
tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
} else if (d <= 8.8e+131) {
tmp = t_2;
} else if (d <= 1.35e+151) {
tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
} else if (d <= 1.4e+273) {
tmp = t_2;
} else {
tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) t_1 = c0 / (2.0 * w) t_2 = (h * 0.25) * math.pow((M * (D / d)), 2.0) tmp = 0 if d <= 5.2e-109: tmp = t_2 elif d <= 8200000000000.0: tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0)) elif d <= 8.8e+131: tmp = t_2 elif d <= 1.35e+151: tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w))) elif d <= 1.4e+273: tmp = t_2 else: tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(h * 0.25) * (Float64(M * Float64(D / d)) ^ 2.0)) tmp = 0.0 if (d <= 5.2e-109) tmp = t_2; elseif (d <= 8200000000000.0) tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(Float64(c0 / h) * Float64(1.0 / w)) * t_0))); elseif (d <= 8.8e+131) tmp = t_2; elseif (d <= 1.35e+151) tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(Float64(c0 / h) / w)))); elseif (d <= 1.4e+273) tmp = t_2; else tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d / D) / Float64(D / d))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); t_1 = c0 / (2.0 * w); t_2 = (h * 0.25) * ((M * (D / d)) ^ 2.0); tmp = 0.0; if (d <= 5.2e-109) tmp = t_2; elseif (d <= 8200000000000.0) tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0)); elseif (d <= 8.8e+131) tmp = t_2; elseif (d <= 1.35e+151) tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w))); elseif (d <= 1.4e+273) tmp = t_2; else tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(h * 0.25), $MachinePrecision] * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 5.2e-109], t$95$2, If[LessEqual[d, 8200000000000.0], N[(t$95$1 * N[(2.0 * N[(N[(N[(c0 / h), $MachinePrecision] * N[(1.0 / w), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.8e+131], t$95$2, If[LessEqual[d, 1.35e+151], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.4e+273], t$95$2, N[(t$95$1 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \left(h \cdot 0.25\right) \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\\
\mathbf{if}\;d \leq 5.2 \cdot 10^{-109}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq 8200000000000:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot t_0\right)\right)\\
\mathbf{elif}\;d \leq 8.8 \cdot 10^{+131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;d \leq 1.35 \cdot 10^{+151}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\
\mathbf{elif}\;d \leq 1.4 \cdot 10^{+273}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d}{D}}{\frac{D}{d}}\right)\right)\\
\end{array}
\end{array}
if d < 5.1999999999999997e-109 or 8.2e12 < d < 8.7999999999999995e131 or 1.3500000000000001e151 < d < 1.40000000000000009e273Initial program 21.0%
Simplified22.6%
Taylor expanded in c0 around -inf 5.1%
fma-def5.1%
distribute-lft1-in5.1%
metadata-eval5.1%
unpow25.1%
unpow25.1%
associate-/l*5.1%
unpow25.1%
unpow25.1%
*-commutative5.1%
unpow25.1%
Simplified5.1%
Taylor expanded in c0 around 0 36.3%
associate-/l*35.5%
unpow235.5%
unpow235.5%
*-commutative35.5%
unpow235.5%
Simplified35.5%
Taylor expanded in D around 0 36.3%
unpow236.3%
*-commutative36.3%
associate-*l/34.4%
unpow234.4%
unpow234.4%
*-commutative34.4%
times-frac45.9%
Simplified45.9%
expm1-log1p-u42.2%
expm1-udef36.6%
*-commutative36.6%
associate-*l*37.6%
pow237.6%
pow237.6%
pow-prod-down42.4%
Applied egg-rr42.4%
expm1-def52.3%
expm1-log1p56.9%
*-commutative56.9%
associate-*l*56.9%
Simplified56.9%
if 5.1999999999999997e-109 < d < 8.2e12Initial program 45.5%
Simplified55.8%
Taylor expanded in c0 around inf 51.2%
unpow251.2%
*-commutative51.2%
associate-/l/56.3%
unpow256.3%
unpow256.3%
associate-*l/61.5%
times-frac61.6%
associate-*l/61.6%
unpow261.6%
associate-*l/61.6%
associate-*r/61.5%
*-commutative61.5%
associate-*r/61.4%
unpow261.4%
Simplified61.4%
associate-/r*66.4%
div-inv66.3%
Applied egg-rr66.3%
pow266.3%
Applied egg-rr66.3%
if 8.7999999999999995e131 < d < 1.3500000000000001e151Initial program 50.0%
Simplified50.0%
Taylor expanded in c0 around inf 100.0%
unpow2100.0%
*-commutative100.0%
associate-/l/100.0%
unpow2100.0%
unpow2100.0%
associate-*l/100.0%
times-frac100.0%
associate-*l/100.0%
unpow2100.0%
associate-*l/100.0%
associate-*r/100.0%
*-commutative100.0%
associate-*r/100.0%
unpow2100.0%
Simplified100.0%
associate-/r*100.0%
div-inv100.0%
Applied egg-rr100.0%
pow2100.0%
Applied egg-rr100.0%
un-div-inv100.0%
Applied egg-rr100.0%
if 1.40000000000000009e273 < d Initial program 18.2%
Simplified18.2%
Taylor expanded in c0 around inf 55.0%
unpow255.0%
*-commutative55.0%
associate-/l/55.0%
unpow255.0%
unpow255.0%
associate-*l/55.0%
times-frac56.1%
associate-*l/56.1%
unpow256.1%
associate-*l/56.1%
associate-*r/64.2%
*-commutative64.2%
associate-*r/64.2%
unpow264.2%
Simplified64.2%
pow264.2%
associate-*r/64.2%
Applied egg-rr64.2%
*-un-lft-identity64.2%
associate-/l*64.2%
Applied egg-rr64.2%
Final simplification58.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D)))
(t_1 (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 (* w h)) t_0))))
(t_2 (* h (* M M))))
(if (<= (* M M) 4e-221)
(* 0.25 (/ t_2 t_0))
(if (<= (* M M) 5e-165)
t_1
(if (<= (* M M) 1e-48)
(* 0.25 (* t_2 (/ (* D (/ D d)) d)))
(if (or (<= (* M M) 500.0) (not (<= (* M M) 2e+144)))
t_1
(* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0));
double t_2 = h * (M * M);
double tmp;
if ((M * M) <= 4e-221) {
tmp = 0.25 * (t_2 / t_0);
} else if ((M * M) <= 5e-165) {
tmp = t_1;
} else if ((M * M) <= 1e-48) {
tmp = 0.25 * (t_2 * ((D * (D / d)) / d));
} else if (((M * M) <= 500.0) || !((M * M) <= 2e+144)) {
tmp = t_1;
} else {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
t_1 = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / (w * h)) * t_0))
t_2 = h * (m * m)
if ((m * m) <= 4d-221) then
tmp = 0.25d0 * (t_2 / t_0)
else if ((m * m) <= 5d-165) then
tmp = t_1
else if ((m * m) <= 1d-48) then
tmp = 0.25d0 * (t_2 * ((d * (d / d_1)) / d_1))
else if (((m * m) <= 500.0d0) .or. (.not. ((m * m) <= 2d+144))) then
tmp = t_1
else
tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0));
double t_2 = h * (M * M);
double tmp;
if ((M * M) <= 4e-221) {
tmp = 0.25 * (t_2 / t_0);
} else if ((M * M) <= 5e-165) {
tmp = t_1;
} else if ((M * M) <= 1e-48) {
tmp = 0.25 * (t_2 * ((D * (D / d)) / d));
} else if (((M * M) <= 500.0) || !((M * M) <= 2e+144)) {
tmp = t_1;
} else {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0)) t_2 = h * (M * M) tmp = 0 if (M * M) <= 4e-221: tmp = 0.25 * (t_2 / t_0) elif (M * M) <= 5e-165: tmp = t_1 elif (M * M) <= 1e-48: tmp = 0.25 * (t_2 * ((D * (D / d)) / d)) elif ((M * M) <= 500.0) or not ((M * M) <= 2e+144): tmp = t_1 else: tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * t_0))) t_2 = Float64(h * Float64(M * M)) tmp = 0.0 if (Float64(M * M) <= 4e-221) tmp = Float64(0.25 * Float64(t_2 / t_0)); elseif (Float64(M * M) <= 5e-165) tmp = t_1; elseif (Float64(M * M) <= 1e-48) tmp = Float64(0.25 * Float64(t_2 * Float64(Float64(D * Float64(D / d)) / d))); elseif ((Float64(M * M) <= 500.0) || !(Float64(M * M) <= 2e+144)) tmp = t_1; else tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0)); t_2 = h * (M * M); tmp = 0.0; if ((M * M) <= 4e-221) tmp = 0.25 * (t_2 / t_0); elseif ((M * M) <= 5e-165) tmp = t_1; elseif ((M * M) <= 1e-48) tmp = 0.25 * (t_2 * ((D * (D / d)) / d)); elseif (((M * M) <= 500.0) || ~(((M * M) <= 2e+144))) tmp = t_1; else tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 4e-221], N[(0.25 * N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 5e-165], t$95$1, If[LessEqual[N[(M * M), $MachinePrecision], 1e-48], N[(0.25 * N[(t$95$2 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(M * M), $MachinePrecision], 500.0], N[Not[LessEqual[N[(M * M), $MachinePrecision], 2e+144]], $MachinePrecision]], t$95$1, N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0\right)\right)\\
t_2 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\
\;\;\;\;0.25 \cdot \frac{t_2}{t_0}\\
\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;M \cdot M \leq 10^{-48}:\\
\;\;\;\;0.25 \cdot \left(t_2 \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\
\mathbf{elif}\;M \cdot M \leq 500 \lor \neg \left(M \cdot M \leq 2 \cdot 10^{+144}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 4.00000000000000007e-221Initial program 27.7%
Simplified29.8%
Taylor expanded in c0 around -inf 7.5%
fma-def7.5%
distribute-lft1-in7.5%
metadata-eval7.5%
unpow27.5%
unpow27.5%
associate-/l*7.5%
unpow27.5%
unpow27.5%
*-commutative7.5%
unpow27.5%
Simplified7.5%
Taylor expanded in c0 around 0 42.6%
associate-/l*42.6%
unpow242.6%
unpow242.6%
*-commutative42.6%
unpow242.6%
Simplified42.6%
Taylor expanded in D around 0 42.6%
*-commutative42.6%
unpow242.6%
*-commutative42.6%
associate-/l*41.6%
unpow241.6%
unpow241.6%
times-frac58.7%
unpow258.7%
Simplified58.7%
pow239.2%
Applied egg-rr58.7%
if 4.00000000000000007e-221 < (*.f64 M M) < 4.99999999999999981e-165 or 9.9999999999999997e-49 < (*.f64 M M) < 500 or 2.00000000000000005e144 < (*.f64 M M) Initial program 22.2%
Simplified24.9%
Taylor expanded in c0 around inf 45.9%
unpow245.9%
*-commutative45.9%
associate-/l/47.0%
unpow247.0%
unpow247.0%
associate-*l/48.6%
times-frac55.0%
associate-*l/55.0%
unpow255.0%
associate-*l/59.2%
associate-*r/59.0%
*-commutative59.0%
associate-*r/61.0%
unpow261.0%
Simplified61.0%
pow260.3%
Applied egg-rr61.0%
if 4.99999999999999981e-165 < (*.f64 M M) < 9.9999999999999997e-49Initial program 20.4%
Simplified20.7%
Taylor expanded in c0 around -inf 0.3%
fma-def0.3%
distribute-lft1-in0.3%
metadata-eval0.3%
unpow20.3%
unpow20.3%
associate-/l*0.3%
unpow20.3%
unpow20.3%
*-commutative0.3%
unpow20.3%
Simplified0.3%
Taylor expanded in c0 around 0 48.1%
associate-/l*48.3%
unpow248.3%
unpow248.3%
*-commutative48.3%
unpow248.3%
Simplified48.3%
Taylor expanded in D around 0 48.1%
unpow248.1%
*-commutative48.1%
associate-*l/51.6%
unpow251.6%
unpow251.6%
*-commutative51.6%
times-frac54.7%
Simplified54.7%
associate-*r/54.7%
Applied egg-rr54.7%
if 500 < (*.f64 M M) < 2.00000000000000005e144Initial program 14.9%
Simplified17.5%
Taylor expanded in c0 around -inf 8.9%
fma-def8.9%
distribute-lft1-in8.9%
metadata-eval8.9%
unpow28.9%
unpow28.9%
associate-/l*8.8%
unpow28.8%
unpow28.8%
*-commutative8.8%
unpow28.8%
Simplified8.8%
Taylor expanded in c0 around 0 47.5%
associate-/l*50.0%
unpow250.0%
unpow250.0%
*-commutative50.0%
unpow250.0%
Simplified50.0%
div-inv49.9%
Applied egg-rr49.9%
Taylor expanded in d around 0 50.0%
unpow250.0%
*-commutative50.0%
associate-*r*49.9%
unpow249.9%
times-frac56.2%
Simplified56.2%
Final simplification58.7%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* t_1 (* 2.0 (* (/ c0 (* w h)) t_0))))
(t_3 (* h (* M M))))
(if (<= (* M M) 4e-221)
(* 0.25 (/ t_3 t_0))
(if (<= (* M M) 5e-165)
t_2
(if (<= (* M M) 1e-48)
(* 0.25 (* t_3 (/ (* D (/ D d)) d)))
(if (<= (* M M) 500.0)
t_2
(if (<= (* M M) 2e+144)
(* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))
(* t_1 (* 2.0 (* t_0 (/ (/ c0 h) w)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
double t_3 = h * (M * M);
double tmp;
if ((M * M) <= 4e-221) {
tmp = 0.25 * (t_3 / t_0);
} else if ((M * M) <= 5e-165) {
tmp = t_2;
} else if ((M * M) <= 1e-48) {
tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
} else if ((M * M) <= 500.0) {
tmp = t_2;
} else if ((M * M) <= 2e+144) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
t_1 = c0 / (2.0d0 * w)
t_2 = t_1 * (2.0d0 * ((c0 / (w * h)) * t_0))
t_3 = h * (m * m)
if ((m * m) <= 4d-221) then
tmp = 0.25d0 * (t_3 / t_0)
else if ((m * m) <= 5d-165) then
tmp = t_2
else if ((m * m) <= 1d-48) then
tmp = 0.25d0 * (t_3 * ((d * (d / d_1)) / d_1))
else if ((m * m) <= 500.0d0) then
tmp = t_2
else if ((m * m) <= 2d+144) then
tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
else
tmp = t_1 * (2.0d0 * (t_0 * ((c0 / h) / w)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
double t_3 = h * (M * M);
double tmp;
if ((M * M) <= 4e-221) {
tmp = 0.25 * (t_3 / t_0);
} else if ((M * M) <= 5e-165) {
tmp = t_2;
} else if ((M * M) <= 1e-48) {
tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
} else if ((M * M) <= 500.0) {
tmp = t_2;
} else if ((M * M) <= 2e+144) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) t_1 = c0 / (2.0 * w) t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0)) t_3 = h * (M * M) tmp = 0 if (M * M) <= 4e-221: tmp = 0.25 * (t_3 / t_0) elif (M * M) <= 5e-165: tmp = t_2 elif (M * M) <= 1e-48: tmp = 0.25 * (t_3 * ((D * (D / d)) / d)) elif (M * M) <= 500.0: tmp = t_2 elif (M * M) <= 2e+144: tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))) else: tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * t_0))) t_3 = Float64(h * Float64(M * M)) tmp = 0.0 if (Float64(M * M) <= 4e-221) tmp = Float64(0.25 * Float64(t_3 / t_0)); elseif (Float64(M * M) <= 5e-165) tmp = t_2; elseif (Float64(M * M) <= 1e-48) tmp = Float64(0.25 * Float64(t_3 * Float64(Float64(D * Float64(D / d)) / d))); elseif (Float64(M * M) <= 500.0) tmp = t_2; elseif (Float64(M * M) <= 2e+144) tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(Float64(c0 / h) / w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); t_1 = c0 / (2.0 * w); t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0)); t_3 = h * (M * M); tmp = 0.0; if ((M * M) <= 4e-221) tmp = 0.25 * (t_3 / t_0); elseif ((M * M) <= 5e-165) tmp = t_2; elseif ((M * M) <= 1e-48) tmp = 0.25 * (t_3 * ((D * (D / d)) / d)); elseif ((M * M) <= 500.0) tmp = t_2; elseif ((M * M) <= 2e+144) tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))); else tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 4e-221], N[(0.25 * N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 5e-165], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 1e-48], N[(0.25 * N[(t$95$3 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 500.0], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 2e+144], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := t_1 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0\right)\right)\\
t_3 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\
\;\;\;\;0.25 \cdot \frac{t_3}{t_0}\\
\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;M \cdot M \leq 10^{-48}:\\
\;\;\;\;0.25 \cdot \left(t_3 \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\
\mathbf{elif}\;M \cdot M \leq 500:\\
\;\;\;\;t_2\\
\mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{+144}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 4.00000000000000007e-221Initial program 27.7%
Simplified29.8%
Taylor expanded in c0 around -inf 7.5%
fma-def7.5%
distribute-lft1-in7.5%
metadata-eval7.5%
unpow27.5%
unpow27.5%
associate-/l*7.5%
unpow27.5%
unpow27.5%
*-commutative7.5%
unpow27.5%
Simplified7.5%
Taylor expanded in c0 around 0 42.6%
associate-/l*42.6%
unpow242.6%
unpow242.6%
*-commutative42.6%
unpow242.6%
Simplified42.6%
Taylor expanded in D around 0 42.6%
*-commutative42.6%
unpow242.6%
*-commutative42.6%
associate-/l*41.6%
unpow241.6%
unpow241.6%
times-frac58.7%
unpow258.7%
Simplified58.7%
pow239.2%
Applied egg-rr58.7%
if 4.00000000000000007e-221 < (*.f64 M M) < 4.99999999999999981e-165 or 9.9999999999999997e-49 < (*.f64 M M) < 500Initial program 44.3%
Simplified51.0%
Taylor expanded in c0 around inf 44.7%
unpow244.7%
*-commutative44.7%
associate-/l/44.9%
unpow244.9%
unpow244.9%
associate-*l/51.4%
times-frac51.7%
associate-*l/51.7%
unpow251.7%
associate-*l/63.4%
associate-*r/67.2%
*-commutative67.2%
associate-*r/67.2%
unpow267.2%
Simplified67.2%
pow260.6%
Applied egg-rr67.2%
if 4.99999999999999981e-165 < (*.f64 M M) < 9.9999999999999997e-49Initial program 20.4%
Simplified20.7%
Taylor expanded in c0 around -inf 0.3%
fma-def0.3%
distribute-lft1-in0.3%
metadata-eval0.3%
unpow20.3%
unpow20.3%
associate-/l*0.3%
unpow20.3%
unpow20.3%
*-commutative0.3%
unpow20.3%
Simplified0.3%
Taylor expanded in c0 around 0 48.1%
associate-/l*48.3%
unpow248.3%
unpow248.3%
*-commutative48.3%
unpow248.3%
Simplified48.3%
Taylor expanded in D around 0 48.1%
unpow248.1%
*-commutative48.1%
associate-*l/51.6%
unpow251.6%
unpow251.6%
*-commutative51.6%
times-frac54.7%
Simplified54.7%
associate-*r/54.7%
Applied egg-rr54.7%
if 500 < (*.f64 M M) < 2.00000000000000005e144Initial program 14.9%
Simplified17.5%
Taylor expanded in c0 around -inf 8.9%
fma-def8.9%
distribute-lft1-in8.9%
metadata-eval8.9%
unpow28.9%
unpow28.9%
associate-/l*8.8%
unpow28.8%
unpow28.8%
*-commutative8.8%
unpow28.8%
Simplified8.8%
Taylor expanded in c0 around 0 47.5%
associate-/l*50.0%
unpow250.0%
unpow250.0%
*-commutative50.0%
unpow250.0%
Simplified50.0%
div-inv49.9%
Applied egg-rr49.9%
Taylor expanded in d around 0 50.0%
unpow250.0%
*-commutative50.0%
associate-*r*49.9%
unpow249.9%
times-frac56.2%
Simplified56.2%
if 2.00000000000000005e144 < (*.f64 M M) Initial program 14.4%
Simplified15.7%
Taylor expanded in c0 around inf 46.3%
unpow246.3%
*-commutative46.3%
associate-/l/47.7%
unpow247.7%
unpow247.7%
associate-*l/47.6%
times-frac56.1%
associate-*l/56.2%
unpow256.2%
associate-*l/57.7%
associate-*r/56.1%
*-commutative56.1%
associate-*r/58.8%
unpow258.8%
Simplified58.8%
associate-/r*60.2%
div-inv60.2%
Applied egg-rr60.2%
pow260.2%
Applied egg-rr60.2%
un-div-inv60.2%
Applied egg-rr60.2%
Final simplification59.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* t_1 (* 2.0 (* (/ c0 (* w h)) t_0))))
(t_3 (* h (* M M))))
(if (<= (* M M) 4e-221)
(* 0.25 (/ t_3 t_0))
(if (<= (* M M) 5e-165)
t_2
(if (<= (* M M) 1e-48)
(* 0.25 (* t_3 (/ (* D (/ D d)) d)))
(if (<= (* M M) 500.0)
t_2
(if (<= (* M M) 2e+144)
(* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))
(* t_1 (* 2.0 (/ (* c0 (/ d D)) (* (* w h) (/ D d))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
double t_3 = h * (M * M);
double tmp;
if ((M * M) <= 4e-221) {
tmp = 0.25 * (t_3 / t_0);
} else if ((M * M) <= 5e-165) {
tmp = t_2;
} else if ((M * M) <= 1e-48) {
tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
} else if ((M * M) <= 500.0) {
tmp = t_2;
} else if ((M * M) <= 2e+144) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
t_1 = c0 / (2.0d0 * w)
t_2 = t_1 * (2.0d0 * ((c0 / (w * h)) * t_0))
t_3 = h * (m * m)
if ((m * m) <= 4d-221) then
tmp = 0.25d0 * (t_3 / t_0)
else if ((m * m) <= 5d-165) then
tmp = t_2
else if ((m * m) <= 1d-48) then
tmp = 0.25d0 * (t_3 * ((d * (d / d_1)) / d_1))
else if ((m * m) <= 500.0d0) then
tmp = t_2
else if ((m * m) <= 2d+144) then
tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
else
tmp = t_1 * (2.0d0 * ((c0 * (d_1 / d)) / ((w * h) * (d / d_1))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
double t_3 = h * (M * M);
double tmp;
if ((M * M) <= 4e-221) {
tmp = 0.25 * (t_3 / t_0);
} else if ((M * M) <= 5e-165) {
tmp = t_2;
} else if ((M * M) <= 1e-48) {
tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
} else if ((M * M) <= 500.0) {
tmp = t_2;
} else if ((M * M) <= 2e+144) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) t_1 = c0 / (2.0 * w) t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0)) t_3 = h * (M * M) tmp = 0 if (M * M) <= 4e-221: tmp = 0.25 * (t_3 / t_0) elif (M * M) <= 5e-165: tmp = t_2 elif (M * M) <= 1e-48: tmp = 0.25 * (t_3 * ((D * (D / d)) / d)) elif (M * M) <= 500.0: tmp = t_2 elif (M * M) <= 2e+144: tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))) else: tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * t_0))) t_3 = Float64(h * Float64(M * M)) tmp = 0.0 if (Float64(M * M) <= 4e-221) tmp = Float64(0.25 * Float64(t_3 / t_0)); elseif (Float64(M * M) <= 5e-165) tmp = t_2; elseif (Float64(M * M) <= 1e-48) tmp = Float64(0.25 * Float64(t_3 * Float64(Float64(D * Float64(D / d)) / d))); elseif (Float64(M * M) <= 500.0) tmp = t_2; elseif (Float64(M * M) <= 2e+144) tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 * Float64(d / D)) / Float64(Float64(w * h) * Float64(D / d))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); t_1 = c0 / (2.0 * w); t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0)); t_3 = h * (M * M); tmp = 0.0; if ((M * M) <= 4e-221) tmp = 0.25 * (t_3 / t_0); elseif ((M * M) <= 5e-165) tmp = t_2; elseif ((M * M) <= 1e-48) tmp = 0.25 * (t_3 * ((D * (D / d)) / d)); elseif ((M * M) <= 500.0) tmp = t_2; elseif ((M * M) <= 2e+144) tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))); else tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 4e-221], N[(0.25 * N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 5e-165], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 1e-48], N[(0.25 * N[(t$95$3 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 500.0], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 2e+144], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[(c0 * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := t_1 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0\right)\right)\\
t_3 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\
\;\;\;\;0.25 \cdot \frac{t_3}{t_0}\\
\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;M \cdot M \leq 10^{-48}:\\
\;\;\;\;0.25 \cdot \left(t_3 \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\
\mathbf{elif}\;M \cdot M \leq 500:\\
\;\;\;\;t_2\\
\mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{+144}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d}{D}}{\left(w \cdot h\right) \cdot \frac{D}{d}}\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 4.00000000000000007e-221Initial program 27.7%
Simplified29.8%
Taylor expanded in c0 around -inf 7.5%
fma-def7.5%
distribute-lft1-in7.5%
metadata-eval7.5%
unpow27.5%
unpow27.5%
associate-/l*7.5%
unpow27.5%
unpow27.5%
*-commutative7.5%
unpow27.5%
Simplified7.5%
Taylor expanded in c0 around 0 42.6%
associate-/l*42.6%
unpow242.6%
unpow242.6%
*-commutative42.6%
unpow242.6%
Simplified42.6%
Taylor expanded in D around 0 42.6%
*-commutative42.6%
unpow242.6%
*-commutative42.6%
associate-/l*41.6%
unpow241.6%
unpow241.6%
times-frac58.7%
unpow258.7%
Simplified58.7%
pow239.2%
Applied egg-rr58.7%
if 4.00000000000000007e-221 < (*.f64 M M) < 4.99999999999999981e-165 or 9.9999999999999997e-49 < (*.f64 M M) < 500Initial program 44.3%
Simplified51.0%
Taylor expanded in c0 around inf 44.7%
unpow244.7%
*-commutative44.7%
associate-/l/44.9%
unpow244.9%
unpow244.9%
associate-*l/51.4%
times-frac51.7%
associate-*l/51.7%
unpow251.7%
associate-*l/63.4%
associate-*r/67.2%
*-commutative67.2%
associate-*r/67.2%
unpow267.2%
Simplified67.2%
pow260.6%
Applied egg-rr67.2%
if 4.99999999999999981e-165 < (*.f64 M M) < 9.9999999999999997e-49Initial program 20.4%
Simplified20.7%
Taylor expanded in c0 around -inf 0.3%
fma-def0.3%
distribute-lft1-in0.3%
metadata-eval0.3%
unpow20.3%
unpow20.3%
associate-/l*0.3%
unpow20.3%
unpow20.3%
*-commutative0.3%
unpow20.3%
Simplified0.3%
Taylor expanded in c0 around 0 48.1%
associate-/l*48.3%
unpow248.3%
unpow248.3%
*-commutative48.3%
unpow248.3%
Simplified48.3%
Taylor expanded in D around 0 48.1%
unpow248.1%
*-commutative48.1%
associate-*l/51.6%
unpow251.6%
unpow251.6%
*-commutative51.6%
times-frac54.7%
Simplified54.7%
associate-*r/54.7%
Applied egg-rr54.7%
if 500 < (*.f64 M M) < 2.00000000000000005e144Initial program 14.9%
Simplified17.5%
Taylor expanded in c0 around -inf 8.9%
fma-def8.9%
distribute-lft1-in8.9%
metadata-eval8.9%
unpow28.9%
unpow28.9%
associate-/l*8.8%
unpow28.8%
unpow28.8%
*-commutative8.8%
unpow28.8%
Simplified8.8%
Taylor expanded in c0 around 0 47.5%
associate-/l*50.0%
unpow250.0%
unpow250.0%
*-commutative50.0%
unpow250.0%
Simplified50.0%
div-inv49.9%
Applied egg-rr49.9%
Taylor expanded in d around 0 50.0%
unpow250.0%
*-commutative50.0%
associate-*r*49.9%
unpow249.9%
times-frac56.2%
Simplified56.2%
if 2.00000000000000005e144 < (*.f64 M M) Initial program 14.4%
Simplified15.7%
Taylor expanded in c0 around inf 46.3%
unpow246.3%
*-commutative46.3%
associate-/l/47.7%
unpow247.7%
unpow247.7%
associate-*l/47.6%
times-frac56.1%
associate-*l/56.2%
unpow256.2%
associate-*l/57.7%
associate-*r/56.1%
*-commutative56.1%
associate-*r/58.8%
unpow258.8%
Simplified58.8%
associate-/r*60.2%
div-inv60.2%
Applied egg-rr60.2%
pow260.2%
Applied egg-rr60.2%
un-div-inv60.2%
associate-/r*58.8%
clear-num58.8%
div-inv58.8%
frac-times61.7%
Applied egg-rr61.7%
Final simplification59.5%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* M M) 1e+190) (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D)))) (* (/ (* c0 c0) (* D D)) (/ (* d d) (* h (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1e+190) {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
} else {
tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((m * m) <= 1d+190) then
tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
else
tmp = ((c0 * c0) / (d * d)) * ((d_1 * d_1) / (h * (w * w)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1e+190) {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
} else {
tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 1e+190: tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))) else: tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 1e+190) tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D)))); else tmp = Float64(Float64(Float64(c0 * c0) / Float64(D * D)) * Float64(Float64(d * d) / Float64(h * Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 1e+190) tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))); else tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1e+190], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c0 * c0), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 10^{+190}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\
\end{array}
\end{array}
if (*.f64 M M) < 1.0000000000000001e190Initial program 25.4%
Simplified28.4%
Taylor expanded in c0 around -inf 5.4%
fma-def5.4%
distribute-lft1-in5.4%
metadata-eval5.4%
unpow25.4%
unpow25.4%
associate-/l*5.4%
unpow25.4%
unpow25.4%
*-commutative5.4%
unpow25.4%
Simplified5.4%
Taylor expanded in c0 around 0 40.6%
associate-/l*41.1%
unpow241.1%
unpow241.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
Taylor expanded in D around 0 40.6%
*-commutative40.6%
unpow240.6%
*-commutative40.6%
associate-/l*40.2%
unpow240.2%
unpow240.2%
times-frac51.9%
unpow251.9%
Simplified51.9%
pow239.8%
Applied egg-rr51.9%
if 1.0000000000000001e190 < (*.f64 M M) Initial program 15.8%
Simplified15.8%
Taylor expanded in c0 around inf 49.7%
unpow249.7%
*-commutative49.7%
associate-/l/49.7%
unpow249.7%
unpow249.7%
associate-*l/49.6%
times-frac57.4%
associate-*l/57.4%
unpow257.4%
associate-*l/59.0%
associate-*r/55.9%
*-commutative55.9%
associate-*r/58.8%
unpow258.8%
Simplified58.8%
associate-/r*60.4%
div-inv60.4%
Applied egg-rr60.4%
Taylor expanded in c0 around 0 46.2%
times-frac46.1%
unpow246.1%
unpow246.1%
unpow246.1%
unpow246.1%
Simplified46.1%
Final simplification50.4%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* M M) 1e+190) (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D)))) (/ (* (* d d) (* c0 c0)) (* (* D D) (* h (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1e+190) {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
} else {
tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((m * m) <= 1d+190) then
tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
else
tmp = ((d_1 * d_1) * (c0 * c0)) / ((d * d) * (h * (w * w)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1e+190) {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
} else {
tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 1e+190: tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))) else: tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 1e+190) tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D)))); else tmp = Float64(Float64(Float64(d * d) * Float64(c0 * c0)) / Float64(Float64(D * D) * Float64(h * Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 1e+190) tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))); else tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1e+190], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d * d), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 10^{+190}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}\\
\end{array}
\end{array}
if (*.f64 M M) < 1.0000000000000001e190Initial program 25.4%
Simplified28.4%
Taylor expanded in c0 around -inf 5.4%
fma-def5.4%
distribute-lft1-in5.4%
metadata-eval5.4%
unpow25.4%
unpow25.4%
associate-/l*5.4%
unpow25.4%
unpow25.4%
*-commutative5.4%
unpow25.4%
Simplified5.4%
Taylor expanded in c0 around 0 40.6%
associate-/l*41.1%
unpow241.1%
unpow241.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
Taylor expanded in D around 0 40.6%
*-commutative40.6%
unpow240.6%
*-commutative40.6%
associate-/l*40.2%
unpow240.2%
unpow240.2%
times-frac51.9%
unpow251.9%
Simplified51.9%
pow239.8%
Applied egg-rr51.9%
if 1.0000000000000001e190 < (*.f64 M M) Initial program 15.8%
Simplified15.8%
Taylor expanded in c0 around inf 49.7%
unpow249.7%
*-commutative49.7%
associate-/l/49.7%
unpow249.7%
unpow249.7%
associate-*l/49.6%
times-frac57.4%
associate-*l/57.4%
unpow257.4%
associate-*l/59.0%
associate-*r/55.9%
*-commutative55.9%
associate-*r/58.8%
unpow258.8%
Simplified58.8%
Taylor expanded in c0 around 0 46.2%
*-commutative46.2%
unpow246.2%
unpow246.2%
unpow246.2%
unpow246.2%
Simplified46.2%
Final simplification50.5%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* D D) 2e+127) (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d)))) (* 0.25 (* (* h (* M M)) (* (/ D d) (/ D d))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 2e+127) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((d * d) <= 2d+127) then
tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
else
tmp = 0.25d0 * ((h * (m * m)) * ((d / d_1) * (d / d_1)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 2e+127) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 2e+127: tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))) else: tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 2e+127) tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d)))); else tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) * Float64(Float64(D / d) * Float64(D / d)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 2e+127) tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))); else tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 2e+127], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 2 \cdot 10^{+127}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\end{array}
\end{array}
if (*.f64 D D) < 1.99999999999999991e127Initial program 23.5%
Simplified26.1%
Taylor expanded in c0 around -inf 4.5%
fma-def4.5%
distribute-lft1-in4.5%
metadata-eval4.5%
unpow24.5%
unpow24.5%
associate-/l*4.5%
unpow24.5%
unpow24.5%
*-commutative4.5%
unpow24.5%
Simplified4.5%
Taylor expanded in c0 around 0 36.2%
associate-/l*37.1%
unpow237.1%
unpow237.1%
*-commutative37.1%
unpow237.1%
Simplified37.1%
div-inv37.1%
Applied egg-rr37.1%
Taylor expanded in d around 0 37.1%
unpow237.1%
*-commutative37.1%
associate-*r*37.7%
unpow237.7%
times-frac48.8%
Simplified48.8%
if 1.99999999999999991e127 < (*.f64 D D) Initial program 21.1%
Simplified21.2%
Taylor expanded in c0 around -inf 8.6%
fma-def8.6%
distribute-lft1-in8.6%
metadata-eval8.6%
unpow28.6%
unpow28.6%
associate-/l*8.5%
unpow28.5%
unpow28.5%
*-commutative8.5%
unpow28.5%
Simplified8.5%
Taylor expanded in c0 around 0 31.6%
associate-/l*27.6%
unpow227.6%
unpow227.6%
*-commutative27.6%
unpow227.6%
Simplified27.6%
Taylor expanded in D around 0 31.6%
unpow231.6%
*-commutative31.6%
associate-*l/29.7%
unpow229.7%
unpow229.7%
*-commutative29.7%
times-frac53.9%
Simplified53.9%
Final simplification49.7%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* D D) 2e+127) (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d)))) (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 2e+127) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((d * d) <= 2d+127) then
tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
else
tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 2e+127) {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
} else {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 2e+127: tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))) else: tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 2e+127) tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d)))); else tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 2e+127) tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))); else tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 2e+127], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 2 \cdot 10^{+127}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\
\end{array}
\end{array}
if (*.f64 D D) < 1.99999999999999991e127Initial program 23.5%
Simplified26.1%
Taylor expanded in c0 around -inf 4.5%
fma-def4.5%
distribute-lft1-in4.5%
metadata-eval4.5%
unpow24.5%
unpow24.5%
associate-/l*4.5%
unpow24.5%
unpow24.5%
*-commutative4.5%
unpow24.5%
Simplified4.5%
Taylor expanded in c0 around 0 36.2%
associate-/l*37.1%
unpow237.1%
unpow237.1%
*-commutative37.1%
unpow237.1%
Simplified37.1%
div-inv37.1%
Applied egg-rr37.1%
Taylor expanded in d around 0 37.1%
unpow237.1%
*-commutative37.1%
associate-*r*37.7%
unpow237.7%
times-frac48.8%
Simplified48.8%
if 1.99999999999999991e127 < (*.f64 D D) Initial program 21.1%
Simplified21.2%
Taylor expanded in c0 around -inf 8.6%
fma-def8.6%
distribute-lft1-in8.6%
metadata-eval8.6%
unpow28.6%
unpow28.6%
associate-/l*8.5%
unpow28.5%
unpow28.5%
*-commutative8.5%
unpow28.5%
Simplified8.5%
Taylor expanded in c0 around 0 31.6%
associate-/l*27.6%
unpow227.6%
unpow227.6%
*-commutative27.6%
unpow227.6%
Simplified27.6%
Taylor expanded in D around 0 31.6%
*-commutative31.6%
unpow231.6%
*-commutative31.6%
associate-/l*29.7%
unpow229.7%
unpow229.7%
times-frac56.0%
unpow256.0%
Simplified56.0%
pow255.3%
Applied egg-rr56.0%
Final simplification50.1%
(FPCore (c0 w h D d M) :precision binary64 (if (<= M 7.8e-118) 0.0 (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 7.8e-118) {
tmp = 0.0;
} else {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 7.8d-118) then
tmp = 0.0d0
else
tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 7.8e-118) {
tmp = 0.0;
} else {
tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 7.8e-118: tmp = 0.0 else: tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 7.8e-118) tmp = 0.0; else tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 7.8e-118) tmp = 0.0; else tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 7.8e-118], 0.0, N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.8 \cdot 10^{-118}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\
\end{array}
\end{array}
if M < 7.80000000000000002e-118Initial program 23.8%
Simplified25.9%
Taylor expanded in c0 around -inf 4.2%
mul-1-neg4.2%
distribute-rgt-in4.2%
Simplified33.8%
Taylor expanded in c0 around 0 39.9%
if 7.80000000000000002e-118 < M Initial program 21.4%
Simplified23.6%
Taylor expanded in c0 around -inf 5.2%
fma-def5.2%
distribute-lft1-in5.2%
metadata-eval5.2%
unpow25.2%
unpow25.2%
associate-/l*5.1%
unpow25.1%
unpow25.1%
*-commutative5.1%
unpow25.1%
Simplified5.1%
Taylor expanded in c0 around 0 31.1%
associate-/l*29.9%
unpow229.9%
unpow229.9%
*-commutative29.9%
unpow229.9%
Simplified29.9%
div-inv29.9%
Applied egg-rr29.9%
Taylor expanded in d around 0 29.9%
unpow229.9%
*-commutative29.9%
associate-*r*31.3%
unpow231.3%
times-frac45.7%
Simplified45.7%
Final simplification41.7%
(FPCore (c0 w h D d M) :precision binary64 0.0)
double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
def code(c0, w, h, D, d, M): return 0.0
function code(c0, w, h, D, d, M) return 0.0 end
function tmp = code(c0, w, h, D, d, M) tmp = 0.0; end
code[c0_, w_, h_, D_, d_, M_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 23.0%
Simplified25.2%
Taylor expanded in c0 around -inf 2.9%
mul-1-neg2.9%
distribute-rgt-in2.9%
Simplified31.1%
Taylor expanded in c0 around 0 35.8%
Final simplification35.8%
herbie shell --seed 2023271
(FPCore (c0 w h D d M)
:name "Henrywood and Agarwal, Equation (13)"
:precision binary64
(* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))