
(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 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
INFINITY)
(/ (* c0 (* 2.0 (* (pow (/ d D) 2.0) (/ c0 (* w h))))) (* 2.0 w))
(* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
tmp = (c0 * (2.0 * (pow((d / D), 2.0) * (c0 / (w * h))))) / (2.0 * w);
} else {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
}
return tmp;
}
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));
double tmp;
if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = (c0 * (2.0 * (Math.pow((d / D), 2.0) * (c0 / (w * h))))) / (2.0 * w);
} else {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf: tmp = (c0 * (2.0 * (math.pow((d / D), 2.0) * (c0 / (w * h))))) / (2.0 * w) else: tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf) tmp = Float64(Float64(c0 * Float64(2.0 * Float64((Float64(d / D) ^ 2.0) * Float64(c0 / Float64(w * h))))) / Float64(2.0 * w)); else tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf) tmp = (c0 * (2.0 * (((d / D) ^ 2.0) * (c0 / (w * h))))) / (2.0 * w); else tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); end tmp_2 = tmp; 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]}, If[LessEqual[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], Infinity], N[(N[(c0 * N[(2.0 * N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $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)}\\
\mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\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))))) < +inf.0Initial program 71.3%
Simplified71.0%
Taylor expanded in c0 around inf 73.5%
associate-*r*72.2%
*-commutative72.2%
unpow272.2%
*-commutative72.2%
associate-*r/71.5%
*-commutative71.5%
unpow271.5%
*-commutative71.5%
associate-*r*72.8%
associate-/r*73.6%
associate-*r/74.3%
unpow274.3%
associate-/r*78.0%
unpow278.0%
associate-*l/78.0%
associate-*r/80.2%
unpow280.2%
*-commutative80.2%
Simplified80.2%
associate-*l/80.2%
associate-/r*80.6%
*-commutative80.6%
*-commutative80.6%
Applied egg-rr80.6%
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%
Simplified0.6%
Taylor expanded in c0 around -inf 2.4%
+-commutative2.4%
fma-def2.4%
times-frac3.5%
unpow23.5%
unpow23.5%
*-commutative3.5%
unpow23.5%
mul-1-neg3.5%
distribute-rgt-in1.8%
Simplified26.7%
Taylor expanded in c0 around 0 39.8%
associate-/l*39.2%
unpow239.2%
unpow239.2%
*-commutative39.2%
unpow239.2%
Simplified39.2%
Taylor expanded in D around 0 39.8%
unpow239.8%
*-commutative39.8%
unpow239.8%
associate-*l/39.2%
unpow239.2%
*-commutative39.2%
associate-*r*42.9%
times-frac52.9%
Simplified52.9%
Final simplification62.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ (* d d) (* w h)) (/ c0 (* D D)))))))
(if (<= (* d d) 5e-187)
(* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d))))
(if (<= (* d d) 2e+108)
t_0
(if (<= (* d d) 1e+221)
(* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M))))
(if (<= (* d d) 1e+233) t_0 0.0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (w * h)) * (c0 / (D * D))));
double tmp;
if ((d * d) <= 5e-187) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else if ((d * d) <= 2e+108) {
tmp = t_0;
} else if ((d * d) <= 1e+221) {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
} else if ((d * d) <= 1e+233) {
tmp = t_0;
} else {
tmp = 0.0;
}
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) :: tmp
t_0 = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 * d_1) / (w * h)) * (c0 / (d * d))))
if ((d_1 * d_1) <= 5d-187) then
tmp = 0.25d0 * ((m * (h * m)) * ((d / d_1) * (d / d_1)))
else if ((d_1 * d_1) <= 2d+108) then
tmp = t_0
else if ((d_1 * d_1) <= 1d+221) then
tmp = 0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))
else if ((d_1 * d_1) <= 1d+233) then
tmp = t_0
else
tmp = 0.0d0
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 = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (w * h)) * (c0 / (D * D))));
double tmp;
if ((d * d) <= 5e-187) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else if ((d * d) <= 2e+108) {
tmp = t_0;
} else if ((d * d) <= 1e+221) {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
} else if ((d * d) <= 1e+233) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (w * h)) * (c0 / (D * D)))) tmp = 0 if (d * d) <= 5e-187: tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))) elif (d * d) <= 2e+108: tmp = t_0 elif (d * d) <= 1e+221: tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))) elif (d * d) <= 1e+233: tmp = t_0 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d * d) / Float64(w * h)) * Float64(c0 / Float64(D * D))))) tmp = 0.0 if (Float64(d * d) <= 5e-187) tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))); elseif (Float64(d * d) <= 2e+108) tmp = t_0; elseif (Float64(d * d) <= 1e+221) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))); elseif (Float64(d * d) <= 1e+233) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (w * h)) * (c0 / (D * D)))); tmp = 0.0; if ((d * d) <= 5e-187) tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); elseif ((d * d) <= 2e+108) tmp = t_0; elseif ((d * d) <= 1e+221) tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))); elseif ((d * d) <= 1e+233) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(d * d), $MachinePrecision], 5e-187], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 2e+108], t$95$0, If[LessEqual[N[(d * d), $MachinePrecision], 1e+221], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e+233], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{d \cdot d}{w \cdot h} \cdot \frac{c0}{D \cdot D}\right)\right)\\
\mathbf{if}\;d \cdot d \leq 5 \cdot 10^{-187}:\\
\;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\mathbf{elif}\;d \cdot d \leq 2 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \cdot d \leq 10^{+221}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\\
\mathbf{elif}\;d \cdot d \leq 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 d d) < 4.9999999999999996e-187Initial program 9.4%
Simplified9.3%
Taylor expanded in c0 around -inf 0.4%
+-commutative0.4%
fma-def0.4%
times-frac0.4%
unpow20.4%
unpow20.4%
*-commutative0.4%
unpow20.4%
mul-1-neg0.4%
distribute-rgt-in0.4%
Simplified14.1%
Taylor expanded in c0 around 0 23.3%
associate-/l*23.2%
unpow223.2%
unpow223.2%
*-commutative23.2%
unpow223.2%
Simplified23.2%
Taylor expanded in D around 0 23.3%
unpow223.3%
*-commutative23.3%
unpow223.3%
associate-*l/23.1%
unpow223.1%
*-commutative23.1%
associate-*r*23.1%
times-frac43.3%
Simplified43.3%
if 4.9999999999999996e-187 < (*.f64 d d) < 2.0000000000000001e108 or 1e221 < (*.f64 d d) < 9.99999999999999974e232Initial program 41.9%
Simplified43.4%
Taylor expanded in c0 around inf 50.7%
associate-*r*49.1%
*-commutative49.1%
unpow249.1%
*-commutative49.1%
associate-*r/49.1%
*-commutative49.1%
unpow249.1%
*-commutative49.1%
associate-*r*50.8%
associate-/r*51.8%
associate-*r/51.8%
unpow251.8%
associate-/r*53.8%
unpow253.8%
associate-*l/53.8%
associate-*r/53.8%
unpow253.8%
*-commutative53.8%
Simplified55.5%
associate-*l/54.1%
Applied egg-rr54.1%
Taylor expanded in c0 around 0 50.7%
unpow250.7%
times-frac51.3%
unpow251.3%
Simplified51.3%
if 2.0000000000000001e108 < (*.f64 d d) < 1e221Initial program 21.6%
Simplified21.6%
Taylor expanded in c0 around -inf 0.4%
+-commutative0.4%
fma-def0.4%
times-frac3.5%
unpow23.5%
unpow23.5%
*-commutative3.5%
unpow23.5%
mul-1-neg3.5%
distribute-rgt-in0.1%
Simplified28.3%
Taylor expanded in c0 around 0 48.2%
associate-/l*45.1%
unpow245.1%
unpow245.1%
*-commutative45.1%
unpow245.1%
Simplified45.1%
Taylor expanded in d around 0 45.1%
unpow245.1%
unpow245.1%
*-commutative45.1%
associate-*r*51.3%
times-frac51.4%
Simplified51.4%
if 9.99999999999999974e232 < (*.f64 d d) Initial program 20.3%
Simplified20.3%
Taylor expanded in c0 around -inf 2.6%
mul-1-neg2.6%
distribute-rgt-in1.7%
Simplified38.8%
Taylor expanded in c0 around 0 43.2%
Final simplification46.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* d d) (* w h))) (t_1 (/ c0 (* 2.0 w))))
(if (<= (* d d) 5e-187)
(* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d))))
(if (<= (* d d) 2e+108)
(* t_1 (* 2.0 (* (/ (/ c0 D) D) t_0)))
(if (<= (* d d) 1e+221)
(* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M))))
(if (<= (* d d) 1e+233)
(* t_1 (* 2.0 (* t_0 (/ c0 (* D D)))))
0.0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d * d) / (w * h);
double t_1 = c0 / (2.0 * w);
double tmp;
if ((d * d) <= 5e-187) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else if ((d * d) <= 2e+108) {
tmp = t_1 * (2.0 * (((c0 / D) / D) * t_0));
} else if ((d * d) <= 1e+221) {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
} else if ((d * d) <= 1e+233) {
tmp = t_1 * (2.0 * (t_0 * (c0 / (D * D))));
} else {
tmp = 0.0;
}
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) :: tmp
t_0 = (d_1 * d_1) / (w * h)
t_1 = c0 / (2.0d0 * w)
if ((d_1 * d_1) <= 5d-187) then
tmp = 0.25d0 * ((m * (h * m)) * ((d / d_1) * (d / d_1)))
else if ((d_1 * d_1) <= 2d+108) then
tmp = t_1 * (2.0d0 * (((c0 / d) / d) * t_0))
else if ((d_1 * d_1) <= 1d+221) then
tmp = 0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))
else if ((d_1 * d_1) <= 1d+233) then
tmp = t_1 * (2.0d0 * (t_0 * (c0 / (d * d))))
else
tmp = 0.0d0
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) / (w * h);
double t_1 = c0 / (2.0 * w);
double tmp;
if ((d * d) <= 5e-187) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else if ((d * d) <= 2e+108) {
tmp = t_1 * (2.0 * (((c0 / D) / D) * t_0));
} else if ((d * d) <= 1e+221) {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
} else if ((d * d) <= 1e+233) {
tmp = t_1 * (2.0 * (t_0 * (c0 / (D * D))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d * d) / (w * h) t_1 = c0 / (2.0 * w) tmp = 0 if (d * d) <= 5e-187: tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))) elif (d * d) <= 2e+108: tmp = t_1 * (2.0 * (((c0 / D) / D) * t_0)) elif (d * d) <= 1e+221: tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))) elif (d * d) <= 1e+233: tmp = t_1 * (2.0 * (t_0 * (c0 / (D * D)))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d * d) / Float64(w * h)) t_1 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (Float64(d * d) <= 5e-187) tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))); elseif (Float64(d * d) <= 2e+108) tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(Float64(c0 / D) / D) * t_0))); elseif (Float64(d * d) <= 1e+221) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))); elseif (Float64(d * d) <= 1e+233) tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(c0 / Float64(D * D))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d * d) / (w * h); t_1 = c0 / (2.0 * w); tmp = 0.0; if ((d * d) <= 5e-187) tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); elseif ((d * d) <= 2e+108) tmp = t_1 * (2.0 * (((c0 / D) / D) * t_0)); elseif ((d * d) <= 1e+221) tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))); elseif ((d * d) <= 1e+233) tmp = t_1 * (2.0 * (t_0 * (c0 / (D * D)))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(d * d), $MachinePrecision], 5e-187], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 2e+108], N[(t$95$1 * N[(2.0 * N[(N[(N[(c0 / D), $MachinePrecision] / D), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e+221], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e+233], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d \cdot d}{w \cdot h}\\
t_1 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \cdot d \leq 5 \cdot 10^{-187}:\\
\;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\mathbf{elif}\;d \cdot d \leq 2 \cdot 10^{+108}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\frac{\frac{c0}{D}}{D} \cdot t_0\right)\right)\\
\mathbf{elif}\;d \cdot d \leq 10^{+221}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\\
\mathbf{elif}\;d \cdot d \leq 10^{+233}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{c0}{D \cdot D}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 d d) < 4.9999999999999996e-187Initial program 9.4%
Simplified9.3%
Taylor expanded in c0 around -inf 0.4%
+-commutative0.4%
fma-def0.4%
times-frac0.4%
unpow20.4%
unpow20.4%
*-commutative0.4%
unpow20.4%
mul-1-neg0.4%
distribute-rgt-in0.4%
Simplified14.1%
Taylor expanded in c0 around 0 23.3%
associate-/l*23.2%
unpow223.2%
unpow223.2%
*-commutative23.2%
unpow223.2%
Simplified23.2%
Taylor expanded in D around 0 23.3%
unpow223.3%
*-commutative23.3%
unpow223.3%
associate-*l/23.1%
unpow223.1%
*-commutative23.1%
associate-*r*23.1%
times-frac43.3%
Simplified43.3%
if 4.9999999999999996e-187 < (*.f64 d d) < 2.0000000000000001e108Initial program 38.0%
Simplified39.7%
Taylor expanded in c0 around inf 48.0%
associate-*r*44.3%
*-commutative44.3%
unpow244.3%
*-commutative44.3%
associate-*r/44.4%
*-commutative44.4%
unpow244.4%
*-commutative44.4%
associate-*r*48.0%
associate-/r*49.3%
associate-*r/49.2%
unpow249.2%
associate-/r*51.4%
unpow251.4%
associate-*l/51.5%
associate-*r/51.5%
unpow251.5%
*-commutative51.5%
Simplified53.4%
associate-*l/51.8%
Applied egg-rr51.8%
Taylor expanded in c0 around 0 48.0%
unpow248.0%
times-frac48.7%
unpow248.7%
Simplified48.7%
Taylor expanded in c0 around 0 48.7%
unpow248.7%
associate-/r*52.9%
Simplified52.9%
if 2.0000000000000001e108 < (*.f64 d d) < 1e221Initial program 21.6%
Simplified21.6%
Taylor expanded in c0 around -inf 0.4%
+-commutative0.4%
fma-def0.4%
times-frac3.5%
unpow23.5%
unpow23.5%
*-commutative3.5%
unpow23.5%
mul-1-neg3.5%
distribute-rgt-in0.1%
Simplified28.3%
Taylor expanded in c0 around 0 48.2%
associate-/l*45.1%
unpow245.1%
unpow245.1%
*-commutative45.1%
unpow245.1%
Simplified45.1%
Taylor expanded in d around 0 45.1%
unpow245.1%
unpow245.1%
*-commutative45.1%
associate-*r*51.3%
times-frac51.4%
Simplified51.4%
if 1e221 < (*.f64 d d) < 9.99999999999999974e232Initial program 71.8%
Simplified71.4%
Taylor expanded in c0 around inf 72.1%
associate-*r*85.7%
*-commutative85.7%
unpow285.7%
*-commutative85.7%
associate-*r/85.9%
*-commutative85.9%
unpow285.9%
*-commutative85.9%
associate-*r*72.1%
associate-/r*71.7%
associate-*r/71.7%
unpow271.7%
associate-/r*71.7%
unpow271.7%
associate-*l/71.7%
associate-*r/71.7%
unpow271.7%
*-commutative71.7%
Simplified71.7%
associate-*l/72.1%
Applied egg-rr72.1%
Taylor expanded in c0 around 0 72.1%
unpow272.1%
times-frac71.7%
unpow271.7%
Simplified71.7%
if 9.99999999999999974e232 < (*.f64 d d) Initial program 20.3%
Simplified20.3%
Taylor expanded in c0 around -inf 2.6%
mul-1-neg2.6%
distribute-rgt-in1.7%
Simplified38.8%
Taylor expanded in c0 around 0 43.2%
Final simplification47.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0
(* (/ c0 (* 2.0 w)) (* 2.0 (* (* (/ d D) (/ d D)) (/ (/ c0 w) h))))))
(if (<= (* M M) 2e-295)
0.0
(if (<= (* M M) 2e-212)
t_0
(if (<= (* M M) 5e-186)
0.0
(if (<= (* M M) 4e+294)
t_0
(* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / w) / h)));
double tmp;
if ((M * M) <= 2e-295) {
tmp = 0.0;
} else if ((M * M) <= 2e-212) {
tmp = t_0;
} else if ((M * M) <= 5e-186) {
tmp = 0.0;
} else if ((M * M) <= 4e+294) {
tmp = t_0;
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
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) :: tmp
t_0 = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 / d) * (d_1 / d)) * ((c0 / w) / h)))
if ((m * m) <= 2d-295) then
tmp = 0.0d0
else if ((m * m) <= 2d-212) then
tmp = t_0
else if ((m * m) <= 5d-186) then
tmp = 0.0d0
else if ((m * m) <= 4d+294) then
tmp = t_0
else
tmp = 0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))
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 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / w) / h)));
double tmp;
if ((M * M) <= 2e-295) {
tmp = 0.0;
} else if ((M * M) <= 2e-212) {
tmp = t_0;
} else if ((M * M) <= 5e-186) {
tmp = 0.0;
} else if ((M * M) <= 4e+294) {
tmp = t_0;
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / w) / h))) tmp = 0 if (M * M) <= 2e-295: tmp = 0.0 elif (M * M) <= 2e-212: tmp = t_0 elif (M * M) <= 5e-186: tmp = 0.0 elif (M * M) <= 4e+294: tmp = t_0 else: tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 / w) / h)))) tmp = 0.0 if (Float64(M * M) <= 2e-295) tmp = 0.0; elseif (Float64(M * M) <= 2e-212) tmp = t_0; elseif (Float64(M * M) <= 5e-186) tmp = 0.0; elseif (Float64(M * M) <= 4e+294) tmp = t_0; else tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * ((c0 / w) / h))); tmp = 0.0; if ((M * M) <= 2e-295) tmp = 0.0; elseif ((M * M) <= 2e-212) tmp = t_0; elseif ((M * M) <= 5e-186) tmp = 0.0; elseif ((M * M) <= 4e+294) tmp = t_0; else tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 2e-295], 0.0, If[LessEqual[N[(M * M), $MachinePrecision], 2e-212], t$95$0, If[LessEqual[N[(M * M), $MachinePrecision], 5e-186], 0.0, If[LessEqual[N[(M * M), $MachinePrecision], 4e+294], t$95$0, N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\
\mathbf{if}\;M \cdot M \leq 2 \cdot 10^{-295}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{-212}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-186}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \cdot M \leq 4 \cdot 10^{+294}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\\
\end{array}
\end{array}
if (*.f64 M M) < 2.00000000000000012e-295 or 1.99999999999999991e-212 < (*.f64 M M) < 5e-186Initial program 23.9%
Simplified24.8%
Taylor expanded in c0 around -inf 5.9%
mul-1-neg5.9%
distribute-rgt-in3.8%
Simplified44.3%
Taylor expanded in c0 around 0 51.9%
if 2.00000000000000012e-295 < (*.f64 M M) < 1.99999999999999991e-212 or 5e-186 < (*.f64 M M) < 4.00000000000000027e294Initial program 34.8%
Simplified34.8%
Taylor expanded in c0 around inf 36.3%
associate-*r*36.4%
*-commutative36.4%
unpow236.4%
*-commutative36.4%
associate-*r/35.9%
*-commutative35.9%
unpow235.9%
*-commutative35.9%
associate-*r*35.8%
associate-/r*36.5%
associate-*r/37.1%
unpow237.1%
associate-/r*40.3%
unpow240.3%
associate-*l/46.6%
associate-*r/47.6%
unpow247.6%
*-commutative47.6%
Simplified49.3%
unpow249.5%
Applied egg-rr49.3%
if 4.00000000000000027e294 < (*.f64 M M) Initial program 0.0%
Simplified0.0%
Taylor expanded in c0 around -inf 0.1%
+-commutative0.1%
fma-def0.1%
times-frac1.9%
unpow21.9%
unpow21.9%
*-commutative1.9%
unpow21.9%
mul-1-neg1.9%
distribute-rgt-in1.9%
Simplified4.0%
Taylor expanded in c0 around 0 10.3%
associate-/l*10.3%
unpow210.3%
unpow210.3%
*-commutative10.3%
unpow210.3%
Simplified10.3%
Taylor expanded in d around 0 10.3%
unpow210.3%
unpow210.3%
*-commutative10.3%
associate-*r*25.7%
times-frac46.4%
Simplified46.4%
Final simplification49.7%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= w -4.3e-60)
(* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d))))
(if (or (<= w 1.3e-305) (not (<= w 1.25e-251)))
(* (/ c0 (* 2.0 w)) (* 2.0 (/ (* (/ c0 w) (* (/ d D) (/ d D))) h)))
(* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (w <= -4.3e-60) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else if ((w <= 1.3e-305) || !(w <= 1.25e-251)) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) * ((d / D) * (d / D))) / h));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
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 (w <= (-4.3d-60)) then
tmp = 0.25d0 * ((m * (h * m)) * ((d / d_1) * (d / d_1)))
else if ((w <= 1.3d-305) .or. (.not. (w <= 1.25d-251))) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((c0 / w) * ((d_1 / d) * (d_1 / d))) / h))
else
tmp = 0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))
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 (w <= -4.3e-60) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else if ((w <= 1.3e-305) || !(w <= 1.25e-251)) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) * ((d / D) * (d / D))) / h));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if w <= -4.3e-60: tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))) elif (w <= 1.3e-305) or not (w <= 1.25e-251): tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) * ((d / D) * (d / D))) / h)) else: tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (w <= -4.3e-60) tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))); elseif ((w <= 1.3e-305) || !(w <= 1.25e-251)) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(d / D))) / h))); else tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (w <= -4.3e-60) tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); elseif ((w <= 1.3e-305) || ~((w <= 1.25e-251))) tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) * ((d / D) * (d / D))) / h)); else tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[w, -4.3e-60], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, 1.3e-305], N[Not[LessEqual[w, 1.25e-251]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -4.3 \cdot 10^{-60}:\\
\;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\mathbf{elif}\;w \leq 1.3 \cdot 10^{-305} \lor \neg \left(w \leq 1.25 \cdot 10^{-251}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)}{h}\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\\
\end{array}
\end{array}
if w < -4.3000000000000001e-60Initial program 21.0%
Simplified20.9%
Taylor expanded in c0 around -inf 5.4%
+-commutative5.4%
fma-def5.4%
times-frac7.0%
unpow27.0%
unpow27.0%
*-commutative7.0%
unpow27.0%
mul-1-neg7.0%
distribute-rgt-in5.4%
Simplified31.0%
Taylor expanded in c0 around 0 36.0%
associate-/l*35.9%
unpow235.9%
unpow235.9%
*-commutative35.9%
unpow235.9%
Simplified35.9%
Taylor expanded in D around 0 36.0%
unpow236.0%
*-commutative36.0%
unpow236.0%
associate-*l/35.8%
unpow235.8%
*-commutative35.8%
associate-*r*37.7%
times-frac41.7%
Simplified41.7%
if -4.3000000000000001e-60 < w < 1.3000000000000001e-305 or 1.2500000000000001e-251 < w Initial program 26.1%
Simplified26.6%
Taylor expanded in c0 around inf 35.3%
associate-*r*36.0%
*-commutative36.0%
unpow236.0%
*-commutative36.0%
associate-*r/36.0%
*-commutative36.0%
unpow236.0%
*-commutative36.0%
associate-*r*35.4%
associate-/r*35.4%
associate-*r/35.4%
unpow235.4%
associate-/r*40.6%
unpow240.6%
associate-*l/46.9%
associate-*r/48.0%
unpow248.0%
*-commutative48.0%
Simplified49.8%
associate-*l/50.5%
Applied egg-rr50.5%
unpow250.5%
Applied egg-rr50.5%
if 1.3000000000000001e-305 < w < 1.2500000000000001e-251Initial program 10.5%
Simplified10.4%
Taylor expanded in c0 around -inf 0.3%
+-commutative0.3%
fma-def0.3%
times-frac0.3%
unpow20.3%
unpow20.3%
*-commutative0.3%
unpow20.3%
mul-1-neg0.3%
distribute-rgt-in0.3%
Simplified26.6%
Taylor expanded in c0 around 0 58.5%
associate-/l*58.5%
unpow258.5%
unpow258.5%
*-commutative58.5%
unpow258.5%
Simplified58.5%
Taylor expanded in d around 0 58.5%
unpow258.5%
unpow258.5%
*-commutative58.5%
associate-*r*63.8%
times-frac74.2%
Simplified74.2%
Final simplification50.1%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 5.5e-93)
0.0
(if (<= M 3e-12)
(/ (* c0 c0) (/ (* (* D D) (* h (* w w))) (* d d)))
(if (<= M 2.25e+157)
(* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d))))
(* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 5.5e-93) {
tmp = 0.0;
} else if (M <= 3e-12) {
tmp = (c0 * c0) / (((D * D) * (h * (w * w))) / (d * d));
} else if (M <= 2.25e+157) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
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 <= 5.5d-93) then
tmp = 0.0d0
else if (m <= 3d-12) then
tmp = (c0 * c0) / (((d * d) * (h * (w * w))) / (d_1 * d_1))
else if (m <= 2.25d+157) then
tmp = 0.25d0 * ((m * (h * m)) * ((d / d_1) * (d / d_1)))
else
tmp = 0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))
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 <= 5.5e-93) {
tmp = 0.0;
} else if (M <= 3e-12) {
tmp = (c0 * c0) / (((D * D) * (h * (w * w))) / (d * d));
} else if (M <= 2.25e+157) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 5.5e-93: tmp = 0.0 elif M <= 3e-12: tmp = (c0 * c0) / (((D * D) * (h * (w * w))) / (d * d)) elif M <= 2.25e+157: tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))) else: tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 5.5e-93) tmp = 0.0; elseif (M <= 3e-12) tmp = Float64(Float64(c0 * c0) / Float64(Float64(Float64(D * D) * Float64(h * Float64(w * w))) / Float64(d * d))); elseif (M <= 2.25e+157) tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))); else tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 5.5e-93) tmp = 0.0; elseif (M <= 3e-12) tmp = (c0 * c0) / (((D * D) * (h * (w * w))) / (d * d)); elseif (M <= 2.25e+157) tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); else tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 5.5e-93], 0.0, If[LessEqual[M, 3e-12], N[(N[(c0 * c0), $MachinePrecision] / N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.25e+157], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5.5 \cdot 10^{-93}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 3 \cdot 10^{-12}:\\
\;\;\;\;\frac{c0 \cdot c0}{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}{d \cdot d}}\\
\mathbf{elif}\;M \leq 2.25 \cdot 10^{+157}:\\
\;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\\
\end{array}
\end{array}
if M < 5.49999999999999968e-93Initial program 25.1%
Simplified25.5%
Taylor expanded in c0 around -inf 3.1%
mul-1-neg3.1%
distribute-rgt-in2.0%
Simplified34.0%
Taylor expanded in c0 around 0 39.6%
if 5.49999999999999968e-93 < M < 3.0000000000000001e-12Initial program 44.6%
Simplified44.6%
Taylor expanded in c0 around inf 45.1%
associate-*r*45.1%
*-commutative45.1%
unpow245.1%
*-commutative45.1%
associate-*r/45.1%
*-commutative45.1%
unpow245.1%
*-commutative45.1%
associate-*r*45.1%
associate-/r*45.1%
associate-*r/45.0%
unpow245.0%
associate-/r*50.9%
unpow250.9%
associate-*l/50.9%
associate-*r/50.9%
unpow250.9%
*-commutative50.9%
Simplified50.9%
Taylor expanded in c0 around 0 39.4%
associate-/l*39.5%
unpow239.5%
unpow239.5%
unpow239.5%
unpow239.5%
Simplified39.5%
if 3.0000000000000001e-12 < M < 2.24999999999999992e157Initial program 21.5%
Simplified21.5%
Taylor expanded in c0 around -inf 0.5%
+-commutative0.5%
fma-def0.5%
times-frac3.6%
unpow23.6%
unpow23.6%
*-commutative3.6%
unpow23.6%
mul-1-neg3.6%
distribute-rgt-in0.1%
Simplified19.7%
Taylor expanded in c0 around 0 23.0%
associate-/l*20.0%
unpow220.0%
unpow220.0%
*-commutative20.0%
unpow220.0%
Simplified20.0%
Taylor expanded in D around 0 23.0%
unpow223.0%
*-commutative23.0%
unpow223.0%
associate-*l/20.2%
unpow220.2%
*-commutative20.2%
associate-*r*20.2%
times-frac33.9%
Simplified33.9%
if 2.24999999999999992e157 < M Initial program 0.0%
Simplified0.0%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
fma-def0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
mul-1-neg0.0%
distribute-rgt-in0.0%
Simplified0.0%
Taylor expanded in c0 around 0 8.3%
associate-/l*8.3%
unpow28.3%
unpow28.3%
*-commutative8.3%
unpow28.3%
Simplified8.3%
Taylor expanded in d around 0 8.3%
unpow28.3%
unpow28.3%
*-commutative8.3%
associate-*r*21.1%
times-frac32.6%
Simplified32.6%
Final simplification38.3%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 1.32e-92)
0.0
(if (<= M 3e-12)
(/ (* c0 c0) (/ (* (* D (* h D)) (* w w)) (* d d)))
(if (<= M 7.5e+156)
(* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d))))
(* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 1.32e-92) {
tmp = 0.0;
} else if (M <= 3e-12) {
tmp = (c0 * c0) / (((D * (h * D)) * (w * w)) / (d * d));
} else if (M <= 7.5e+156) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
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 <= 1.32d-92) then
tmp = 0.0d0
else if (m <= 3d-12) then
tmp = (c0 * c0) / (((d * (h * d)) * (w * w)) / (d_1 * d_1))
else if (m <= 7.5d+156) then
tmp = 0.25d0 * ((m * (h * m)) * ((d / d_1) * (d / d_1)))
else
tmp = 0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))
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 <= 1.32e-92) {
tmp = 0.0;
} else if (M <= 3e-12) {
tmp = (c0 * c0) / (((D * (h * D)) * (w * w)) / (d * d));
} else if (M <= 7.5e+156) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 1.32e-92: tmp = 0.0 elif M <= 3e-12: tmp = (c0 * c0) / (((D * (h * D)) * (w * w)) / (d * d)) elif M <= 7.5e+156: tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))) else: tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 1.32e-92) tmp = 0.0; elseif (M <= 3e-12) tmp = Float64(Float64(c0 * c0) / Float64(Float64(Float64(D * Float64(h * D)) * Float64(w * w)) / Float64(d * d))); elseif (M <= 7.5e+156) tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))); else tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 1.32e-92) tmp = 0.0; elseif (M <= 3e-12) tmp = (c0 * c0) / (((D * (h * D)) * (w * w)) / (d * d)); elseif (M <= 7.5e+156) tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); else tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.32e-92], 0.0, If[LessEqual[M, 3e-12], N[(N[(c0 * c0), $MachinePrecision] / N[(N[(N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 7.5e+156], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.32 \cdot 10^{-92}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 3 \cdot 10^{-12}:\\
\;\;\;\;\frac{c0 \cdot c0}{\frac{\left(D \cdot \left(h \cdot D\right)\right) \cdot \left(w \cdot w\right)}{d \cdot d}}\\
\mathbf{elif}\;M \leq 7.5 \cdot 10^{+156}:\\
\;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\\
\end{array}
\end{array}
if M < 1.3200000000000001e-92Initial program 25.1%
Simplified25.5%
Taylor expanded in c0 around -inf 3.1%
mul-1-neg3.1%
distribute-rgt-in2.0%
Simplified34.0%
Taylor expanded in c0 around 0 39.6%
if 1.3200000000000001e-92 < M < 3.0000000000000001e-12Initial program 44.6%
Simplified44.6%
Taylor expanded in c0 around inf 45.1%
associate-*r*45.1%
*-commutative45.1%
unpow245.1%
*-commutative45.1%
associate-*r/45.1%
*-commutative45.1%
unpow245.1%
*-commutative45.1%
associate-*r*45.1%
associate-/r*45.1%
associate-*r/45.0%
unpow245.0%
associate-/r*50.9%
unpow250.9%
associate-*l/50.9%
associate-*r/50.9%
unpow250.9%
*-commutative50.9%
Simplified50.9%
associate-*l/51.2%
Applied egg-rr51.2%
unpow251.2%
Applied egg-rr51.2%
Taylor expanded in c0 around 0 39.4%
unpow239.4%
associate-/l*39.5%
unpow239.5%
associate-*r*39.5%
unpow239.5%
associate-*r*39.7%
unpow239.7%
Simplified39.7%
if 3.0000000000000001e-12 < M < 7.50000000000000026e156Initial program 21.5%
Simplified21.5%
Taylor expanded in c0 around -inf 0.5%
+-commutative0.5%
fma-def0.5%
times-frac3.6%
unpow23.6%
unpow23.6%
*-commutative3.6%
unpow23.6%
mul-1-neg3.6%
distribute-rgt-in0.1%
Simplified19.7%
Taylor expanded in c0 around 0 23.0%
associate-/l*20.0%
unpow220.0%
unpow220.0%
*-commutative20.0%
unpow220.0%
Simplified20.0%
Taylor expanded in D around 0 23.0%
unpow223.0%
*-commutative23.0%
unpow223.0%
associate-*l/20.2%
unpow220.2%
*-commutative20.2%
associate-*r*20.2%
times-frac33.9%
Simplified33.9%
if 7.50000000000000026e156 < M Initial program 0.0%
Simplified0.0%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
fma-def0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
mul-1-neg0.0%
distribute-rgt-in0.0%
Simplified0.0%
Taylor expanded in c0 around 0 8.3%
associate-/l*8.3%
unpow28.3%
unpow28.3%
*-commutative8.3%
unpow28.3%
Simplified8.3%
Taylor expanded in d around 0 8.3%
unpow28.3%
unpow28.3%
*-commutative8.3%
associate-*r*21.1%
times-frac32.6%
Simplified32.6%
Final simplification38.3%
(FPCore (c0 w h D d M) :precision binary64 (if (<= d 8.2e+105) (* 0.25 (* (* (/ D d) (/ D d)) (* h (* M M)))) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (d <= 8.2e+105) {
tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M)));
} else {
tmp = 0.0;
}
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_1 <= 8.2d+105) then
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * (h * (m * m)))
else
tmp = 0.0d0
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 <= 8.2e+105) {
tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if d <= 8.2e+105: tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (d <= 8.2e+105) tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(h * Float64(M * M)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (d <= 8.2e+105) tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[d, 8.2e+105], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 8.2 \cdot 10^{+105}:\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if d < 8.2000000000000005e105Initial program 24.9%
Simplified25.4%
Taylor expanded in c0 around -inf 1.5%
+-commutative1.5%
fma-def1.5%
times-frac2.4%
unpow22.4%
unpow22.4%
*-commutative2.4%
unpow22.4%
mul-1-neg2.4%
distribute-rgt-in1.3%
Simplified18.2%
Taylor expanded in c0 around 0 28.3%
associate-/l*27.8%
unpow227.8%
unpow227.8%
*-commutative27.8%
unpow227.8%
Simplified27.8%
Taylor expanded in D around 0 28.3%
unpow228.3%
*-commutative28.3%
unpow228.3%
associate-*l/27.7%
unpow227.7%
*-commutative27.7%
associate-*r*29.9%
times-frac36.7%
Simplified36.7%
Taylor expanded in h around 0 34.0%
*-commutative34.0%
unpow234.0%
Simplified34.0%
if 8.2000000000000005e105 < d Initial program 19.7%
Simplified19.7%
Taylor expanded in c0 around -inf 5.0%
mul-1-neg5.0%
distribute-rgt-in3.3%
Simplified38.5%
Taylor expanded in c0 around 0 44.5%
Final simplification36.5%
(FPCore (c0 w h D d M) :precision binary64 (if (<= M 6.4e+156) (* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d)))) (* 0.25 (/ (* D D) (* (/ d (* h M)) (/ d M))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 6.4e+156) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
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 <= 6.4d+156) then
tmp = 0.25d0 * ((m * (h * m)) * ((d / d_1) * (d / d_1)))
else
tmp = 0.25d0 * ((d * d) / ((d_1 / (h * m)) * (d_1 / m)))
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 <= 6.4e+156) {
tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
} else {
tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 6.4e+156: tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))) else: tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 6.4e+156) tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))); else tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d / Float64(h * M)) * Float64(d / M)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 6.4e+156) tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); else tmp = 0.25 * ((D * D) / ((d / (h * M)) * (d / M))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 6.4e+156], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d / N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 6.4 \cdot 10^{+156}:\\
\;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d}{h \cdot M} \cdot \frac{d}{M}}\\
\end{array}
\end{array}
if M < 6.40000000000000005e156Initial program 26.1%
Simplified26.5%
Taylor expanded in c0 around -inf 2.5%
+-commutative2.5%
fma-def2.5%
times-frac3.3%
unpow23.3%
unpow23.3%
*-commutative3.3%
unpow23.3%
mul-1-neg3.3%
distribute-rgt-in2.0%
Simplified21.0%
Taylor expanded in c0 around 0 30.4%
associate-/l*30.0%
unpow230.0%
unpow230.0%
*-commutative30.0%
unpow230.0%
Simplified30.0%
Taylor expanded in D around 0 30.4%
unpow230.4%
*-commutative30.4%
unpow230.4%
associate-*l/29.9%
unpow229.9%
*-commutative29.9%
associate-*r*31.3%
times-frac38.7%
Simplified38.7%
if 6.40000000000000005e156 < M Initial program 0.0%
Simplified0.0%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
fma-def0.0%
times-frac0.0%
unpow20.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
mul-1-neg0.0%
distribute-rgt-in0.0%
Simplified0.0%
Taylor expanded in c0 around 0 8.3%
associate-/l*8.3%
unpow28.3%
unpow28.3%
*-commutative8.3%
unpow28.3%
Simplified8.3%
Taylor expanded in d around 0 8.3%
unpow28.3%
unpow28.3%
*-commutative8.3%
associate-*r*21.1%
times-frac32.6%
Simplified32.6%
Final simplification38.1%
(FPCore (c0 w h D d M) :precision binary64 (* 0.25 (* (* M (* h M)) (* (/ D d) (/ D d)))))
double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
}
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.25d0 * ((m * (h * m)) * ((d / d_1) * (d / d_1)))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * ((M * (h * M)) * ((D / d) * (D / d)));
}
def code(c0, w, h, D, d, M): return 0.25 * ((M * (h * M)) * ((D / d) * (D / d)))
function code(c0, w, h, D, d, M) return Float64(0.25 * Float64(Float64(M * Float64(h * M)) * Float64(Float64(D / d) * Float64(D / d)))) end
function tmp = code(c0, w, h, D, d, M) tmp = 0.25 * ((M * (h * M)) * ((D / d) * (D / d))); end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)
\end{array}
Initial program 23.7%
Simplified24.0%
Taylor expanded in c0 around -inf 2.3%
+-commutative2.3%
fma-def2.3%
times-frac3.0%
unpow23.0%
unpow23.0%
*-commutative3.0%
unpow23.0%
mul-1-neg3.0%
distribute-rgt-in1.8%
Simplified19.0%
Taylor expanded in c0 around 0 28.3%
associate-/l*27.9%
unpow227.9%
unpow227.9%
*-commutative27.9%
unpow227.9%
Simplified27.9%
Taylor expanded in D around 0 28.3%
unpow228.3%
*-commutative28.3%
unpow228.3%
associate-*l/27.9%
unpow227.9%
*-commutative27.9%
associate-*r*30.3%
times-frac37.5%
Simplified37.5%
Final simplification37.5%
(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.7%
Simplified24.0%
Taylor expanded in c0 around -inf 2.3%
mul-1-neg2.3%
distribute-rgt-in1.5%
Simplified28.3%
Taylor expanded in c0 around 0 33.1%
Final simplification33.1%
herbie shell --seed 2023282
(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))))))