
(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 10 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 (pow (/ d D) 2.0))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
(* t_1 (/ (* c0 2.0) (* h (/ w t_0))))
(* 0.25 (/ (* h (* M M)) t_0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = pow((d / D), 2.0);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_1 * ((c0 * 2.0) / (h * (w / t_0)));
} else {
tmp = 0.25 * ((h * (M * M)) / t_0);
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = Math.pow((d / D), 2.0);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 * ((c0 * 2.0) / (h * (w / t_0)));
} else {
tmp = 0.25 * ((h * (M * M)) / t_0);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = math.pow((d / D), 2.0) t_1 = c0 / (2.0 * w) t_2 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if (t_1 * (t_2 + math.sqrt(((t_2 * t_2) - (M * M))))) <= math.inf: tmp = t_1 * ((c0 * 2.0) / (h * (w / t_0))) else: tmp = 0.25 * ((h * (M * M)) / t_0) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / D) ^ 2.0 t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf) tmp = Float64(t_1 * Float64(Float64(c0 * 2.0) / Float64(h * Float64(w / t_0)))); else tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / t_0)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) ^ 2.0; t_1 = c0 / (2.0 * w); t_2 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= Inf) tmp = t_1 * ((c0 * 2.0) / (h * (w / t_0))); else tmp = 0.25 * ((h * (M * M)) / t_0); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(N[(c0 * 2.0), $MachinePrecision] / N[(h * N[(w / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_1 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_1 \cdot \frac{c0 \cdot 2}{h \cdot \frac{w}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{t_0}\\
\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 80.7%
times-frac73.5%
fma-def71.4%
associate-/r*71.6%
difference-of-squares71.6%
Simplified71.8%
fma-udef71.8%
associate-/l/71.8%
frac-times71.8%
pow271.8%
Applied egg-rr71.8%
Taylor expanded in c0 around inf 79.6%
times-frac75.3%
unpow275.3%
unpow275.3%
times-frac77.3%
unpow277.3%
*-commutative77.3%
associate-*l/77.5%
associate-/l*79.5%
associate-*r/79.5%
Simplified79.5%
Taylor expanded in w around 0 79.6%
unpow279.6%
*-commutative79.6%
associate-/l*77.5%
unpow277.5%
times-frac79.5%
unpow279.5%
associate-/l*78.4%
associate-/r/81.9%
Simplified81.9%
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%
Taylor expanded in c0 around -inf 4.4%
fma-def4.4%
associate-/l*4.4%
*-commutative4.4%
unpow24.4%
unpow24.4%
unpow24.4%
associate-*r*4.4%
Simplified38.4%
Taylor expanded in c0 around 0 51.8%
unpow251.8%
*-commutative51.8%
associate-/l*51.9%
unpow251.9%
unpow251.9%
times-frac60.3%
unpow260.3%
Simplified60.3%
Final simplification68.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (pow (/ d D) 2.0)) (t_1 (* h (* M M))))
(if (<= (* D D) 2e-287)
(* 0.25 (/ t_1 t_0))
(if (<= (* D D) 4e-177)
(/ (* (* d d) (* (/ c0 h) (/ c0 (* w w)))) (* D D))
(if (<= (* D D) 2e-31)
(* 0.25 (/ (* D D) (/ (* d d) t_1)))
(* (/ c0 (* 2.0 w)) (* 2.0 (* t_0 (/ c0 (* w h))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = pow((d / D), 2.0);
double t_1 = h * (M * M);
double tmp;
if ((D * D) <= 2e-287) {
tmp = 0.25 * (t_1 / t_0);
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / t_1));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (c0 / (w * h))));
}
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) ** 2.0d0
t_1 = h * (m * m)
if ((d * d) <= 2d-287) then
tmp = 0.25d0 * (t_1 / t_0)
else if ((d * d) <= 4d-177) then
tmp = ((d_1 * d_1) * ((c0 / h) * (c0 / (w * w)))) / (d * d)
else if ((d * d) <= 2d-31) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / t_1))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (t_0 * (c0 / (w * h))))
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 = Math.pow((d / D), 2.0);
double t_1 = h * (M * M);
double tmp;
if ((D * D) <= 2e-287) {
tmp = 0.25 * (t_1 / t_0);
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / t_1));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (c0 / (w * h))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = math.pow((d / D), 2.0) t_1 = h * (M * M) tmp = 0 if (D * D) <= 2e-287: tmp = 0.25 * (t_1 / t_0) elif (D * D) <= 4e-177: tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D) elif (D * D) <= 2e-31: tmp = 0.25 * ((D * D) / ((d * d) / t_1)) else: tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (c0 / (w * h)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / D) ^ 2.0 t_1 = Float64(h * Float64(M * M)) tmp = 0.0 if (Float64(D * D) <= 2e-287) tmp = Float64(0.25 * Float64(t_1 / t_0)); elseif (Float64(D * D) <= 4e-177) tmp = Float64(Float64(Float64(d * d) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))) / Float64(D * D)); elseif (Float64(D * D) <= 2e-31) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / t_1))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(t_0 * Float64(c0 / Float64(w * h))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) ^ 2.0; t_1 = h * (M * M); tmp = 0.0; if ((D * D) <= 2e-287) tmp = 0.25 * (t_1 / t_0); elseif ((D * D) <= 4e-177) tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D); elseif ((D * D) <= 2e-31) tmp = 0.25 * ((D * D) / ((d * d) / t_1)); else tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (c0 / (w * h)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(D * D), $MachinePrecision], 2e-287], N[(0.25 * N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 4e-177], N[(N[(N[(d * d), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 2e-31], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(t$95$0 * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
t_1 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;D \cdot D \leq 2 \cdot 10^{-287}:\\
\;\;\;\;0.25 \cdot \frac{t_1}{t_0}\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D}\\
\mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{-31}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{t_1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(t_0 \cdot \frac{c0}{w \cdot h}\right)\right)\\
\end{array}
\end{array}
if (*.f64 D D) < 2.00000000000000004e-287Initial program 24.0%
Taylor expanded in c0 around -inf 1.0%
fma-def1.0%
associate-/l*1.0%
*-commutative1.0%
unpow21.0%
unpow21.0%
unpow21.0%
associate-*r*1.0%
Simplified30.0%
Taylor expanded in c0 around 0 42.9%
unpow242.9%
*-commutative42.9%
associate-/l*43.0%
unpow243.0%
unpow243.0%
times-frac50.4%
unpow250.4%
Simplified50.4%
if 2.00000000000000004e-287 < (*.f64 D D) < 3.99999999999999981e-177Initial program 47.6%
associate-*l*47.6%
difference-of-squares50.5%
associate-*l*50.5%
associate-*l*50.5%
Simplified50.5%
Taylor expanded in c0 around inf 56.2%
times-frac47.7%
unpow247.7%
unpow247.7%
unpow247.7%
*-commutative47.7%
unpow247.7%
Simplified47.7%
associate-*l/56.3%
times-frac68.4%
Applied egg-rr68.4%
if 3.99999999999999981e-177 < (*.f64 D D) < 2e-31Initial program 33.0%
Taylor expanded in c0 around -inf 21.2%
fma-def21.2%
associate-/l*21.2%
*-commutative21.2%
unpow221.2%
unpow221.2%
unpow221.2%
associate-*r*21.2%
Simplified58.6%
Taylor expanded in c0 around 0 56.6%
*-commutative56.6%
unpow256.6%
associate-/l*56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
Simplified56.6%
if 2e-31 < (*.f64 D D) Initial program 27.1%
times-frac24.8%
fma-def24.8%
associate-/r*25.0%
difference-of-squares32.7%
Simplified46.9%
fma-udef46.9%
associate-/l/35.5%
frac-times46.9%
pow246.9%
Applied egg-rr46.9%
Taylor expanded in c0 around inf 36.3%
times-frac37.7%
unpow237.7%
unpow237.7%
times-frac55.4%
unpow255.4%
*-commutative55.4%
Simplified55.4%
Final simplification55.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* h (* M M))))
(if (<= (* D D) 2e-287)
(* 0.25 (/ t_0 (pow (/ d D) 2.0)))
(if (<= (* D D) 4e-177)
(/ (* (* d d) (* (/ c0 h) (/ c0 (* w w)))) (* D D))
(if (<= (* D D) 2e-31)
(* 0.25 (/ (* D D) (/ (* d d) t_0)))
(*
(/ c0 (* 2.0 w))
(/ (* c0 2.0) (/ (* w h) (/ (/ d (/ D d)) D)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = h * (M * M);
double tmp;
if ((D * D) <= 2e-287) {
tmp = 0.25 * (t_0 / pow((d / D), 2.0));
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / t_0));
} else {
tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((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) :: tmp
t_0 = h * (m * m)
if ((d * d) <= 2d-287) then
tmp = 0.25d0 * (t_0 / ((d_1 / d) ** 2.0d0))
else if ((d * d) <= 4d-177) then
tmp = ((d_1 * d_1) * ((c0 / h) * (c0 / (w * w)))) / (d * d)
else if ((d * d) <= 2d-31) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / t_0))
else
tmp = (c0 / (2.0d0 * w)) * ((c0 * 2.0d0) / ((w * h) / ((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 t_0 = h * (M * M);
double tmp;
if ((D * D) <= 2e-287) {
tmp = 0.25 * (t_0 / Math.pow((d / D), 2.0));
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / t_0));
} else {
tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / ((d / (D / d)) / D)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = h * (M * M) tmp = 0 if (D * D) <= 2e-287: tmp = 0.25 * (t_0 / math.pow((d / D), 2.0)) elif (D * D) <= 4e-177: tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D) elif (D * D) <= 2e-31: tmp = 0.25 * ((D * D) / ((d * d) / t_0)) else: tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / ((d / (D / d)) / D))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(h * Float64(M * M)) tmp = 0.0 if (Float64(D * D) <= 2e-287) tmp = Float64(0.25 * Float64(t_0 / (Float64(d / D) ^ 2.0))); elseif (Float64(D * D) <= 4e-177) tmp = Float64(Float64(Float64(d * d) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))) / Float64(D * D)); elseif (Float64(D * D) <= 2e-31) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / t_0))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(c0 * 2.0) / Float64(Float64(w * h) / Float64(Float64(d / Float64(D / d)) / D)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = h * (M * M); tmp = 0.0; if ((D * D) <= 2e-287) tmp = 0.25 * (t_0 / ((d / D) ^ 2.0)); elseif ((D * D) <= 4e-177) tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D); elseif ((D * D) <= 2e-31) tmp = 0.25 * ((D * D) / ((d * d) / t_0)); else tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / ((d / (D / d)) / D))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(D * D), $MachinePrecision], 2e-287], N[(0.25 * N[(t$95$0 / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 4e-177], N[(N[(N[(d * d), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 2e-31], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * 2.0), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] / N[(N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;D \cdot D \leq 2 \cdot 10^{-287}:\\
\;\;\;\;0.25 \cdot \frac{t_0}{{\left(\frac{d}{D}\right)}^{2}}\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D}\\
\mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{-31}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{c0 \cdot 2}{\frac{w \cdot h}{\frac{\frac{d}{\frac{D}{d}}}{D}}}\\
\end{array}
\end{array}
if (*.f64 D D) < 2.00000000000000004e-287Initial program 24.0%
Taylor expanded in c0 around -inf 1.0%
fma-def1.0%
associate-/l*1.0%
*-commutative1.0%
unpow21.0%
unpow21.0%
unpow21.0%
associate-*r*1.0%
Simplified30.0%
Taylor expanded in c0 around 0 42.9%
unpow242.9%
*-commutative42.9%
associate-/l*43.0%
unpow243.0%
unpow243.0%
times-frac50.4%
unpow250.4%
Simplified50.4%
if 2.00000000000000004e-287 < (*.f64 D D) < 3.99999999999999981e-177Initial program 47.6%
associate-*l*47.6%
difference-of-squares50.5%
associate-*l*50.5%
associate-*l*50.5%
Simplified50.5%
Taylor expanded in c0 around inf 56.2%
times-frac47.7%
unpow247.7%
unpow247.7%
unpow247.7%
*-commutative47.7%
unpow247.7%
Simplified47.7%
associate-*l/56.3%
times-frac68.4%
Applied egg-rr68.4%
if 3.99999999999999981e-177 < (*.f64 D D) < 2e-31Initial program 33.0%
Taylor expanded in c0 around -inf 21.2%
fma-def21.2%
associate-/l*21.2%
*-commutative21.2%
unpow221.2%
unpow221.2%
unpow221.2%
associate-*r*21.2%
Simplified58.6%
Taylor expanded in c0 around 0 56.6%
*-commutative56.6%
unpow256.6%
associate-/l*56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
Simplified56.6%
if 2e-31 < (*.f64 D D) Initial program 27.1%
times-frac24.8%
fma-def24.8%
associate-/r*25.0%
difference-of-squares32.7%
Simplified46.9%
fma-udef46.9%
associate-/l/35.5%
frac-times46.9%
pow246.9%
Applied egg-rr46.9%
Taylor expanded in c0 around inf 36.3%
times-frac37.7%
unpow237.7%
unpow237.7%
times-frac55.4%
unpow255.4%
*-commutative55.4%
associate-*l/52.9%
associate-/l*54.2%
associate-*r/54.2%
Simplified54.2%
unpow254.2%
times-frac37.6%
associate-/r*50.3%
associate-/l*52.8%
Applied egg-rr52.8%
Final simplification54.6%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= (* D D) 5e-287)
0.0
(if (<= (* D D) 4e-177)
(/ (* (* d d) (* (/ c0 h) (/ c0 (* w w)))) (* D D))
(if (<= (* D D) 2e-31)
(* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
(* (/ c0 (* 2.0 w)) (* 2.0 (/ (* c0 (* d d)) (* w (* D (* h D))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 5e-287) {
tmp = 0.0;
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 * (d * d)) / (w * (D * (h * 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) <= 5d-287) then
tmp = 0.0d0
else if ((d * d) <= 4d-177) then
tmp = ((d_1 * d_1) * ((c0 / h) * (c0 / (w * w)))) / (d * d)
else if ((d * d) <= 2d-31) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 * (d_1 * d_1)) / (w * (d * (h * 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) <= 5e-287) {
tmp = 0.0;
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 * (d * d)) / (w * (D * (h * D)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 5e-287: tmp = 0.0 elif (D * D) <= 4e-177: tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D) elif (D * D) <= 2e-31: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) else: tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 * (d * d)) / (w * (D * (h * D))))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 5e-287) tmp = 0.0; elseif (Float64(D * D) <= 4e-177) tmp = Float64(Float64(Float64(d * d) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))) / Float64(D * D)); elseif (Float64(D * D) <= 2e-31) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 * Float64(d * d)) / Float64(w * Float64(D * Float64(h * D)))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 5e-287) tmp = 0.0; elseif ((D * D) <= 4e-177) tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D); elseif ((D * D) <= 2e-31) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); else tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 * (d * d)) / (w * (D * (h * D))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 5e-287], 0.0, If[LessEqual[N[(D * D), $MachinePrecision], 4e-177], N[(N[(N[(d * d), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 2e-31], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 5 \cdot 10^{-287}:\\
\;\;\;\;0\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D}\\
\mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{-31}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(D \cdot \left(h \cdot D\right)\right)}\right)\\
\end{array}
\end{array}
if (*.f64 D D) < 5.00000000000000025e-287Initial program 23.8%
times-frac21.8%
fma-def21.8%
associate-/r*21.9%
difference-of-squares26.8%
Simplified30.0%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
distribute-rgt1-in0.0%
metadata-eval0.0%
mul0-lft39.4%
metadata-eval39.4%
mul0-lft0.0%
metadata-eval0.0%
distribute-lft1-in0.0%
*-commutative0.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft39.4%
Simplified39.4%
Taylor expanded in c0 around 0 48.4%
if 5.00000000000000025e-287 < (*.f64 D D) < 3.99999999999999981e-177Initial program 49.0%
associate-*l*49.0%
difference-of-squares52.1%
associate-*l*52.1%
associate-*l*52.1%
Simplified52.1%
Taylor expanded in c0 around inf 57.9%
times-frac49.2%
unpow249.2%
unpow249.2%
unpow249.2%
*-commutative49.2%
unpow249.2%
Simplified49.2%
associate-*l/58.0%
times-frac70.4%
Applied egg-rr70.4%
if 3.99999999999999981e-177 < (*.f64 D D) < 2e-31Initial program 33.0%
Taylor expanded in c0 around -inf 21.2%
fma-def21.2%
associate-/l*21.2%
*-commutative21.2%
unpow221.2%
unpow221.2%
unpow221.2%
associate-*r*21.2%
Simplified58.6%
Taylor expanded in c0 around 0 56.6%
*-commutative56.6%
unpow256.6%
associate-/l*56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
Simplified56.6%
if 2e-31 < (*.f64 D D) Initial program 27.1%
times-frac24.8%
fma-def24.8%
associate-/r*25.0%
difference-of-squares32.7%
Simplified46.9%
Taylor expanded in c0 around inf 36.3%
*-commutative36.3%
unpow236.3%
associate-/l/37.7%
associate-/r*37.8%
associate-/r*37.5%
unpow237.5%
associate-/l/37.4%
unpow237.4%
*-commutative37.4%
unpow237.4%
associate-*r*46.3%
*-commutative46.3%
Simplified46.3%
Final simplification52.0%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= (* D D) 5e-287)
0.0
(if (<= (* D D) 4e-177)
(/ (* (* d d) (* (/ c0 h) (/ c0 (* w w)))) (* D D))
(if (<= (* D D) 2e-31)
(* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
(* (/ c0 (* 2.0 w)) (/ (* c0 2.0) (/ (* w h) (/ d (/ (* D D) d)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 5e-287) {
tmp = 0.0;
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((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) :: tmp
if ((d * d) <= 5d-287) then
tmp = 0.0d0
else if ((d * d) <= 4d-177) then
tmp = ((d_1 * d_1) * ((c0 / h) * (c0 / (w * w)))) / (d * d)
else if ((d * d) <= 2d-31) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else
tmp = (c0 / (2.0d0 * w)) * ((c0 * 2.0d0) / ((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 tmp;
if ((D * D) <= 5e-287) {
tmp = 0.0;
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / (d / ((D * D) / d))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 5e-287: tmp = 0.0 elif (D * D) <= 4e-177: tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D) elif (D * D) <= 2e-31: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) else: tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / (d / ((D * D) / d)))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 5e-287) tmp = 0.0; elseif (Float64(D * D) <= 4e-177) tmp = Float64(Float64(Float64(d * d) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))) / Float64(D * D)); elseif (Float64(D * D) <= 2e-31) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(c0 * 2.0) / Float64(Float64(w * h) / Float64(d / Float64(Float64(D * D) / d))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 5e-287) tmp = 0.0; elseif ((D * D) <= 4e-177) tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D); elseif ((D * D) <= 2e-31) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); else tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / (d / ((D * D) / d)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 5e-287], 0.0, If[LessEqual[N[(D * D), $MachinePrecision], 4e-177], N[(N[(N[(d * d), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 2e-31], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * 2.0), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] / N[(d / N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 5 \cdot 10^{-287}:\\
\;\;\;\;0\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D}\\
\mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{-31}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{c0 \cdot 2}{\frac{w \cdot h}{\frac{d}{\frac{D \cdot D}{d}}}}\\
\end{array}
\end{array}
if (*.f64 D D) < 5.00000000000000025e-287Initial program 23.8%
times-frac21.8%
fma-def21.8%
associate-/r*21.9%
difference-of-squares26.8%
Simplified30.0%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
distribute-rgt1-in0.0%
metadata-eval0.0%
mul0-lft39.4%
metadata-eval39.4%
mul0-lft0.0%
metadata-eval0.0%
distribute-lft1-in0.0%
*-commutative0.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft39.4%
Simplified39.4%
Taylor expanded in c0 around 0 48.4%
if 5.00000000000000025e-287 < (*.f64 D D) < 3.99999999999999981e-177Initial program 49.0%
associate-*l*49.0%
difference-of-squares52.1%
associate-*l*52.1%
associate-*l*52.1%
Simplified52.1%
Taylor expanded in c0 around inf 57.9%
times-frac49.2%
unpow249.2%
unpow249.2%
unpow249.2%
*-commutative49.2%
unpow249.2%
Simplified49.2%
associate-*l/58.0%
times-frac70.4%
Applied egg-rr70.4%
if 3.99999999999999981e-177 < (*.f64 D D) < 2e-31Initial program 33.0%
Taylor expanded in c0 around -inf 21.2%
fma-def21.2%
associate-/l*21.2%
*-commutative21.2%
unpow221.2%
unpow221.2%
unpow221.2%
associate-*r*21.2%
Simplified58.6%
Taylor expanded in c0 around 0 56.6%
*-commutative56.6%
unpow256.6%
associate-/l*56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
Simplified56.6%
if 2e-31 < (*.f64 D D) Initial program 27.1%
times-frac24.8%
fma-def24.8%
associate-/r*25.0%
difference-of-squares32.7%
Simplified46.9%
fma-udef46.9%
associate-/l/35.5%
frac-times46.9%
pow246.9%
Applied egg-rr46.9%
Taylor expanded in c0 around inf 36.3%
times-frac37.7%
unpow237.7%
unpow237.7%
times-frac55.4%
unpow255.4%
*-commutative55.4%
associate-*l/52.9%
associate-/l*54.2%
associate-*r/54.2%
Simplified54.2%
unpow254.2%
times-frac37.6%
associate-/l*46.6%
Applied egg-rr46.6%
Final simplification52.1%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= (* D D) 5e-287)
0.0
(if (<= (* D D) 4e-177)
(/ (* (* d d) (* (/ c0 h) (/ c0 (* w w)))) (* D D))
(if (<= (* D D) 2e-31)
(* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
(* (/ c0 (* 2.0 w)) (/ (* c0 2.0) (/ (* w h) (/ (/ d (/ D d)) D))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 5e-287) {
tmp = 0.0;
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((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) :: tmp
if ((d * d) <= 5d-287) then
tmp = 0.0d0
else if ((d * d) <= 4d-177) then
tmp = ((d_1 * d_1) * ((c0 / h) * (c0 / (w * w)))) / (d * d)
else if ((d * d) <= 2d-31) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else
tmp = (c0 / (2.0d0 * w)) * ((c0 * 2.0d0) / ((w * h) / ((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) <= 5e-287) {
tmp = 0.0;
} else if ((D * D) <= 4e-177) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if ((D * D) <= 2e-31) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / ((d / (D / d)) / D)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 5e-287: tmp = 0.0 elif (D * D) <= 4e-177: tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D) elif (D * D) <= 2e-31: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) else: tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / ((d / (D / d)) / D))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 5e-287) tmp = 0.0; elseif (Float64(D * D) <= 4e-177) tmp = Float64(Float64(Float64(d * d) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))) / Float64(D * D)); elseif (Float64(D * D) <= 2e-31) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(c0 * 2.0) / Float64(Float64(w * h) / Float64(Float64(d / Float64(D / d)) / D)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 5e-287) tmp = 0.0; elseif ((D * D) <= 4e-177) tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D); elseif ((D * D) <= 2e-31) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); else tmp = (c0 / (2.0 * w)) * ((c0 * 2.0) / ((w * h) / ((d / (D / d)) / D))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 5e-287], 0.0, If[LessEqual[N[(D * D), $MachinePrecision], 4e-177], N[(N[(N[(d * d), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 2e-31], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * 2.0), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] / N[(N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 5 \cdot 10^{-287}:\\
\;\;\;\;0\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D}\\
\mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{-31}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{c0 \cdot 2}{\frac{w \cdot h}{\frac{\frac{d}{\frac{D}{d}}}{D}}}\\
\end{array}
\end{array}
if (*.f64 D D) < 5.00000000000000025e-287Initial program 23.8%
times-frac21.8%
fma-def21.8%
associate-/r*21.9%
difference-of-squares26.8%
Simplified30.0%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
distribute-rgt1-in0.0%
metadata-eval0.0%
mul0-lft39.4%
metadata-eval39.4%
mul0-lft0.0%
metadata-eval0.0%
distribute-lft1-in0.0%
*-commutative0.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft39.4%
Simplified39.4%
Taylor expanded in c0 around 0 48.4%
if 5.00000000000000025e-287 < (*.f64 D D) < 3.99999999999999981e-177Initial program 49.0%
associate-*l*49.0%
difference-of-squares52.1%
associate-*l*52.1%
associate-*l*52.1%
Simplified52.1%
Taylor expanded in c0 around inf 57.9%
times-frac49.2%
unpow249.2%
unpow249.2%
unpow249.2%
*-commutative49.2%
unpow249.2%
Simplified49.2%
associate-*l/58.0%
times-frac70.4%
Applied egg-rr70.4%
if 3.99999999999999981e-177 < (*.f64 D D) < 2e-31Initial program 33.0%
Taylor expanded in c0 around -inf 21.2%
fma-def21.2%
associate-/l*21.2%
*-commutative21.2%
unpow221.2%
unpow221.2%
unpow221.2%
associate-*r*21.2%
Simplified58.6%
Taylor expanded in c0 around 0 56.6%
*-commutative56.6%
unpow256.6%
associate-/l*56.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
Simplified56.6%
if 2e-31 < (*.f64 D D) Initial program 27.1%
times-frac24.8%
fma-def24.8%
associate-/r*25.0%
difference-of-squares32.7%
Simplified46.9%
fma-udef46.9%
associate-/l/35.5%
frac-times46.9%
pow246.9%
Applied egg-rr46.9%
Taylor expanded in c0 around inf 36.3%
times-frac37.7%
unpow237.7%
unpow237.7%
times-frac55.4%
unpow255.4%
*-commutative55.4%
associate-*l/52.9%
associate-/l*54.2%
associate-*r/54.2%
Simplified54.2%
unpow254.2%
times-frac37.6%
associate-/r*50.3%
associate-/l*52.8%
Applied egg-rr52.8%
Final simplification54.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ (* d d) (* D D)) (* (/ (/ c0 h) w) (/ c0 w)))))
(if (<= D 1.1e-140)
0.0
(if (<= D 1.52e-88)
t_0
(if (<= D 5.8e-16)
(* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
(if (<= D 1.35e+154) t_0 0.0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w));
double tmp;
if (D <= 1.1e-140) {
tmp = 0.0;
} else if (D <= 1.52e-88) {
tmp = t_0;
} else if (D <= 5.8e-16) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if (D <= 1.35e+154) {
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 = ((d_1 * d_1) / (d * d)) * (((c0 / h) / w) * (c0 / w))
if (d <= 1.1d-140) then
tmp = 0.0d0
else if (d <= 1.52d-88) then
tmp = t_0
else if (d <= 5.8d-16) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else if (d <= 1.35d+154) 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 = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w));
double tmp;
if (D <= 1.1e-140) {
tmp = 0.0;
} else if (D <= 1.52e-88) {
tmp = t_0;
} else if (D <= 5.8e-16) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if (D <= 1.35e+154) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w)) tmp = 0 if D <= 1.1e-140: tmp = 0.0 elif D <= 1.52e-88: tmp = t_0 elif D <= 5.8e-16: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) elif D <= 1.35e+154: tmp = t_0 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(Float64(Float64(c0 / h) / w) * Float64(c0 / w))) tmp = 0.0 if (D <= 1.1e-140) tmp = 0.0; elseif (D <= 1.52e-88) tmp = t_0; elseif (D <= 5.8e-16) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); elseif (D <= 1.35e+154) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w)); tmp = 0.0; if (D <= 1.1e-140) tmp = 0.0; elseif (D <= 1.52e-88) tmp = t_0; elseif (D <= 5.8e-16) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); elseif (D <= 1.35e+154) 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[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, 1.1e-140], 0.0, If[LessEqual[D, 1.52e-88], t$95$0, If[LessEqual[D, 5.8e-16], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 1.35e+154], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d \cdot d}{D \cdot D} \cdot \left(\frac{\frac{c0}{h}}{w} \cdot \frac{c0}{w}\right)\\
\mathbf{if}\;D \leq 1.1 \cdot 10^{-140}:\\
\;\;\;\;0\\
\mathbf{elif}\;D \leq 1.52 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;D \leq 5.8 \cdot 10^{-16}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{elif}\;D \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if D < 1.1e-140 or 1.35000000000000003e154 < D Initial program 26.0%
times-frac23.9%
fma-def23.9%
associate-/r*24.0%
difference-of-squares28.4%
Simplified35.6%
Taylor expanded in c0 around -inf 4.1%
associate-*r*4.1%
distribute-rgt1-in4.1%
metadata-eval4.1%
mul0-lft33.8%
metadata-eval33.8%
mul0-lft4.6%
metadata-eval4.6%
distribute-lft1-in4.6%
*-commutative4.6%
distribute-lft1-in4.6%
metadata-eval4.6%
mul0-lft33.8%
Simplified33.8%
Taylor expanded in c0 around 0 39.6%
if 1.1e-140 < D < 1.52e-88 or 5.7999999999999996e-16 < D < 1.35000000000000003e154Initial program 40.8%
associate-*l*39.0%
difference-of-squares49.8%
associate-*l*49.4%
associate-*l*49.4%
Simplified49.4%
Taylor expanded in c0 around inf 43.3%
times-frac43.1%
unpow243.1%
unpow243.1%
unpow243.1%
*-commutative43.1%
unpow243.1%
Simplified43.1%
Taylor expanded in c0 around 0 43.1%
unpow243.1%
unpow243.1%
*-commutative43.1%
times-frac45.7%
associate-*r/45.5%
times-frac52.2%
Simplified52.2%
if 1.52e-88 < D < 5.7999999999999996e-16Initial program 34.8%
Taylor expanded in c0 around -inf 27.0%
fma-def27.0%
associate-/l*27.0%
*-commutative27.0%
unpow227.0%
unpow227.0%
unpow227.0%
associate-*r*27.0%
Simplified69.3%
Taylor expanded in c0 around 0 66.0%
*-commutative66.0%
unpow266.0%
associate-/l*66.0%
unpow266.0%
*-commutative66.0%
unpow266.0%
Simplified66.0%
Final simplification44.6%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= D 8e-143)
0.0
(if (<= D 6.7e-88)
(/ (* (* d d) (* (/ c0 h) (/ c0 (* w w)))) (* D D))
(if (<= D 1.65e-15)
(* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
(if (<= D 1.15e+153)
(* (/ (* d d) (* D D)) (* (/ (/ c0 h) w) (/ c0 w)))
0.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (D <= 8e-143) {
tmp = 0.0;
} else if (D <= 6.7e-88) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if (D <= 1.65e-15) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if (D <= 1.15e+153) {
tmp = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w));
} 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 <= 8d-143) then
tmp = 0.0d0
else if (d <= 6.7d-88) then
tmp = ((d_1 * d_1) * ((c0 / h) * (c0 / (w * w)))) / (d * d)
else if (d <= 1.65d-15) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else if (d <= 1.15d+153) then
tmp = ((d_1 * d_1) / (d * d)) * (((c0 / h) / w) * (c0 / w))
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 <= 8e-143) {
tmp = 0.0;
} else if (D <= 6.7e-88) {
tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D);
} else if (D <= 1.65e-15) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if (D <= 1.15e+153) {
tmp = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if D <= 8e-143: tmp = 0.0 elif D <= 6.7e-88: tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D) elif D <= 1.65e-15: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) elif D <= 1.15e+153: tmp = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w)) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (D <= 8e-143) tmp = 0.0; elseif (D <= 6.7e-88) tmp = Float64(Float64(Float64(d * d) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))) / Float64(D * D)); elseif (D <= 1.65e-15) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); elseif (D <= 1.15e+153) tmp = Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(Float64(Float64(c0 / h) / w) * Float64(c0 / w))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (D <= 8e-143) tmp = 0.0; elseif (D <= 6.7e-88) tmp = ((d * d) * ((c0 / h) * (c0 / (w * w)))) / (D * D); elseif (D <= 1.65e-15) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); elseif (D <= 1.15e+153) tmp = ((d * d) / (D * D)) * (((c0 / h) / w) * (c0 / w)); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[D, 8e-143], 0.0, If[LessEqual[D, 6.7e-88], N[(N[(N[(d * d), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 1.65e-15], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 1.15e+153], N[(N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \leq 8 \cdot 10^{-143}:\\
\;\;\;\;0\\
\mathbf{elif}\;D \leq 6.7 \cdot 10^{-88}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D}\\
\mathbf{elif}\;D \leq 1.65 \cdot 10^{-15}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{elif}\;D \leq 1.15 \cdot 10^{+153}:\\
\;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \left(\frac{\frac{c0}{h}}{w} \cdot \frac{c0}{w}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if D < 7.9999999999999996e-143 or 1.1500000000000001e153 < D Initial program 26.2%
times-frac24.0%
fma-def24.0%
associate-/r*24.2%
difference-of-squares28.5%
Simplified35.8%
Taylor expanded in c0 around -inf 4.1%
associate-*r*4.1%
distribute-rgt1-in4.1%
metadata-eval4.1%
mul0-lft33.4%
metadata-eval33.4%
mul0-lft4.1%
metadata-eval4.1%
distribute-lft1-in4.1%
*-commutative4.1%
distribute-lft1-in4.1%
metadata-eval4.1%
mul0-lft33.4%
Simplified33.4%
Taylor expanded in c0 around 0 39.2%
if 7.9999999999999996e-143 < D < 6.69999999999999968e-88Initial program 50.1%
associate-*l*50.1%
difference-of-squares55.7%
associate-*l*55.7%
associate-*l*55.7%
Simplified55.7%
Taylor expanded in c0 around inf 56.0%
times-frac50.6%
unpow250.6%
unpow250.6%
unpow250.6%
*-commutative50.6%
unpow250.6%
Simplified50.6%
associate-*l/56.1%
times-frac61.9%
Applied egg-rr61.9%
if 6.69999999999999968e-88 < D < 1.65e-15Initial program 34.8%
Taylor expanded in c0 around -inf 27.0%
fma-def27.0%
associate-/l*27.0%
*-commutative27.0%
unpow227.0%
unpow227.0%
unpow227.0%
associate-*r*27.0%
Simplified69.3%
Taylor expanded in c0 around 0 66.0%
*-commutative66.0%
unpow266.0%
associate-/l*66.0%
unpow266.0%
*-commutative66.0%
unpow266.0%
Simplified66.0%
if 1.65e-15 < D < 1.1500000000000001e153Initial program 33.9%
associate-*l*31.1%
difference-of-squares44.6%
associate-*l*44.1%
associate-*l*44.0%
Simplified44.0%
Taylor expanded in c0 around inf 37.6%
times-frac37.3%
unpow237.3%
unpow237.3%
unpow237.3%
*-commutative37.3%
unpow237.3%
Simplified37.3%
Taylor expanded in c0 around 0 37.3%
unpow237.3%
unpow237.3%
*-commutative37.3%
times-frac37.7%
associate-*r/37.6%
times-frac44.6%
Simplified44.6%
Final simplification44.2%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* d d) 8.5e+306) (* 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 * d) <= 8.5e+306) {
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 * d_1) <= 8.5d+306) then
tmp = 0.25d0 * ((d * d) / ((d_1 * 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 * d) <= 8.5e+306) {
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 * d) <= 8.5e+306: 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 (Float64(d * d) <= 8.5e+306) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(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 * d) <= 8.5e+306) 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[N[(d * d), $MachinePrecision], 8.5e+306], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \cdot d \leq 8.5 \cdot 10^{+306}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 d d) < 8.49999999999999944e306Initial program 30.4%
Taylor expanded in c0 around -inf 11.6%
fma-def11.6%
associate-/l*11.6%
*-commutative11.6%
unpow211.6%
unpow211.6%
unpow211.6%
associate-*r*11.6%
Simplified33.0%
Taylor expanded in c0 around 0 42.5%
*-commutative42.5%
unpow242.5%
associate-/l*42.5%
unpow242.5%
*-commutative42.5%
unpow242.5%
Simplified42.5%
if 8.49999999999999944e306 < (*.f64 d d) Initial program 28.3%
times-frac26.2%
fma-def26.2%
associate-/r*26.2%
difference-of-squares33.6%
Simplified39.8%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
distribute-rgt1-in0.0%
metadata-eval0.0%
mul0-lft33.7%
metadata-eval33.7%
mul0-lft0.0%
metadata-eval0.0%
distribute-lft1-in0.0%
*-commutative0.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft33.7%
Simplified33.7%
Taylor expanded in c0 around 0 38.1%
Final simplification40.9%
(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 29.6%
times-frac27.0%
fma-def26.3%
associate-/r*26.4%
difference-of-squares31.8%
Simplified37.5%
Taylor expanded in c0 around -inf 5.0%
associate-*r*5.0%
distribute-rgt1-in5.0%
metadata-eval5.0%
mul0-lft30.8%
metadata-eval30.8%
mul0-lft5.4%
metadata-eval5.4%
distribute-lft1-in5.4%
*-commutative5.4%
distribute-lft1-in5.4%
metadata-eval5.4%
mul0-lft30.8%
Simplified30.8%
Taylor expanded in c0 around 0 36.2%
Final simplification36.2%
herbie shell --seed 2023240
(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))))))