
(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 (/ (* c0 (* d d)) (* (* D D) (* w h))))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))) t_1))
(t_3
(+
(* t_1 (* (/ c0 (* w h)) (pow (/ d D) 2.0)))
(* t_1 (/ (* d (/ d D)) (* (/ D c0) (* w h)))))))
(if (<= t_2 -0.2)
t_3
(if (<= t_2 0.0)
(* t_1 (* 0.5 (* (/ D (/ c0 D)) (* (/ h d) (/ (* w (* M M)) d)))))
(if (<= t_2 INFINITY)
t_3
(* 0.25 (* (* (/ D d) (/ D d)) (* h (* M M)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((D * D) * (w * h));
double t_1 = c0 / (2.0 * w);
double t_2 = (t_0 + sqrt(((t_0 * t_0) - (M * M)))) * t_1;
double t_3 = (t_1 * ((c0 / (w * h)) * pow((d / D), 2.0))) + (t_1 * ((d * (d / D)) / ((D / c0) * (w * h))));
double tmp;
if (t_2 <= -0.2) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1 * (0.5 * ((D / (c0 / D)) * ((h / d) * ((w * (M * M)) / d))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M)));
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((D * D) * (w * h));
double t_1 = c0 / (2.0 * w);
double t_2 = (t_0 + Math.sqrt(((t_0 * t_0) - (M * M)))) * t_1;
double t_3 = (t_1 * ((c0 / (w * h)) * Math.pow((d / D), 2.0))) + (t_1 * ((d * (d / D)) / ((D / c0) * (w * h))));
double tmp;
if (t_2 <= -0.2) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = t_1 * (0.5 * ((D / (c0 / D)) * ((h / d) * ((w * (M * M)) / d))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((D * D) * (w * h)) t_1 = c0 / (2.0 * w) t_2 = (t_0 + math.sqrt(((t_0 * t_0) - (M * M)))) * t_1 t_3 = (t_1 * ((c0 / (w * h)) * math.pow((d / D), 2.0))) + (t_1 * ((d * (d / D)) / ((D / c0) * (w * h)))) tmp = 0 if t_2 <= -0.2: tmp = t_3 elif t_2 <= 0.0: tmp = t_1 * (0.5 * ((D / (c0 / D)) * ((h / d) * ((w * (M * M)) / d)))) elif t_2 <= math.inf: tmp = t_3 else: tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(D * D) * Float64(w * h))) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))) * t_1) t_3 = Float64(Float64(t_1 * Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0))) + Float64(t_1 * Float64(Float64(d * Float64(d / D)) / Float64(Float64(D / c0) * Float64(w * h))))) tmp = 0.0 if (t_2 <= -0.2) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(t_1 * Float64(0.5 * Float64(Float64(D / Float64(c0 / D)) * Float64(Float64(h / d) * Float64(Float64(w * Float64(M * M)) / d))))); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(h * Float64(M * M)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((D * D) * (w * h)); t_1 = c0 / (2.0 * w); t_2 = (t_0 + sqrt(((t_0 * t_0) - (M * M)))) * t_1; t_3 = (t_1 * ((c0 / (w * h)) * ((d / D) ^ 2.0))) + (t_1 * ((d * (d / D)) / ((D / c0) * (w * h)))); tmp = 0.0; if (t_2 <= -0.2) tmp = t_3; elseif (t_2 <= 0.0) tmp = t_1 * (0.5 * ((D / (c0 / D)) * ((h / d) * ((w * (M * M)) / d)))); elseif (t_2 <= Inf) tmp = t_3; else tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M))); 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[(D * D), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(N[(d * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(N[(D / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -0.2], t$95$3, If[LessEqual[t$95$2, 0.0], N[(t$95$1 * N[(0.5 * N[(N[(D / N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(N[(w * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \cdot t_1\\
t_3 := t_1 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + t_1 \cdot \frac{d \cdot \frac{d}{D}}{\frac{D}{c0} \cdot \left(w \cdot h\right)}\\
\mathbf{if}\;t_2 \leq -0.2:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;t_1 \cdot \left(0.5 \cdot \left(\frac{D}{\frac{c0}{D}} \cdot \left(\frac{h}{d} \cdot \frac{w \cdot \left(M \cdot M\right)}{d}\right)\right)\right)\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\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))))) < -0.20000000000000001 or 0.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 81.3%
Simplified81.4%
distribute-lft-in81.4%
Applied egg-rr83.7%
Taylor expanded in c0 around inf 81.4%
unpow281.4%
unpow281.4%
*-commutative81.4%
associate-*r*83.8%
times-frac83.6%
times-frac83.7%
*-commutative83.7%
Simplified83.7%
clear-num83.7%
associate-*r/84.7%
frac-times88.3%
*-un-lft-identity88.3%
Applied egg-rr88.3%
if -0.20000000000000001 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 0.0Initial program 52.3%
Simplified24.3%
Taylor expanded in c0 around -inf 22.2%
+-commutative22.2%
mul-1-neg22.2%
unsub-neg22.2%
unpow222.2%
*-commutative22.2%
unpow222.2%
unpow222.2%
associate-*r*15.2%
*-commutative15.2%
unpow215.2%
*-commutative15.2%
Simplified15.2%
Taylor expanded in c0 around 0 50.6%
unpow250.6%
times-frac64.6%
unpow264.6%
*-commutative64.6%
*-commutative64.6%
*-commutative64.6%
associate-*r*64.6%
unpow264.6%
associate-/l*64.9%
times-frac80.0%
Simplified80.0%
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%
Simplified4.7%
Taylor expanded in c0 around -inf 0.1%
+-commutative0.1%
mul-1-neg0.1%
unsub-neg0.1%
unpow20.1%
*-commutative0.1%
unpow20.1%
unpow20.1%
associate-*r*0.1%
*-commutative0.1%
unpow20.1%
*-commutative0.1%
Simplified0.9%
Taylor expanded in c0 around 0 43.0%
unpow243.0%
associate-/l*42.9%
associate-/r/42.2%
unpow242.2%
associate-/l*44.5%
unpow244.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in d around 0 44.5%
unpow244.5%
associate-*l/53.5%
associate-/r/53.4%
Simplified53.4%
associate-/r/57.4%
Applied egg-rr57.4%
Final simplification67.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (* h (* M M)))
(t_2 (* 0.25 (/ (* D t_1) (/ d (/ D d)))))
(t_3
(+
(* t_0 (* (/ c0 (* w h)) (pow (/ d D) 2.0)))
(* t_0 (* (/ c0 D) (* (/ d D) (/ d (* w h)))))))
(t_4 (* t_0 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))))
(if (<= M 2.7e-227)
0.0
(if (<= M 1.05e-71)
t_3
(if (<= M 7.5e-42)
(* 0.25 (* (* (/ D d) (/ D d)) t_1))
(if (<= M 2.35e-6)
t_4
(if (<= M 5.5e+36)
t_2
(if (<= M 1.35e+61) t_4 (if (<= M 8.8e+145) t_2 t_3)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = h * (M * M);
double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
double t_3 = (t_0 * ((c0 / (w * h)) * pow((d / D), 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h)))));
double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 2.7e-227) {
tmp = 0.0;
} else if (M <= 1.05e-71) {
tmp = t_3;
} else if (M <= 7.5e-42) {
tmp = 0.25 * (((D / d) * (D / d)) * t_1);
} else if (M <= 2.35e-6) {
tmp = t_4;
} else if (M <= 5.5e+36) {
tmp = t_2;
} else if (M <= 1.35e+61) {
tmp = t_4;
} else if (M <= 8.8e+145) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = h * (m * m)
t_2 = 0.25d0 * ((d * t_1) / (d_1 / (d / d_1)))
t_3 = (t_0 * ((c0 / (w * h)) * ((d_1 / d) ** 2.0d0))) + (t_0 * ((c0 / d) * ((d_1 / d) * (d_1 / (w * h)))))
t_4 = t_0 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
if (m <= 2.7d-227) then
tmp = 0.0d0
else if (m <= 1.05d-71) then
tmp = t_3
else if (m <= 7.5d-42) then
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_1)
else if (m <= 2.35d-6) then
tmp = t_4
else if (m <= 5.5d+36) then
tmp = t_2
else if (m <= 1.35d+61) then
tmp = t_4
else if (m <= 8.8d+145) then
tmp = t_2
else
tmp = t_3
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);
double t_1 = h * (M * M);
double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
double t_3 = (t_0 * ((c0 / (w * h)) * Math.pow((d / D), 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h)))));
double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 2.7e-227) {
tmp = 0.0;
} else if (M <= 1.05e-71) {
tmp = t_3;
} else if (M <= 7.5e-42) {
tmp = 0.25 * (((D / d) * (D / d)) * t_1);
} else if (M <= 2.35e-6) {
tmp = t_4;
} else if (M <= 5.5e+36) {
tmp = t_2;
} else if (M <= 1.35e+61) {
tmp = t_4;
} else if (M <= 8.8e+145) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = h * (M * M) t_2 = 0.25 * ((D * t_1) / (d / (D / d))) t_3 = (t_0 * ((c0 / (w * h)) * math.pow((d / D), 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h))))) t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))) tmp = 0 if M <= 2.7e-227: tmp = 0.0 elif M <= 1.05e-71: tmp = t_3 elif M <= 7.5e-42: tmp = 0.25 * (((D / d) * (D / d)) * t_1) elif M <= 2.35e-6: tmp = t_4 elif M <= 5.5e+36: tmp = t_2 elif M <= 1.35e+61: tmp = t_4 elif M <= 8.8e+145: tmp = t_2 else: tmp = t_3 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(h * Float64(M * M)) t_2 = Float64(0.25 * Float64(Float64(D * t_1) / Float64(d / Float64(D / d)))) t_3 = Float64(Float64(t_0 * Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0))) + Float64(t_0 * Float64(Float64(c0 / D) * Float64(Float64(d / D) * Float64(d / Float64(w * h)))))) t_4 = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h))))) tmp = 0.0 if (M <= 2.7e-227) tmp = 0.0; elseif (M <= 1.05e-71) tmp = t_3; elseif (M <= 7.5e-42) tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_1)); elseif (M <= 2.35e-6) tmp = t_4; elseif (M <= 5.5e+36) tmp = t_2; elseif (M <= 1.35e+61) tmp = t_4; elseif (M <= 8.8e+145) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = h * (M * M); t_2 = 0.25 * ((D * t_1) / (d / (D / d))); t_3 = (t_0 * ((c0 / (w * h)) * ((d / D) ^ 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h))))); t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))); tmp = 0.0; if (M <= 2.7e-227) tmp = 0.0; elseif (M <= 1.05e-71) tmp = t_3; elseif (M <= 7.5e-42) tmp = 0.25 * (((D / d) * (D / d)) * t_1); elseif (M <= 2.35e-6) tmp = t_4; elseif (M <= 5.5e+36) tmp = t_2; elseif (M <= 1.35e+61) tmp = t_4; elseif (M <= 8.8e+145) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(N[(D * t$95$1), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(c0 / D), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2.7e-227], 0.0, If[LessEqual[M, 1.05e-71], t$95$3, If[LessEqual[M, 7.5e-42], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.35e-6], t$95$4, If[LessEqual[M, 5.5e+36], t$95$2, If[LessEqual[M, 1.35e+61], t$95$4, If[LessEqual[M, 8.8e+145], t$95$2, t$95$3]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := h \cdot \left(M \cdot M\right)\\
t_2 := 0.25 \cdot \frac{D \cdot t_1}{\frac{d}{\frac{D}{d}}}\\
t_3 := t_0 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + t_0 \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right)\\
t_4 := t_0 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\
\mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 1.05 \cdot 10^{-71}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;M \leq 7.5 \cdot 10^{-42}:\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_1\right)\\
\mathbf{elif}\;M \leq 2.35 \cdot 10^{-6}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;M \leq 5.5 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;M \leq 1.35 \cdot 10^{+61}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;M \leq 8.8 \cdot 10^{+145}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if M < 2.7e-227Initial program 28.2%
Simplified28.3%
Taylor expanded in c0 around -inf 4.3%
mul-1-neg4.3%
distribute-lft-in4.3%
Simplified34.8%
Taylor expanded in c0 around 0 39.6%
if 2.7e-227 < M < 1.0500000000000001e-71 or 8.80000000000000035e145 < M Initial program 18.6%
Simplified23.8%
distribute-lft-in23.8%
Applied egg-rr37.5%
Taylor expanded in c0 around inf 34.0%
unpow234.0%
unpow234.0%
*-commutative34.0%
associate-*r*40.9%
times-frac45.0%
times-frac51.4%
*-commutative51.4%
Simplified51.4%
if 1.0500000000000001e-71 < M < 7.49999999999999972e-42Initial program 17.4%
Simplified17.4%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in c0 around 0 34.3%
unpow234.3%
associate-/l*34.3%
associate-/r/34.3%
unpow234.3%
associate-/l*35.8%
unpow235.8%
*-commutative35.8%
Simplified35.8%
Taylor expanded in d around 0 35.8%
unpow235.8%
associate-*l/35.6%
associate-/r/35.6%
Simplified35.6%
associate-/r/51.1%
Applied egg-rr51.1%
if 7.49999999999999972e-42 < M < 2.34999999999999995e-6 or 5.5000000000000002e36 < M < 1.3500000000000001e61Initial program 77.0%
Simplified83.4%
Taylor expanded in c0 around inf 77.1%
times-frac83.7%
unpow283.7%
unpow283.7%
Simplified83.7%
if 2.34999999999999995e-6 < M < 5.5000000000000002e36 or 1.3500000000000001e61 < M < 8.80000000000000035e145Initial program 22.3%
Simplified28.0%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
*-commutative0.0%
Simplified1.1%
Taylor expanded in c0 around 0 36.4%
unpow236.4%
associate-/l*36.2%
associate-/r/35.6%
unpow235.6%
associate-/l*35.9%
unpow235.9%
*-commutative35.9%
Simplified35.9%
associate-*l/39.7%
associate-/l*45.9%
Applied egg-rr45.9%
Final simplification45.6%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ d (* w h)))
(t_2 (* h (* M M)))
(t_3 (* 0.25 (/ (* D t_2) (/ d (/ D d)))))
(t_4 (* t_0 (* (/ c0 (* w h)) (pow (/ d D) 2.0))))
(t_5 (* t_0 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))))
(if (<= M 2.7e-227)
0.0
(if (<= M 1.2e-71)
(+ t_4 (* t_0 (* (/ (/ d D) (/ D c0)) t_1)))
(if (<= M 6e-42)
(* 0.25 (* (* (/ D d) (/ D d)) t_2))
(if (<= M 2.7e-6)
t_5
(if (<= M 5.5e+41)
t_3
(if (<= M 3.1e+63)
t_5
(if (<= M 1.4e+145)
t_3
(+ t_4 (* t_0 (* (/ c0 D) (* (/ d D) t_1)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = d / (w * h);
double t_2 = h * (M * M);
double t_3 = 0.25 * ((D * t_2) / (d / (D / d)));
double t_4 = t_0 * ((c0 / (w * h)) * pow((d / D), 2.0));
double t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 2.7e-227) {
tmp = 0.0;
} else if (M <= 1.2e-71) {
tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1));
} else if (M <= 6e-42) {
tmp = 0.25 * (((D / d) * (D / d)) * t_2);
} else if (M <= 2.7e-6) {
tmp = t_5;
} else if (M <= 5.5e+41) {
tmp = t_3;
} else if (M <= 3.1e+63) {
tmp = t_5;
} else if (M <= 1.4e+145) {
tmp = t_3;
} else {
tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = d_1 / (w * h)
t_2 = h * (m * m)
t_3 = 0.25d0 * ((d * t_2) / (d_1 / (d / d_1)))
t_4 = t_0 * ((c0 / (w * h)) * ((d_1 / d) ** 2.0d0))
t_5 = t_0 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
if (m <= 2.7d-227) then
tmp = 0.0d0
else if (m <= 1.2d-71) then
tmp = t_4 + (t_0 * (((d_1 / d) / (d / c0)) * t_1))
else if (m <= 6d-42) then
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_2)
else if (m <= 2.7d-6) then
tmp = t_5
else if (m <= 5.5d+41) then
tmp = t_3
else if (m <= 3.1d+63) then
tmp = t_5
else if (m <= 1.4d+145) then
tmp = t_3
else
tmp = t_4 + (t_0 * ((c0 / d) * ((d_1 / d) * t_1)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = d / (w * h);
double t_2 = h * (M * M);
double t_3 = 0.25 * ((D * t_2) / (d / (D / d)));
double t_4 = t_0 * ((c0 / (w * h)) * Math.pow((d / D), 2.0));
double t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 2.7e-227) {
tmp = 0.0;
} else if (M <= 1.2e-71) {
tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1));
} else if (M <= 6e-42) {
tmp = 0.25 * (((D / d) * (D / d)) * t_2);
} else if (M <= 2.7e-6) {
tmp = t_5;
} else if (M <= 5.5e+41) {
tmp = t_3;
} else if (M <= 3.1e+63) {
tmp = t_5;
} else if (M <= 1.4e+145) {
tmp = t_3;
} else {
tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = d / (w * h) t_2 = h * (M * M) t_3 = 0.25 * ((D * t_2) / (d / (D / d))) t_4 = t_0 * ((c0 / (w * h)) * math.pow((d / D), 2.0)) t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))) tmp = 0 if M <= 2.7e-227: tmp = 0.0 elif M <= 1.2e-71: tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1)) elif M <= 6e-42: tmp = 0.25 * (((D / d) * (D / d)) * t_2) elif M <= 2.7e-6: tmp = t_5 elif M <= 5.5e+41: tmp = t_3 elif M <= 3.1e+63: tmp = t_5 elif M <= 1.4e+145: tmp = t_3 else: tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(d / Float64(w * h)) t_2 = Float64(h * Float64(M * M)) t_3 = Float64(0.25 * Float64(Float64(D * t_2) / Float64(d / Float64(D / d)))) t_4 = Float64(t_0 * Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0))) t_5 = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h))))) tmp = 0.0 if (M <= 2.7e-227) tmp = 0.0; elseif (M <= 1.2e-71) tmp = Float64(t_4 + Float64(t_0 * Float64(Float64(Float64(d / D) / Float64(D / c0)) * t_1))); elseif (M <= 6e-42) tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_2)); elseif (M <= 2.7e-6) tmp = t_5; elseif (M <= 5.5e+41) tmp = t_3; elseif (M <= 3.1e+63) tmp = t_5; elseif (M <= 1.4e+145) tmp = t_3; else tmp = Float64(t_4 + Float64(t_0 * Float64(Float64(c0 / D) * Float64(Float64(d / D) * t_1)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = d / (w * h); t_2 = h * (M * M); t_3 = 0.25 * ((D * t_2) / (d / (D / d))); t_4 = t_0 * ((c0 / (w * h)) * ((d / D) ^ 2.0)); t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))); tmp = 0.0; if (M <= 2.7e-227) tmp = 0.0; elseif (M <= 1.2e-71) tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1)); elseif (M <= 6e-42) tmp = 0.25 * (((D / d) * (D / d)) * t_2); elseif (M <= 2.7e-6) tmp = t_5; elseif (M <= 5.5e+41) tmp = t_3; elseif (M <= 3.1e+63) tmp = t_5; elseif (M <= 1.4e+145) tmp = t_3; else tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.25 * N[(N[(D * t$95$2), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2.7e-227], 0.0, If[LessEqual[M, 1.2e-71], N[(t$95$4 + N[(t$95$0 * N[(N[(N[(d / D), $MachinePrecision] / N[(D / c0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 6e-42], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.7e-6], t$95$5, If[LessEqual[M, 5.5e+41], t$95$3, If[LessEqual[M, 3.1e+63], t$95$5, If[LessEqual[M, 1.4e+145], t$95$3, N[(t$95$4 + N[(t$95$0 * N[(N[(c0 / D), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{d}{w \cdot h}\\
t_2 := h \cdot \left(M \cdot M\right)\\
t_3 := 0.25 \cdot \frac{D \cdot t_2}{\frac{d}{\frac{D}{d}}}\\
t_4 := t_0 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right)\\
t_5 := t_0 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\
\mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 1.2 \cdot 10^{-71}:\\
\;\;\;\;t_4 + t_0 \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot t_1\right)\\
\mathbf{elif}\;M \leq 6 \cdot 10^{-42}:\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_2\right)\\
\mathbf{elif}\;M \leq 2.7 \cdot 10^{-6}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;M \leq 5.5 \cdot 10^{+41}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;M \leq 3.1 \cdot 10^{+63}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;M \leq 1.4 \cdot 10^{+145}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_4 + t_0 \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot t_1\right)\right)\\
\end{array}
\end{array}
if M < 2.7e-227Initial program 28.2%
Simplified28.3%
Taylor expanded in c0 around -inf 4.3%
mul-1-neg4.3%
distribute-lft-in4.3%
Simplified34.8%
Taylor expanded in c0 around 0 39.6%
if 2.7e-227 < M < 1.2e-71Initial program 27.2%
Simplified35.6%
distribute-lft-in35.6%
Applied egg-rr57.6%
Taylor expanded in c0 around inf 28.9%
unpow228.9%
unpow228.9%
*-commutative28.9%
associate-*r*37.2%
times-frac43.9%
times-frac51.4%
*-commutative51.4%
Simplified51.4%
clear-num51.4%
associate-*r/53.7%
frac-times56.5%
*-un-lft-identity56.5%
Applied egg-rr56.5%
times-frac53.1%
Applied egg-rr53.1%
if 1.2e-71 < M < 6.00000000000000054e-42Initial program 17.4%
Simplified17.4%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in c0 around 0 34.3%
unpow234.3%
associate-/l*34.3%
associate-/r/34.3%
unpow234.3%
associate-/l*35.8%
unpow235.8%
*-commutative35.8%
Simplified35.8%
Taylor expanded in d around 0 35.8%
unpow235.8%
associate-*l/35.6%
associate-/r/35.6%
Simplified35.6%
associate-/r/51.1%
Applied egg-rr51.1%
if 6.00000000000000054e-42 < M < 2.69999999999999998e-6 or 5.5000000000000003e41 < M < 3.1000000000000001e63Initial program 77.0%
Simplified83.4%
Taylor expanded in c0 around inf 77.1%
times-frac83.7%
unpow283.7%
unpow283.7%
Simplified83.7%
if 2.69999999999999998e-6 < M < 5.5000000000000003e41 or 3.1000000000000001e63 < M < 1.3999999999999999e145Initial program 22.3%
Simplified28.0%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
*-commutative0.0%
Simplified1.1%
Taylor expanded in c0 around 0 36.4%
unpow236.4%
associate-/l*36.2%
associate-/r/35.6%
unpow235.6%
associate-/l*35.9%
unpow235.9%
*-commutative35.9%
Simplified35.9%
associate-*l/39.7%
associate-/l*45.9%
Applied egg-rr45.9%
if 1.3999999999999999e145 < M Initial program 4.5%
Simplified4.5%
distribute-lft-in4.5%
Applied egg-rr4.5%
Taylor expanded in c0 around inf 42.4%
unpow242.4%
unpow242.4%
*-commutative42.4%
associate-*r*46.9%
times-frac46.9%
times-frac51.5%
*-commutative51.5%
Simplified51.5%
Final simplification45.8%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (* h (* M M)))
(t_2 (* 0.25 (/ (* D t_1) (/ d (/ D d)))))
(t_3 (* t_0 (* (/ c0 (* w h)) (pow (/ d D) 2.0))))
(t_4 (* t_0 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))))
(if (<= M 2.7e-227)
0.0
(if (<= M 1.25e-71)
(+ t_3 (* t_0 (* (/ (/ d D) (/ D c0)) (/ d (* w h)))))
(if (<= M 7.5e-42)
(* 0.25 (* (* (/ D d) (/ D d)) t_1))
(if (<= M 2.2e-6)
t_4
(if (<= M 2.9e+40)
t_2
(if (<= M 4e+60)
t_4
(if (<= M 2.5e+140)
t_2
(+
t_3
(* t_0 (/ (* c0 (* d (/ d D))) (* D (* w h))))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = h * (M * M);
double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
double t_3 = t_0 * ((c0 / (w * h)) * pow((d / D), 2.0));
double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 2.7e-227) {
tmp = 0.0;
} else if (M <= 1.25e-71) {
tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h))));
} else if (M <= 7.5e-42) {
tmp = 0.25 * (((D / d) * (D / d)) * t_1);
} else if (M <= 2.2e-6) {
tmp = t_4;
} else if (M <= 2.9e+40) {
tmp = t_2;
} else if (M <= 4e+60) {
tmp = t_4;
} else if (M <= 2.5e+140) {
tmp = t_2;
} else {
tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = h * (m * m)
t_2 = 0.25d0 * ((d * t_1) / (d_1 / (d / d_1)))
t_3 = t_0 * ((c0 / (w * h)) * ((d_1 / d) ** 2.0d0))
t_4 = t_0 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
if (m <= 2.7d-227) then
tmp = 0.0d0
else if (m <= 1.25d-71) then
tmp = t_3 + (t_0 * (((d_1 / d) / (d / c0)) * (d_1 / (w * h))))
else if (m <= 7.5d-42) then
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_1)
else if (m <= 2.2d-6) then
tmp = t_4
else if (m <= 2.9d+40) then
tmp = t_2
else if (m <= 4d+60) then
tmp = t_4
else if (m <= 2.5d+140) then
tmp = t_2
else
tmp = t_3 + (t_0 * ((c0 * (d_1 * (d_1 / d))) / (d * (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 = c0 / (2.0 * w);
double t_1 = h * (M * M);
double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
double t_3 = t_0 * ((c0 / (w * h)) * Math.pow((d / D), 2.0));
double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 2.7e-227) {
tmp = 0.0;
} else if (M <= 1.25e-71) {
tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h))));
} else if (M <= 7.5e-42) {
tmp = 0.25 * (((D / d) * (D / d)) * t_1);
} else if (M <= 2.2e-6) {
tmp = t_4;
} else if (M <= 2.9e+40) {
tmp = t_2;
} else if (M <= 4e+60) {
tmp = t_4;
} else if (M <= 2.5e+140) {
tmp = t_2;
} else {
tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (w * h))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = h * (M * M) t_2 = 0.25 * ((D * t_1) / (d / (D / d))) t_3 = t_0 * ((c0 / (w * h)) * math.pow((d / D), 2.0)) t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))) tmp = 0 if M <= 2.7e-227: tmp = 0.0 elif M <= 1.25e-71: tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h)))) elif M <= 7.5e-42: tmp = 0.25 * (((D / d) * (D / d)) * t_1) elif M <= 2.2e-6: tmp = t_4 elif M <= 2.9e+40: tmp = t_2 elif M <= 4e+60: tmp = t_4 elif M <= 2.5e+140: tmp = t_2 else: tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (w * h)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(h * Float64(M * M)) t_2 = Float64(0.25 * Float64(Float64(D * t_1) / Float64(d / Float64(D / d)))) t_3 = Float64(t_0 * Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0))) t_4 = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h))))) tmp = 0.0 if (M <= 2.7e-227) tmp = 0.0; elseif (M <= 1.25e-71) tmp = Float64(t_3 + Float64(t_0 * Float64(Float64(Float64(d / D) / Float64(D / c0)) * Float64(d / Float64(w * h))))); elseif (M <= 7.5e-42) tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_1)); elseif (M <= 2.2e-6) tmp = t_4; elseif (M <= 2.9e+40) tmp = t_2; elseif (M <= 4e+60) tmp = t_4; elseif (M <= 2.5e+140) tmp = t_2; else tmp = Float64(t_3 + Float64(t_0 * Float64(Float64(c0 * Float64(d * Float64(d / D))) / Float64(D * Float64(w * h))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = h * (M * M); t_2 = 0.25 * ((D * t_1) / (d / (D / d))); t_3 = t_0 * ((c0 / (w * h)) * ((d / D) ^ 2.0)); t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))); tmp = 0.0; if (M <= 2.7e-227) tmp = 0.0; elseif (M <= 1.25e-71) tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h)))); elseif (M <= 7.5e-42) tmp = 0.25 * (((D / d) * (D / d)) * t_1); elseif (M <= 2.2e-6) tmp = t_4; elseif (M <= 2.9e+40) tmp = t_2; elseif (M <= 4e+60) tmp = t_4; elseif (M <= 2.5e+140) tmp = t_2; else tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (w * h)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(N[(D * t$95$1), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2.7e-227], 0.0, If[LessEqual[M, 1.25e-71], N[(t$95$3 + N[(t$95$0 * N[(N[(N[(d / D), $MachinePrecision] / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 7.5e-42], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.2e-6], t$95$4, If[LessEqual[M, 2.9e+40], t$95$2, If[LessEqual[M, 4e+60], t$95$4, If[LessEqual[M, 2.5e+140], t$95$2, N[(t$95$3 + N[(t$95$0 * N[(N[(c0 * N[(d * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := h \cdot \left(M \cdot M\right)\\
t_2 := 0.25 \cdot \frac{D \cdot t_1}{\frac{d}{\frac{D}{d}}}\\
t_3 := t_0 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right)\\
t_4 := t_0 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\
\mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 1.25 \cdot 10^{-71}:\\
\;\;\;\;t_3 + t_0 \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot \frac{d}{w \cdot h}\right)\\
\mathbf{elif}\;M \leq 7.5 \cdot 10^{-42}:\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_1\right)\\
\mathbf{elif}\;M \leq 2.2 \cdot 10^{-6}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;M \leq 2.9 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;M \leq 4 \cdot 10^{+60}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;M \leq 2.5 \cdot 10^{+140}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3 + t_0 \cdot \frac{c0 \cdot \left(d \cdot \frac{d}{D}\right)}{D \cdot \left(w \cdot h\right)}\\
\end{array}
\end{array}
if M < 2.7e-227Initial program 28.2%
Simplified28.3%
Taylor expanded in c0 around -inf 4.3%
mul-1-neg4.3%
distribute-lft-in4.3%
Simplified34.8%
Taylor expanded in c0 around 0 39.6%
if 2.7e-227 < M < 1.24999999999999999e-71Initial program 27.2%
Simplified35.6%
distribute-lft-in35.6%
Applied egg-rr57.6%
Taylor expanded in c0 around inf 28.9%
unpow228.9%
unpow228.9%
*-commutative28.9%
associate-*r*37.2%
times-frac43.9%
times-frac51.4%
*-commutative51.4%
Simplified51.4%
clear-num51.4%
associate-*r/53.7%
frac-times56.5%
*-un-lft-identity56.5%
Applied egg-rr56.5%
times-frac53.1%
Applied egg-rr53.1%
if 1.24999999999999999e-71 < M < 7.49999999999999972e-42Initial program 17.4%
Simplified17.4%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in c0 around 0 34.3%
unpow234.3%
associate-/l*34.3%
associate-/r/34.3%
unpow234.3%
associate-/l*35.8%
unpow235.8%
*-commutative35.8%
Simplified35.8%
Taylor expanded in d around 0 35.8%
unpow235.8%
associate-*l/35.6%
associate-/r/35.6%
Simplified35.6%
associate-/r/51.1%
Applied egg-rr51.1%
if 7.49999999999999972e-42 < M < 2.2000000000000001e-6 or 2.90000000000000017e40 < M < 3.9999999999999998e60Initial program 77.0%
Simplified83.4%
Taylor expanded in c0 around inf 77.1%
times-frac83.7%
unpow283.7%
unpow283.7%
Simplified83.7%
if 2.2000000000000001e-6 < M < 2.90000000000000017e40 or 3.9999999999999998e60 < M < 2.50000000000000004e140Initial program 24.5%
Simplified30.8%
Taylor expanded in c0 around -inf 0.0%
+-commutative0.0%
mul-1-neg0.0%
unsub-neg0.0%
unpow20.0%
*-commutative0.0%
unpow20.0%
unpow20.0%
associate-*r*0.0%
*-commutative0.0%
unpow20.0%
*-commutative0.0%
Simplified1.2%
Taylor expanded in c0 around 0 36.5%
unpow236.5%
associate-/l*36.2%
associate-/r/35.5%
unpow235.5%
associate-/l*35.9%
unpow235.9%
*-commutative35.9%
Simplified35.9%
associate-*l/40.1%
associate-/l*43.6%
Applied egg-rr43.6%
if 2.50000000000000004e140 < M Initial program 4.1%
Simplified4.1%
distribute-lft-in4.1%
Applied egg-rr4.1%
Taylor expanded in c0 around inf 37.5%
unpow237.5%
unpow237.5%
*-commutative37.5%
associate-*r*41.5%
times-frac41.5%
times-frac45.6%
*-commutative45.6%
Simplified45.6%
*-commutative45.6%
associate-*r/45.6%
frac-times49.5%
Applied egg-rr49.5%
Final simplification45.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (* h (* M M))))
(if (<= c0 -4.4e+85)
(* 0.25 (/ (* D t_1) (/ d (/ D d))))
(if (<= c0 -8.2e-15)
(+
(* t_0 (* (/ c0 D) (* (/ d D) (/ d (* w h)))))
(* t_0 (/ (* c0 (* d d)) (* D (* D (* w h))))))
(if (or (<= c0 3.4e+127) (not (<= c0 1.1e+243)))
(* 0.25 (* (* (/ D d) (/ D d)) t_1))
(* t_0 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = h * (M * M);
double tmp;
if (c0 <= -4.4e+85) {
tmp = 0.25 * ((D * t_1) / (d / (D / d)));
} else if (c0 <= -8.2e-15) {
tmp = (t_0 * ((c0 / D) * ((d / D) * (d / (w * h))))) + (t_0 * ((c0 * (d * d)) / (D * (D * (w * h)))));
} else if ((c0 <= 3.4e+127) || !(c0 <= 1.1e+243)) {
tmp = 0.25 * (((D / d) * (D / d)) * t_1);
} else {
tmp = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (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 = c0 / (2.0d0 * w)
t_1 = h * (m * m)
if (c0 <= (-4.4d+85)) then
tmp = 0.25d0 * ((d * t_1) / (d_1 / (d / d_1)))
else if (c0 <= (-8.2d-15)) then
tmp = (t_0 * ((c0 / d) * ((d_1 / d) * (d_1 / (w * h))))) + (t_0 * ((c0 * (d_1 * d_1)) / (d * (d * (w * h)))))
else if ((c0 <= 3.4d+127) .or. (.not. (c0 <= 1.1d+243))) then
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_1)
else
tmp = t_0 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (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 = c0 / (2.0 * w);
double t_1 = h * (M * M);
double tmp;
if (c0 <= -4.4e+85) {
tmp = 0.25 * ((D * t_1) / (d / (D / d)));
} else if (c0 <= -8.2e-15) {
tmp = (t_0 * ((c0 / D) * ((d / D) * (d / (w * h))))) + (t_0 * ((c0 * (d * d)) / (D * (D * (w * h)))));
} else if ((c0 <= 3.4e+127) || !(c0 <= 1.1e+243)) {
tmp = 0.25 * (((D / d) * (D / d)) * t_1);
} else {
tmp = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = h * (M * M) tmp = 0 if c0 <= -4.4e+85: tmp = 0.25 * ((D * t_1) / (d / (D / d))) elif c0 <= -8.2e-15: tmp = (t_0 * ((c0 / D) * ((d / D) * (d / (w * h))))) + (t_0 * ((c0 * (d * d)) / (D * (D * (w * h))))) elif (c0 <= 3.4e+127) or not (c0 <= 1.1e+243): tmp = 0.25 * (((D / d) * (D / d)) * t_1) else: tmp = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(h * Float64(M * M)) tmp = 0.0 if (c0 <= -4.4e+85) tmp = Float64(0.25 * Float64(Float64(D * t_1) / Float64(d / Float64(D / d)))); elseif (c0 <= -8.2e-15) tmp = Float64(Float64(t_0 * Float64(Float64(c0 / D) * Float64(Float64(d / D) * Float64(d / Float64(w * h))))) + Float64(t_0 * Float64(Float64(c0 * Float64(d * d)) / Float64(D * Float64(D * Float64(w * h)))))); elseif ((c0 <= 3.4e+127) || !(c0 <= 1.1e+243)) tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_1)); else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = h * (M * M); tmp = 0.0; if (c0 <= -4.4e+85) tmp = 0.25 * ((D * t_1) / (d / (D / d))); elseif (c0 <= -8.2e-15) tmp = (t_0 * ((c0 / D) * ((d / D) * (d / (w * h))))) + (t_0 * ((c0 * (d * d)) / (D * (D * (w * h))))); elseif ((c0 <= 3.4e+127) || ~((c0 <= 1.1e+243))) tmp = 0.25 * (((D / d) * (D / d)) * t_1); else tmp = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -4.4e+85], N[(0.25 * N[(N[(D * t$95$1), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -8.2e-15], N[(N[(t$95$0 * N[(N[(c0 / D), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 3.4e+127], N[Not[LessEqual[c0, 1.1e+243]], $MachinePrecision]], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;c0 \leq -4.4 \cdot 10^{+85}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot t_1}{\frac{d}{\frac{D}{d}}}\\
\mathbf{elif}\;c0 \leq -8.2 \cdot 10^{-15}:\\
\;\;\;\;t_0 \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right) + t_0 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\
\mathbf{elif}\;c0 \leq 3.4 \cdot 10^{+127} \lor \neg \left(c0 \leq 1.1 \cdot 10^{+243}\right):\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\
\end{array}
\end{array}
if c0 < -4.4000000000000003e85Initial program 34.3%
Simplified30.8%
Taylor expanded in c0 around -inf 0.7%
+-commutative0.7%
mul-1-neg0.7%
unsub-neg0.7%
unpow20.7%
*-commutative0.7%
unpow20.7%
unpow20.7%
associate-*r*0.7%
*-commutative0.7%
unpow20.7%
*-commutative0.7%
Simplified2.2%
Taylor expanded in c0 around 0 31.7%
unpow231.7%
associate-/l*29.9%
associate-/r/29.5%
unpow229.5%
associate-/l*35.0%
unpow235.0%
*-commutative35.0%
Simplified35.0%
associate-*l/40.6%
associate-/l*49.5%
Applied egg-rr49.5%
if -4.4000000000000003e85 < c0 < -8.20000000000000072e-15Initial program 35.6%
Simplified39.0%
distribute-lft-in39.0%
Applied egg-rr54.7%
Taylor expanded in c0 around inf 45.8%
unpow245.8%
unpow245.8%
*-commutative45.8%
associate-*r*52.3%
times-frac53.2%
times-frac56.3%
*-commutative56.3%
Simplified56.3%
unpow256.3%
times-frac49.2%
frac-times45.8%
*-commutative45.8%
*-commutative45.8%
associate-*l*53.2%
*-commutative53.2%
Applied egg-rr53.2%
if -8.20000000000000072e-15 < c0 < 3.39999999999999977e127 or 1.10000000000000004e243 < c0 Initial program 17.8%
Simplified22.8%
Taylor expanded in c0 around -inf 0.9%
+-commutative0.9%
mul-1-neg0.9%
unsub-neg0.9%
unpow20.9%
*-commutative0.9%
unpow20.9%
unpow20.9%
associate-*r*0.9%
*-commutative0.9%
unpow20.9%
*-commutative0.9%
Simplified1.1%
Taylor expanded in c0 around 0 40.5%
unpow240.5%
associate-/l*40.4%
associate-/r/40.5%
unpow240.5%
associate-/l*40.8%
unpow240.8%
*-commutative40.8%
Simplified40.8%
Taylor expanded in d around 0 40.8%
unpow240.8%
associate-*l/45.9%
associate-/r/45.8%
Simplified45.8%
associate-/r/50.0%
Applied egg-rr50.0%
if 3.39999999999999977e127 < c0 < 1.10000000000000004e243Initial program 50.0%
Simplified50.0%
Taylor expanded in c0 around inf 58.5%
times-frac58.6%
unpow258.6%
unpow258.6%
Simplified58.6%
Final simplification51.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* d d) (* D D))) (t_1 (/ c0 (* 2.0 w))) (t_2 (* h (* M M))))
(if (<= c0 -5.2e+85)
(* 0.25 (/ (* D t_2) (/ d (/ D d))))
(if (<= c0 -4.8e-14)
(* t_1 (+ (* (/ c0 (* w h)) t_0) (* c0 (/ t_0 (* w h)))))
(if (or (<= c0 2.6e+127) (not (<= c0 1.05e+243)))
(* 0.25 (* (* (/ D d) (/ D d)) t_2))
(* t_1 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d * d) / (D * D);
double t_1 = c0 / (2.0 * w);
double t_2 = h * (M * M);
double tmp;
if (c0 <= -5.2e+85) {
tmp = 0.25 * ((D * t_2) / (d / (D / d)));
} else if (c0 <= -4.8e-14) {
tmp = t_1 * (((c0 / (w * h)) * t_0) + (c0 * (t_0 / (w * h))));
} else if ((c0 <= 2.6e+127) || !(c0 <= 1.05e+243)) {
tmp = 0.25 * (((D / d) * (D / d)) * t_2);
} else {
tmp = t_1 * (2.0 * ((c0 / (D * D)) * ((d * d) / (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) :: t_2
real(8) :: tmp
t_0 = (d_1 * d_1) / (d * d)
t_1 = c0 / (2.0d0 * w)
t_2 = h * (m * m)
if (c0 <= (-5.2d+85)) then
tmp = 0.25d0 * ((d * t_2) / (d_1 / (d / d_1)))
else if (c0 <= (-4.8d-14)) then
tmp = t_1 * (((c0 / (w * h)) * t_0) + (c0 * (t_0 / (w * h))))
else if ((c0 <= 2.6d+127) .or. (.not. (c0 <= 1.05d+243))) then
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_2)
else
tmp = t_1 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (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 = (d * d) / (D * D);
double t_1 = c0 / (2.0 * w);
double t_2 = h * (M * M);
double tmp;
if (c0 <= -5.2e+85) {
tmp = 0.25 * ((D * t_2) / (d / (D / d)));
} else if (c0 <= -4.8e-14) {
tmp = t_1 * (((c0 / (w * h)) * t_0) + (c0 * (t_0 / (w * h))));
} else if ((c0 <= 2.6e+127) || !(c0 <= 1.05e+243)) {
tmp = 0.25 * (((D / d) * (D / d)) * t_2);
} else {
tmp = t_1 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d * d) / (D * D) t_1 = c0 / (2.0 * w) t_2 = h * (M * M) tmp = 0 if c0 <= -5.2e+85: tmp = 0.25 * ((D * t_2) / (d / (D / d))) elif c0 <= -4.8e-14: tmp = t_1 * (((c0 / (w * h)) * t_0) + (c0 * (t_0 / (w * h)))) elif (c0 <= 2.6e+127) or not (c0 <= 1.05e+243): tmp = 0.25 * (((D / d) * (D / d)) * t_2) else: tmp = t_1 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d * d) / Float64(D * D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(h * Float64(M * M)) tmp = 0.0 if (c0 <= -5.2e+85) tmp = Float64(0.25 * Float64(Float64(D * t_2) / Float64(d / Float64(D / d)))); elseif (c0 <= -4.8e-14) tmp = Float64(t_1 * Float64(Float64(Float64(c0 / Float64(w * h)) * t_0) + Float64(c0 * Float64(t_0 / Float64(w * h))))); elseif ((c0 <= 2.6e+127) || !(c0 <= 1.05e+243)) tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_2)); else tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d * d) / (D * D); t_1 = c0 / (2.0 * w); t_2 = h * (M * M); tmp = 0.0; if (c0 <= -5.2e+85) tmp = 0.25 * ((D * t_2) / (d / (D / d))); elseif (c0 <= -4.8e-14) tmp = t_1 * (((c0 / (w * h)) * t_0) + (c0 * (t_0 / (w * h)))); elseif ((c0 <= 2.6e+127) || ~((c0 <= 1.05e+243))) tmp = 0.25 * (((D / d) * (D / d)) * t_2); else tmp = t_1 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -5.2e+85], N[(0.25 * N[(N[(D * t$95$2), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -4.8e-14], N[(t$95$1 * N[(N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(c0 * N[(t$95$0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 2.6e+127], N[Not[LessEqual[c0, 1.05e+243]], $MachinePrecision]], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d \cdot d}{D \cdot D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;c0 \leq -5.2 \cdot 10^{+85}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot t_2}{\frac{d}{\frac{D}{d}}}\\
\mathbf{elif}\;c0 \leq -4.8 \cdot 10^{-14}:\\
\;\;\;\;t_1 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0 + c0 \cdot \frac{t_0}{w \cdot h}\right)\\
\mathbf{elif}\;c0 \leq 2.6 \cdot 10^{+127} \lor \neg \left(c0 \leq 1.05 \cdot 10^{+243}\right):\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\
\end{array}
\end{array}
if c0 < -5.20000000000000021e85Initial program 34.3%
Simplified30.8%
Taylor expanded in c0 around -inf 0.7%
+-commutative0.7%
mul-1-neg0.7%
unsub-neg0.7%
unpow20.7%
*-commutative0.7%
unpow20.7%
unpow20.7%
associate-*r*0.7%
*-commutative0.7%
unpow20.7%
*-commutative0.7%
Simplified2.2%
Taylor expanded in c0 around 0 31.7%
unpow231.7%
associate-/l*29.9%
associate-/r/29.5%
unpow229.5%
associate-/l*35.0%
unpow235.0%
*-commutative35.0%
Simplified35.0%
associate-*l/40.6%
associate-/l*49.5%
Applied egg-rr49.5%
if -5.20000000000000021e85 < c0 < -4.8e-14Initial program 35.6%
Simplified39.0%
Taylor expanded in c0 around inf 45.8%
associate-*r*45.8%
*-commutative45.8%
unpow245.8%
*-commutative45.8%
associate-*r/46.4%
*-commutative46.4%
unpow246.4%
*-commutative46.4%
associate-*r*46.4%
associate-/r*49.2%
unpow249.2%
unpow249.2%
Simplified49.2%
if -4.8e-14 < c0 < 2.6000000000000002e127 or 1.05e243 < c0 Initial program 17.8%
Simplified22.8%
Taylor expanded in c0 around -inf 0.9%
+-commutative0.9%
mul-1-neg0.9%
unsub-neg0.9%
unpow20.9%
*-commutative0.9%
unpow20.9%
unpow20.9%
associate-*r*0.9%
*-commutative0.9%
unpow20.9%
*-commutative0.9%
Simplified1.1%
Taylor expanded in c0 around 0 40.5%
unpow240.5%
associate-/l*40.4%
associate-/r/40.5%
unpow240.5%
associate-/l*40.8%
unpow240.8%
*-commutative40.8%
Simplified40.8%
Taylor expanded in d around 0 40.8%
unpow240.8%
associate-*l/45.9%
associate-/r/45.8%
Simplified45.8%
associate-/r/50.0%
Applied egg-rr50.0%
if 2.6000000000000002e127 < c0 < 1.05e243Initial program 50.0%
Simplified50.0%
Taylor expanded in c0 around inf 58.5%
times-frac58.6%
unpow258.6%
unpow258.6%
Simplified58.6%
Final simplification50.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* h (* M M))))
(if (<= c0 -3.8e+85)
(* 0.25 (/ (* D t_0) (/ d (/ D d))))
(if (or (<= c0 -6.8e-14) (and (not (<= c0 2.8e+127)) (<= c0 5.5e+242)))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))
(* 0.25 (* (* (/ D d) (/ D d)) t_0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = h * (M * M);
double tmp;
if (c0 <= -3.8e+85) {
tmp = 0.25 * ((D * t_0) / (d / (D / d)));
} else if ((c0 <= -6.8e-14) || (!(c0 <= 2.8e+127) && (c0 <= 5.5e+242))) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
} else {
tmp = 0.25 * (((D / d) * (D / d)) * t_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 = h * (m * m)
if (c0 <= (-3.8d+85)) then
tmp = 0.25d0 * ((d * t_0) / (d_1 / (d / d_1)))
else if ((c0 <= (-6.8d-14)) .or. (.not. (c0 <= 2.8d+127)) .and. (c0 <= 5.5d+242)) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
else
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_0)
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 (c0 <= -3.8e+85) {
tmp = 0.25 * ((D * t_0) / (d / (D / d)));
} else if ((c0 <= -6.8e-14) || (!(c0 <= 2.8e+127) && (c0 <= 5.5e+242))) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
} else {
tmp = 0.25 * (((D / d) * (D / d)) * t_0);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = h * (M * M) tmp = 0 if c0 <= -3.8e+85: tmp = 0.25 * ((D * t_0) / (d / (D / d))) elif (c0 <= -6.8e-14) or (not (c0 <= 2.8e+127) and (c0 <= 5.5e+242)): tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))) else: tmp = 0.25 * (((D / d) * (D / d)) * t_0) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(h * Float64(M * M)) tmp = 0.0 if (c0 <= -3.8e+85) tmp = Float64(0.25 * Float64(Float64(D * t_0) / Float64(d / Float64(D / d)))); elseif ((c0 <= -6.8e-14) || (!(c0 <= 2.8e+127) && (c0 <= 5.5e+242))) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h))))); else tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_0)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = h * (M * M); tmp = 0.0; if (c0 <= -3.8e+85) tmp = 0.25 * ((D * t_0) / (d / (D / d))); elseif ((c0 <= -6.8e-14) || (~((c0 <= 2.8e+127)) && (c0 <= 5.5e+242))) tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))); else tmp = 0.25 * (((D / d) * (D / d)) * t_0); 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[c0, -3.8e+85], N[(0.25 * N[(N[(D * t$95$0), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, -6.8e-14], And[N[Not[LessEqual[c0, 2.8e+127]], $MachinePrecision], LessEqual[c0, 5.5e+242]]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;c0 \leq -3.8 \cdot 10^{+85}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot t_0}{\frac{d}{\frac{D}{d}}}\\
\mathbf{elif}\;c0 \leq -6.8 \cdot 10^{-14} \lor \neg \left(c0 \leq 2.8 \cdot 10^{+127}\right) \land c0 \leq 5.5 \cdot 10^{+242}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_0\right)\\
\end{array}
\end{array}
if c0 < -3.79999999999999992e85Initial program 34.3%
Simplified30.8%
Taylor expanded in c0 around -inf 0.7%
+-commutative0.7%
mul-1-neg0.7%
unsub-neg0.7%
unpow20.7%
*-commutative0.7%
unpow20.7%
unpow20.7%
associate-*r*0.7%
*-commutative0.7%
unpow20.7%
*-commutative0.7%
Simplified2.2%
Taylor expanded in c0 around 0 31.7%
unpow231.7%
associate-/l*29.9%
associate-/r/29.5%
unpow229.5%
associate-/l*35.0%
unpow235.0%
*-commutative35.0%
Simplified35.0%
associate-*l/40.6%
associate-/l*49.5%
Applied egg-rr49.5%
if -3.79999999999999992e85 < c0 < -6.80000000000000006e-14 or 2.8000000000000002e127 < c0 < 5.50000000000000022e242Initial program 42.8%
Simplified44.5%
Taylor expanded in c0 around inf 52.2%
times-frac53.8%
unpow253.8%
unpow253.8%
Simplified53.8%
if -6.80000000000000006e-14 < c0 < 2.8000000000000002e127 or 5.50000000000000022e242 < c0 Initial program 17.8%
Simplified22.8%
Taylor expanded in c0 around -inf 0.9%
+-commutative0.9%
mul-1-neg0.9%
unsub-neg0.9%
unpow20.9%
*-commutative0.9%
unpow20.9%
unpow20.9%
associate-*r*0.9%
*-commutative0.9%
unpow20.9%
*-commutative0.9%
Simplified1.1%
Taylor expanded in c0 around 0 40.5%
unpow240.5%
associate-/l*40.4%
associate-/r/40.5%
unpow240.5%
associate-/l*40.8%
unpow240.8%
*-commutative40.8%
Simplified40.8%
Taylor expanded in d around 0 40.8%
unpow240.8%
associate-*l/45.9%
associate-/r/45.8%
Simplified45.8%
associate-/r/50.0%
Applied egg-rr50.0%
Final simplification50.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* h (* M M))))
(if (<= c0 -4.6e+27)
(* 0.25 (/ (* D t_0) (/ d (/ D d))))
(if (or (<= c0 -3.5e-14) (and (not (<= c0 3.8e+127)) (<= c0 5.2e+234)))
(* (/ (* c0 c0) (* D D)) (/ (* d d) (* h (* w w))))
(* 0.25 (* (* (/ D d) (/ D d)) t_0))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = h * (M * M);
double tmp;
if (c0 <= -4.6e+27) {
tmp = 0.25 * ((D * t_0) / (d / (D / d)));
} else if ((c0 <= -3.5e-14) || (!(c0 <= 3.8e+127) && (c0 <= 5.2e+234))) {
tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
} else {
tmp = 0.25 * (((D / d) * (D / d)) * t_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 = h * (m * m)
if (c0 <= (-4.6d+27)) then
tmp = 0.25d0 * ((d * t_0) / (d_1 / (d / d_1)))
else if ((c0 <= (-3.5d-14)) .or. (.not. (c0 <= 3.8d+127)) .and. (c0 <= 5.2d+234)) then
tmp = ((c0 * c0) / (d * d)) * ((d_1 * d_1) / (h * (w * w)))
else
tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_0)
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 (c0 <= -4.6e+27) {
tmp = 0.25 * ((D * t_0) / (d / (D / d)));
} else if ((c0 <= -3.5e-14) || (!(c0 <= 3.8e+127) && (c0 <= 5.2e+234))) {
tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
} else {
tmp = 0.25 * (((D / d) * (D / d)) * t_0);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = h * (M * M) tmp = 0 if c0 <= -4.6e+27: tmp = 0.25 * ((D * t_0) / (d / (D / d))) elif (c0 <= -3.5e-14) or (not (c0 <= 3.8e+127) and (c0 <= 5.2e+234)): tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))) else: tmp = 0.25 * (((D / d) * (D / d)) * t_0) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(h * Float64(M * M)) tmp = 0.0 if (c0 <= -4.6e+27) tmp = Float64(0.25 * Float64(Float64(D * t_0) / Float64(d / Float64(D / d)))); elseif ((c0 <= -3.5e-14) || (!(c0 <= 3.8e+127) && (c0 <= 5.2e+234))) tmp = Float64(Float64(Float64(c0 * c0) / Float64(D * D)) * Float64(Float64(d * d) / Float64(h * Float64(w * w)))); else tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_0)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = h * (M * M); tmp = 0.0; if (c0 <= -4.6e+27) tmp = 0.25 * ((D * t_0) / (d / (D / d))); elseif ((c0 <= -3.5e-14) || (~((c0 <= 3.8e+127)) && (c0 <= 5.2e+234))) tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w))); else tmp = 0.25 * (((D / d) * (D / d)) * t_0); 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[c0, -4.6e+27], N[(0.25 * N[(N[(D * t$95$0), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, -3.5e-14], And[N[Not[LessEqual[c0, 3.8e+127]], $MachinePrecision], LessEqual[c0, 5.2e+234]]], N[(N[(N[(c0 * c0), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;c0 \leq -4.6 \cdot 10^{+27}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot t_0}{\frac{d}{\frac{D}{d}}}\\
\mathbf{elif}\;c0 \leq -3.5 \cdot 10^{-14} \lor \neg \left(c0 \leq 3.8 \cdot 10^{+127}\right) \land c0 \leq 5.2 \cdot 10^{+234}:\\
\;\;\;\;\frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_0\right)\\
\end{array}
\end{array}
if c0 < -4.6000000000000001e27Initial program 31.0%
Simplified29.8%
Taylor expanded in c0 around -inf 0.5%
+-commutative0.5%
mul-1-neg0.5%
unsub-neg0.5%
unpow20.5%
*-commutative0.5%
unpow20.5%
unpow20.5%
associate-*r*0.5%
*-commutative0.5%
unpow20.5%
*-commutative0.5%
Simplified3.0%
Taylor expanded in c0 around 0 26.6%
unpow226.6%
associate-/l*25.2%
associate-/r/24.9%
unpow224.9%
associate-/l*30.4%
unpow230.4%
*-commutative30.4%
Simplified30.4%
associate-*l/34.6%
associate-/l*44.0%
Applied egg-rr44.0%
if -4.6000000000000001e27 < c0 < -3.5000000000000002e-14 or 3.7999999999999998e127 < c0 < 5.2000000000000003e234Initial program 53.8%
Simplified53.8%
Taylor expanded in c0 around inf 60.9%
times-frac60.9%
unpow260.9%
unpow260.9%
unpow260.9%
unpow260.9%
Simplified60.9%
if -3.5000000000000002e-14 < c0 < 3.7999999999999998e127 or 5.2000000000000003e234 < c0 Initial program 18.1%
Simplified23.0%
Taylor expanded in c0 around -inf 0.8%
+-commutative0.8%
mul-1-neg0.8%
unsub-neg0.8%
unpow20.8%
*-commutative0.8%
unpow20.8%
unpow20.8%
associate-*r*0.9%
*-commutative0.9%
unpow20.9%
*-commutative0.9%
Simplified1.0%
Taylor expanded in c0 around 0 39.6%
unpow239.6%
associate-/l*39.6%
associate-/r/39.6%
unpow239.6%
associate-/l*40.0%
unpow240.0%
*-commutative40.0%
Simplified40.0%
Taylor expanded in d around 0 40.0%
unpow240.0%
associate-*l/44.9%
associate-/r/44.9%
Simplified44.9%
associate-/r/49.0%
Applied egg-rr49.0%
Final simplification49.4%
(FPCore (c0 w h D d M) :precision binary64 (* 0.25 (* (* (/ D d) (/ D d)) (* h (* M M)))))
double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * (((D / d) * (D / d)) * (h * (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
code = 0.25d0 * (((d / d_1) * (d / d_1)) * (h * (m * m)))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * (((D / d) * (D / d)) * (h * (M * M)));
}
def code(c0, w, h, D, d, M): return 0.25 * (((D / d) * (D / d)) * (h * (M * M)))
function code(c0, w, h, D, d, M) return Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(h * Float64(M * M)))) end
function tmp = code(c0, w, h, D, d, M) tmp = 0.25 * (((D / d) * (D / d)) * (h * (M * M))); end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)
\end{array}
Initial program 27.5%
Simplified29.8%
Taylor expanded in c0 around -inf 2.0%
+-commutative2.0%
mul-1-neg2.0%
unsub-neg2.0%
unpow22.0%
*-commutative2.0%
unpow22.0%
unpow22.0%
associate-*r*1.9%
*-commutative1.9%
unpow21.9%
*-commutative1.9%
Simplified1.9%
Taylor expanded in c0 around 0 32.0%
unpow232.0%
associate-/l*31.6%
associate-/r/31.1%
unpow231.1%
associate-/l*33.0%
unpow233.0%
*-commutative33.0%
Simplified33.0%
Taylor expanded in d around 0 33.0%
unpow233.0%
associate-*l/38.9%
associate-/r/38.8%
Simplified38.8%
associate-/r/41.4%
Applied egg-rr41.4%
Final simplification41.4%
(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 27.5%
Simplified29.8%
Taylor expanded in c0 around -inf 3.9%
mul-1-neg3.9%
distribute-lft-in3.9%
Simplified28.8%
Taylor expanded in c0 around 0 32.8%
Final simplification32.8%
herbie shell --seed 2023292
(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))))))