
(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 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* D D) (* w h)))))
(if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M))))) INFINITY)
(* t_0 (* 2.0 (* (* d d) (/ (/ c0 (* D D)) (* w h)))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((D * D) * (w * h));
double tmp;
if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * ((d * d) * ((c0 / (D * D)) / (w * h))));
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((D * D) * (w * h));
double tmp;
if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (2.0 * ((d * d) * ((c0 / (D * D)) / (w * h))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((D * D) * (w * h)) tmp = 0 if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M))))) <= math.inf: tmp = t_0 * (2.0 * ((d * d) * ((c0 / (D * D)) / (w * h)))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(D * D) * Float64(w * h))) tmp = 0.0 if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) <= Inf) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * d) * Float64(Float64(c0 / Float64(D * D)) / Float64(w * h))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((D * D) * (w * h)); tmp = 0.0; if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= Inf) tmp = t_0 * (2.0 * ((d * d) * ((c0 / (D * D)) / (w * h)))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(2.0 * N[(N[(d * d), $MachinePrecision] * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\\
\mathbf{if}\;t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{\frac{c0}{D \cdot D}}{w \cdot h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;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 73.5%
Simplified72.4%
Taylor expanded in c0 around inf 79.2%
associate-*r/79.2%
associate-*r*74.2%
*-commutative74.2%
unpow274.2%
*-commutative74.2%
associate-*r/74.2%
associate-*l/74.3%
*-commutative74.3%
unpow274.3%
*-commutative74.3%
associate-*r*79.2%
associate-/r*79.4%
unpow279.4%
unpow279.4%
Simplified79.4%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified2.0%
Taylor expanded in c0 around -inf 1.4%
mul-1-neg1.4%
distribute-rgt-in0.7%
Simplified38.1%
Taylor expanded in c0 around 0 48.8%
Final simplification59.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0
(* (/ c0 (* 2.0 w)) (* 2.0 (* (* (/ d D) (/ d D)) (/ c0 (* w h)))))))
(if (<= c0 -2.3e-55)
t_0
(if (<= c0 6.2e-220)
(* (/ (* (/ c0 D) (/ c0 D)) h) (* d (/ d (* w w))))
(if (or (<= c0 2.9e+200) (not (<= c0 3.5e+236))) t_0 0.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
double tmp;
if (c0 <= -2.3e-55) {
tmp = t_0;
} else if (c0 <= 6.2e-220) {
tmp = (((c0 / D) * (c0 / D)) / h) * (d * (d / (w * w)));
} else if ((c0 <= 2.9e+200) || !(c0 <= 3.5e+236)) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 / d) * (d_1 / d)) * (c0 / (w * h))))
if (c0 <= (-2.3d-55)) then
tmp = t_0
else if (c0 <= 6.2d-220) then
tmp = (((c0 / d) * (c0 / d)) / h) * (d_1 * (d_1 / (w * w)))
else if ((c0 <= 2.9d+200) .or. (.not. (c0 <= 3.5d+236))) then
tmp = t_0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
double tmp;
if (c0 <= -2.3e-55) {
tmp = t_0;
} else if (c0 <= 6.2e-220) {
tmp = (((c0 / D) * (c0 / D)) / h) * (d * (d / (w * w)));
} else if ((c0 <= 2.9e+200) || !(c0 <= 3.5e+236)) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))) tmp = 0 if c0 <= -2.3e-55: tmp = t_0 elif c0 <= 6.2e-220: tmp = (((c0 / D) * (c0 / D)) / h) * (d * (d / (w * w))) elif (c0 <= 2.9e+200) or not (c0 <= 3.5e+236): tmp = t_0 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 / Float64(w * h))))) tmp = 0.0 if (c0 <= -2.3e-55) tmp = t_0; elseif (c0 <= 6.2e-220) tmp = Float64(Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) / h) * Float64(d * Float64(d / Float64(w * w)))); elseif ((c0 <= 2.9e+200) || !(c0 <= 3.5e+236)) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))); tmp = 0.0; if (c0 <= -2.3e-55) tmp = t_0; elseif (c0 <= 6.2e-220) tmp = (((c0 / D) * (c0 / D)) / h) * (d * (d / (w * w))); elseif ((c0 <= 2.9e+200) || ~((c0 <= 3.5e+236))) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.3e-55], t$95$0, If[LessEqual[c0, 6.2e-220], N[(N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] * N[(d * N[(d / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 2.9e+200], N[Not[LessEqual[c0, 3.5e+236]], $MachinePrecision]], t$95$0, 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)\\
\mathbf{if}\;c0 \leq -2.3 \cdot 10^{-55}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq 6.2 \cdot 10^{-220}:\\
\;\;\;\;\frac{\frac{c0}{D} \cdot \frac{c0}{D}}{h} \cdot \left(d \cdot \frac{d}{w \cdot w}\right)\\
\mathbf{elif}\;c0 \leq 2.9 \cdot 10^{+200} \lor \neg \left(c0 \leq 3.5 \cdot 10^{+236}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if c0 < -2.30000000000000011e-55 or 6.20000000000000023e-220 < c0 < 2.8999999999999999e200 or 3.49999999999999979e236 < c0 Initial program 30.5%
Simplified31.1%
Taylor expanded in c0 around inf 40.2%
associate-*r/40.2%
associate-*r*39.2%
*-commutative39.2%
unpow239.2%
*-commutative39.2%
associate-*r/39.2%
times-frac40.3%
unpow240.3%
*-commutative40.3%
associate-/r*42.1%
unpow242.1%
associate-/r*46.7%
unpow246.7%
associate-*l/49.0%
associate-*r/49.5%
unpow249.5%
times-frac47.1%
Simplified47.8%
pow247.8%
Applied egg-rr47.8%
if -2.30000000000000011e-55 < c0 < 6.20000000000000023e-220Initial program 18.6%
Simplified18.7%
Taylor expanded in c0 around inf 25.1%
associate-*r/25.1%
associate-*r*24.3%
*-commutative24.3%
unpow224.3%
*-commutative24.3%
associate-*r/24.3%
times-frac24.0%
unpow224.0%
*-commutative24.0%
associate-/r*24.0%
unpow224.0%
associate-/r*25.6%
unpow225.6%
associate-*l/27.2%
associate-*r/30.3%
unpow230.3%
times-frac32.5%
Simplified32.4%
Taylor expanded in c0 around 0 13.5%
times-frac15.1%
unpow215.1%
unpow215.1%
unpow215.1%
unpow215.1%
Simplified15.1%
associate-*r/15.2%
times-frac28.4%
Applied egg-rr28.4%
unpow228.4%
unpow228.4%
times-frac37.3%
unpow237.3%
associate-*r/51.1%
unpow251.1%
Simplified51.1%
if 2.8999999999999999e200 < c0 < 3.49999999999999979e236Initial program 10.0%
Simplified20.0%
Taylor expanded in c0 around -inf 10.0%
mul-1-neg10.0%
distribute-rgt-in10.0%
Simplified40.4%
Taylor expanded in c0 around 0 70.6%
Final simplification49.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))))
(if (<= M 4.3e-169)
0.0
(if (<= M 7.5e-96)
t_0
(if (<= M 1.85e-69)
0.0
(if (<= M 2.1e-42)
t_0
(if (<= M 0.0005)
0.0
(* (/ c0 D) (* (/ c0 D) (/ (* d (/ d (* w w))) h))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 4.3e-169) {
tmp = 0.0;
} else if (M <= 7.5e-96) {
tmp = t_0;
} else if (M <= 1.85e-69) {
tmp = 0.0;
} else if (M <= 2.1e-42) {
tmp = t_0;
} else if (M <= 0.0005) {
tmp = 0.0;
} else {
tmp = (c0 / D) * ((c0 / D) * ((d * (d / (w * 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) :: tmp
t_0 = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
if (m <= 4.3d-169) then
tmp = 0.0d0
else if (m <= 7.5d-96) then
tmp = t_0
else if (m <= 1.85d-69) then
tmp = 0.0d0
else if (m <= 2.1d-42) then
tmp = t_0
else if (m <= 0.0005d0) then
tmp = 0.0d0
else
tmp = (c0 / d) * ((c0 / d) * ((d_1 * (d_1 / (w * 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)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
double tmp;
if (M <= 4.3e-169) {
tmp = 0.0;
} else if (M <= 7.5e-96) {
tmp = t_0;
} else if (M <= 1.85e-69) {
tmp = 0.0;
} else if (M <= 2.1e-42) {
tmp = t_0;
} else if (M <= 0.0005) {
tmp = 0.0;
} else {
tmp = (c0 / D) * ((c0 / D) * ((d * (d / (w * w))) / h));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))) tmp = 0 if M <= 4.3e-169: tmp = 0.0 elif M <= 7.5e-96: tmp = t_0 elif M <= 1.85e-69: tmp = 0.0 elif M <= 2.1e-42: tmp = t_0 elif M <= 0.0005: tmp = 0.0 else: tmp = (c0 / D) * ((c0 / D) * ((d * (d / (w * w))) / h)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h))))) tmp = 0.0 if (M <= 4.3e-169) tmp = 0.0; elseif (M <= 7.5e-96) tmp = t_0; elseif (M <= 1.85e-69) tmp = 0.0; elseif (M <= 2.1e-42) tmp = t_0; elseif (M <= 0.0005) tmp = 0.0; else tmp = Float64(Float64(c0 / D) * Float64(Float64(c0 / D) * Float64(Float64(d * Float64(d / Float64(w * w))) / h))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h)))); tmp = 0.0; if (M <= 4.3e-169) tmp = 0.0; elseif (M <= 7.5e-96) tmp = t_0; elseif (M <= 1.85e-69) tmp = 0.0; elseif (M <= 2.1e-42) tmp = t_0; elseif (M <= 0.0005) tmp = 0.0; else tmp = (c0 / D) * ((c0 / D) * ((d * (d / (w * w))) / h)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 4.3e-169], 0.0, If[LessEqual[M, 7.5e-96], t$95$0, If[LessEqual[M, 1.85e-69], 0.0, If[LessEqual[M, 2.1e-42], t$95$0, If[LessEqual[M, 0.0005], 0.0, N[(N[(c0 / D), $MachinePrecision] * N[(N[(c0 / D), $MachinePrecision] * N[(N[(d * N[(d / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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{if}\;M \leq 4.3 \cdot 10^{-169}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 7.5 \cdot 10^{-96}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M \leq 1.85 \cdot 10^{-69}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 2.1 \cdot 10^{-42}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M \leq 0.0005:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{D} \cdot \left(\frac{c0}{D} \cdot \frac{d \cdot \frac{d}{w \cdot w}}{h}\right)\\
\end{array}
\end{array}
if M < 4.29999999999999984e-169 or 7.5e-96 < M < 1.8500000000000001e-69 or 2.10000000000000006e-42 < M < 5.0000000000000001e-4Initial program 26.8%
Simplified27.9%
Taylor expanded in c0 around -inf 2.5%
mul-1-neg2.5%
distribute-rgt-in2.5%
Simplified30.9%
Taylor expanded in c0 around 0 38.8%
if 4.29999999999999984e-169 < M < 7.5e-96 or 1.8500000000000001e-69 < M < 2.10000000000000006e-42Initial program 45.4%
Simplified45.6%
Taylor expanded in c0 around inf 50.5%
associate-*r/50.5%
associate-*r*45.9%
*-commutative45.9%
unpow245.9%
*-commutative45.9%
associate-*r/45.9%
times-frac50.5%
unpow250.5%
*-commutative50.5%
associate-/r*55.4%
unpow255.4%
associate-/r*55.9%
unpow255.9%
associate-*l/65.9%
associate-*r/65.9%
unpow265.9%
times-frac61.9%
Simplified57.1%
associate-/r*60.8%
div-inv60.8%
Applied egg-rr60.8%
Taylor expanded in c0 around 0 50.5%
times-frac56.1%
unpow256.1%
unpow256.1%
Simplified56.1%
if 5.0000000000000001e-4 < M Initial program 17.2%
Simplified17.2%
Taylor expanded in c0 around inf 36.9%
associate-*r/36.9%
associate-*r*39.5%
*-commutative39.5%
unpow239.5%
*-commutative39.5%
associate-*r/39.5%
times-frac39.6%
unpow239.6%
*-commutative39.6%
associate-/r*37.2%
unpow237.2%
associate-/r*46.9%
unpow246.9%
associate-*l/47.5%
associate-*r/47.5%
unpow247.5%
times-frac44.9%
Simplified44.9%
Taylor expanded in c0 around 0 26.7%
times-frac26.7%
unpow226.7%
unpow226.7%
unpow226.7%
unpow226.7%
Simplified26.7%
pow126.7%
times-frac46.2%
times-frac46.5%
Applied egg-rr46.5%
unpow146.5%
associate-*l*46.8%
*-commutative46.8%
associate-*r/49.1%
Simplified49.1%
Final simplification41.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* t_1 (* 2.0 (* (/ (/ c0 w) h) t_0)))))
(if (<= c0 -4.1e-131)
t_2
(if (<= c0 3.1e-267)
0.0
(if (<= c0 7e+201)
t_2
(if (<= c0 4.2e+236) 0.0 (* t_1 (* 2.0 (* t_0 (/ c0 (* 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 = t_1 * (2.0 * (((c0 / w) / h) * t_0));
double tmp;
if (c0 <= -4.1e-131) {
tmp = t_2;
} else if (c0 <= 3.1e-267) {
tmp = 0.0;
} else if (c0 <= 7e+201) {
tmp = t_2;
} else if (c0 <= 4.2e+236) {
tmp = 0.0;
} else {
tmp = t_1 * (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) :: t_2
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
t_1 = c0 / (2.0d0 * w)
t_2 = t_1 * (2.0d0 * (((c0 / w) / h) * t_0))
if (c0 <= (-4.1d-131)) then
tmp = t_2
else if (c0 <= 3.1d-267) then
tmp = 0.0d0
else if (c0 <= 7d+201) then
tmp = t_2
else if (c0 <= 4.2d+236) then
tmp = 0.0d0
else
tmp = t_1 * (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 = (d / D) * (d / D);
double t_1 = c0 / (2.0 * w);
double t_2 = t_1 * (2.0 * (((c0 / w) / h) * t_0));
double tmp;
if (c0 <= -4.1e-131) {
tmp = t_2;
} else if (c0 <= 3.1e-267) {
tmp = 0.0;
} else if (c0 <= 7e+201) {
tmp = t_2;
} else if (c0 <= 4.2e+236) {
tmp = 0.0;
} else {
tmp = t_1 * (2.0 * (t_0 * (c0 / (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 = t_1 * (2.0 * (((c0 / w) / h) * t_0)) tmp = 0 if c0 <= -4.1e-131: tmp = t_2 elif c0 <= 3.1e-267: tmp = 0.0 elif c0 <= 7e+201: tmp = t_2 elif c0 <= 4.2e+236: tmp = 0.0 else: tmp = t_1 * (2.0 * (t_0 * (c0 / (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(t_1 * Float64(2.0 * Float64(Float64(Float64(c0 / w) / h) * t_0))) tmp = 0.0 if (c0 <= -4.1e-131) tmp = t_2; elseif (c0 <= 3.1e-267) tmp = 0.0; elseif (c0 <= 7e+201) tmp = t_2; elseif (c0 <= 4.2e+236) tmp = 0.0; else tmp = Float64(t_1 * 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) * (d / D); t_1 = c0 / (2.0 * w); t_2 = t_1 * (2.0 * (((c0 / w) / h) * t_0)); tmp = 0.0; if (c0 <= -4.1e-131) tmp = t_2; elseif (c0 <= 3.1e-267) tmp = 0.0; elseif (c0 <= 7e+201) tmp = t_2; elseif (c0 <= 4.2e+236) tmp = 0.0; else tmp = t_1 * (2.0 * (t_0 * (c0 / (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[(t$95$1 * N[(2.0 * N[(N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -4.1e-131], t$95$2, If[LessEqual[c0, 3.1e-267], 0.0, If[LessEqual[c0, 7e+201], t$95$2, If[LessEqual[c0, 4.2e+236], 0.0, N[(t$95$1 * 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 := \frac{d}{D} \cdot \frac{d}{D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := t_1 \cdot \left(2 \cdot \left(\frac{\frac{c0}{w}}{h} \cdot t_0\right)\right)\\
\mathbf{if}\;c0 \leq -4.1 \cdot 10^{-131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c0 \leq 3.1 \cdot 10^{-267}:\\
\;\;\;\;0\\
\mathbf{elif}\;c0 \leq 7 \cdot 10^{+201}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c0 \leq 4.2 \cdot 10^{+236}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{c0}{w \cdot h}\right)\right)\\
\end{array}
\end{array}
if c0 < -4.1000000000000002e-131 or 3.1000000000000001e-267 < c0 < 7.0000000000000004e201Initial program 29.9%
Simplified30.5%
Taylor expanded in c0 around inf 39.6%
associate-*r/39.6%
associate-*r*38.8%
*-commutative38.8%
unpow238.8%
*-commutative38.8%
associate-*r/38.8%
times-frac39.9%
unpow239.9%
*-commutative39.9%
associate-/r*41.0%
unpow241.0%
associate-/r*45.4%
unpow245.4%
associate-*l/48.5%
associate-*r/48.5%
unpow248.5%
times-frac46.8%
Simplified46.8%
associate-/r*48.3%
div-inv48.3%
Applied egg-rr48.3%
div-inv48.3%
associate-/l/46.8%
associate-/r*49.9%
Applied egg-rr49.9%
pow246.8%
Applied egg-rr49.9%
if -4.1000000000000002e-131 < c0 < 3.1000000000000001e-267 or 7.0000000000000004e201 < c0 < 4.20000000000000011e236Initial program 12.8%
Simplified14.9%
Taylor expanded in c0 around -inf 4.1%
mul-1-neg4.1%
distribute-rgt-in4.1%
Simplified51.1%
Taylor expanded in c0 around 0 57.3%
if 4.20000000000000011e236 < c0 Initial program 31.3%
Simplified31.3%
Taylor expanded in c0 around inf 38.1%
associate-*r/38.1%
associate-*r*31.8%
*-commutative31.8%
unpow231.8%
*-commutative31.8%
associate-*r/31.8%
times-frac32.2%
unpow232.2%
*-commutative32.2%
associate-/r*38.5%
unpow238.5%
associate-/r*45.3%
unpow245.3%
associate-*l/40.1%
associate-*r/46.1%
unpow246.1%
times-frac45.4%
Simplified51.6%
pow251.6%
Applied egg-rr51.6%
Final simplification51.4%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 3.1e-130)
0.0
(if (or (<= M 1e-106)
(not
(or (<= M 1.65e-69) (and (not (<= M 1.22e-42)) (<= M 0.00023)))))
(* (* c0 (/ c0 D)) (/ (/ (* d (/ d (* w w))) h) D))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 3.1e-130) {
tmp = 0.0;
} else if ((M <= 1e-106) || !((M <= 1.65e-69) || (!(M <= 1.22e-42) && (M <= 0.00023)))) {
tmp = (c0 * (c0 / D)) * (((d * (d / (w * w))) / h) / D);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if (m <= 3.1d-130) then
tmp = 0.0d0
else if ((m <= 1d-106) .or. (.not. (m <= 1.65d-69) .or. (.not. (m <= 1.22d-42)) .and. (m <= 0.00023d0))) then
tmp = (c0 * (c0 / d)) * (((d_1 * (d_1 / (w * w))) / h) / d)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 3.1e-130) {
tmp = 0.0;
} else if ((M <= 1e-106) || !((M <= 1.65e-69) || (!(M <= 1.22e-42) && (M <= 0.00023)))) {
tmp = (c0 * (c0 / D)) * (((d * (d / (w * w))) / h) / D);
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 3.1e-130: tmp = 0.0 elif (M <= 1e-106) or not ((M <= 1.65e-69) or (not (M <= 1.22e-42) and (M <= 0.00023))): tmp = (c0 * (c0 / D)) * (((d * (d / (w * w))) / h) / D) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 3.1e-130) tmp = 0.0; elseif ((M <= 1e-106) || !((M <= 1.65e-69) || (!(M <= 1.22e-42) && (M <= 0.00023)))) tmp = Float64(Float64(c0 * Float64(c0 / D)) * Float64(Float64(Float64(d * Float64(d / Float64(w * w))) / h) / D)); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 3.1e-130) tmp = 0.0; elseif ((M <= 1e-106) || ~(((M <= 1.65e-69) || (~((M <= 1.22e-42)) && (M <= 0.00023))))) tmp = (c0 * (c0 / D)) * (((d * (d / (w * w))) / h) / D); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 3.1e-130], 0.0, If[Or[LessEqual[M, 1e-106], N[Not[Or[LessEqual[M, 1.65e-69], And[N[Not[LessEqual[M, 1.22e-42]], $MachinePrecision], LessEqual[M, 0.00023]]]], $MachinePrecision]], N[(N[(c0 * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(d * N[(d / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.1 \cdot 10^{-130}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 10^{-106} \lor \neg \left(M \leq 1.65 \cdot 10^{-69} \lor \neg \left(M \leq 1.22 \cdot 10^{-42}\right) \land M \leq 0.00023\right):\\
\;\;\;\;\left(c0 \cdot \frac{c0}{D}\right) \cdot \frac{\frac{d \cdot \frac{d}{w \cdot w}}{h}}{D}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if M < 3.10000000000000011e-130 or 9.99999999999999941e-107 < M < 1.65e-69 or 1.22000000000000007e-42 < M < 2.3000000000000001e-4Initial program 27.5%
Simplified28.6%
Taylor expanded in c0 around -inf 2.9%
mul-1-neg2.9%
distribute-rgt-in2.4%
Simplified30.0%
Taylor expanded in c0 around 0 38.0%
if 3.10000000000000011e-130 < M < 9.99999999999999941e-107 or 1.65e-69 < M < 1.22000000000000007e-42 or 2.3000000000000001e-4 < M Initial program 23.5%
Simplified23.5%
Taylor expanded in c0 around inf 41.3%
associate-*r/41.3%
associate-*r*41.6%
*-commutative41.6%
unpow241.6%
*-commutative41.6%
associate-*r/41.6%
times-frac41.6%
unpow241.6%
*-commutative41.6%
associate-/r*39.7%
unpow239.7%
associate-/r*47.7%
unpow247.7%
associate-*l/50.2%
associate-*r/50.2%
unpow250.2%
times-frac48.1%
Simplified48.1%
Taylor expanded in c0 around 0 29.3%
times-frac29.3%
unpow229.3%
unpow229.3%
unpow229.3%
unpow229.3%
Simplified29.3%
associate-*l/29.3%
times-frac29.6%
Applied egg-rr29.6%
unpow229.6%
times-frac37.7%
unpow237.7%
associate-*r/43.6%
*-commutative43.6%
associate-*r/45.6%
Simplified45.6%
Final simplification39.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ d (* w w))))
(if (<= w -2.55e+148)
0.0
(if (<= w -3.5e-91)
(* t_0 (* (* (/ c0 D) (/ c0 D)) (/ d h)))
(if (or (<= w 6.2e-105) (and (not (<= w 470.0)) (<= w 4.4e+42)))
(* (/ c0 D) (* (/ c0 D) (/ (* d t_0) h)))
0.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = d / (w * w);
double tmp;
if (w <= -2.55e+148) {
tmp = 0.0;
} else if (w <= -3.5e-91) {
tmp = t_0 * (((c0 / D) * (c0 / D)) * (d / h));
} else if ((w <= 6.2e-105) || (!(w <= 470.0) && (w <= 4.4e+42))) {
tmp = (c0 / D) * ((c0 / D) * ((d * t_0) / h));
} 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 / (w * w)
if (w <= (-2.55d+148)) then
tmp = 0.0d0
else if (w <= (-3.5d-91)) then
tmp = t_0 * (((c0 / d) * (c0 / d)) * (d_1 / h))
else if ((w <= 6.2d-105) .or. (.not. (w <= 470.0d0)) .and. (w <= 4.4d+42)) then
tmp = (c0 / d) * ((c0 / d) * ((d_1 * t_0) / h))
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 / (w * w);
double tmp;
if (w <= -2.55e+148) {
tmp = 0.0;
} else if (w <= -3.5e-91) {
tmp = t_0 * (((c0 / D) * (c0 / D)) * (d / h));
} else if ((w <= 6.2e-105) || (!(w <= 470.0) && (w <= 4.4e+42))) {
tmp = (c0 / D) * ((c0 / D) * ((d * t_0) / h));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = d / (w * w) tmp = 0 if w <= -2.55e+148: tmp = 0.0 elif w <= -3.5e-91: tmp = t_0 * (((c0 / D) * (c0 / D)) * (d / h)) elif (w <= 6.2e-105) or (not (w <= 470.0) and (w <= 4.4e+42)): tmp = (c0 / D) * ((c0 / D) * ((d * t_0) / h)) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / Float64(w * w)) tmp = 0.0 if (w <= -2.55e+148) tmp = 0.0; elseif (w <= -3.5e-91) tmp = Float64(t_0 * Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(d / h))); elseif ((w <= 6.2e-105) || (!(w <= 470.0) && (w <= 4.4e+42))) tmp = Float64(Float64(c0 / D) * Float64(Float64(c0 / D) * Float64(Float64(d * t_0) / h))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = d / (w * w); tmp = 0.0; if (w <= -2.55e+148) tmp = 0.0; elseif (w <= -3.5e-91) tmp = t_0 * (((c0 / D) * (c0 / D)) * (d / h)); elseif ((w <= 6.2e-105) || (~((w <= 470.0)) && (w <= 4.4e+42))) tmp = (c0 / D) * ((c0 / D) * ((d * t_0) / h)); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(d / N[(w * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -2.55e+148], 0.0, If[LessEqual[w, -3.5e-91], N[(t$95$0 * N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, 6.2e-105], And[N[Not[LessEqual[w, 470.0]], $MachinePrecision], LessEqual[w, 4.4e+42]]], N[(N[(c0 / D), $MachinePrecision] * N[(N[(c0 / D), $MachinePrecision] * N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{w \cdot w}\\
\mathbf{if}\;w \leq -2.55 \cdot 10^{+148}:\\
\;\;\;\;0\\
\mathbf{elif}\;w \leq -3.5 \cdot 10^{-91}:\\
\;\;\;\;t_0 \cdot \left(\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \frac{d}{h}\right)\\
\mathbf{elif}\;w \leq 6.2 \cdot 10^{-105} \lor \neg \left(w \leq 470\right) \land w \leq 4.4 \cdot 10^{+42}:\\
\;\;\;\;\frac{c0}{D} \cdot \left(\frac{c0}{D} \cdot \frac{d \cdot t_0}{h}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -2.54999999999999993e148 or 6.20000000000000029e-105 < w < 470 or 4.4000000000000003e42 < w Initial program 18.4%
Simplified18.4%
Taylor expanded in c0 around -inf 3.7%
mul-1-neg3.7%
distribute-rgt-in3.6%
Simplified37.9%
Taylor expanded in c0 around 0 39.8%
if -2.54999999999999993e148 < w < -3.4999999999999999e-91Initial program 18.6%
Simplified20.9%
Taylor expanded in c0 around inf 32.5%
associate-*r/32.5%
associate-*r*32.5%
*-commutative32.5%
unpow232.5%
*-commutative32.5%
associate-*r/32.5%
times-frac36.7%
unpow236.7%
*-commutative36.7%
associate-/r*39.0%
unpow239.0%
associate-/r*41.5%
unpow241.5%
associate-*l/48.0%
associate-*r/50.1%
unpow250.1%
times-frac46.4%
Simplified46.3%
Taylor expanded in c0 around 0 29.8%
times-frac32.3%
unpow232.3%
unpow232.3%
unpow232.3%
unpow232.3%
Simplified32.3%
pow132.3%
times-frac33.0%
times-frac43.5%
Applied egg-rr43.5%
unpow143.5%
associate-*r*47.6%
Simplified47.6%
if -3.4999999999999999e-91 < w < 6.20000000000000029e-105 or 470 < w < 4.4000000000000003e42Initial program 38.0%
Simplified39.1%
Taylor expanded in c0 around inf 46.1%
associate-*r/46.1%
associate-*r*45.2%
*-commutative45.2%
unpow245.2%
*-commutative45.2%
associate-*r/45.2%
times-frac47.0%
unpow247.0%
*-commutative47.0%
associate-/r*48.8%
unpow248.8%
associate-/r*52.7%
unpow252.7%
associate-*l/54.6%
associate-*r/54.6%
unpow254.6%
times-frac54.1%
Simplified54.2%
Taylor expanded in c0 around 0 40.3%
times-frac40.3%
unpow240.3%
unpow240.3%
unpow240.3%
unpow240.3%
Simplified40.3%
pow140.3%
times-frac51.0%
times-frac52.1%
Applied egg-rr52.1%
unpow152.1%
associate-*l*54.0%
*-commutative54.0%
associate-*r/55.9%
Simplified55.9%
Final simplification48.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ d (* w w))) (t_1 (* t_0 (* (* (/ c0 D) (/ c0 D)) (/ d h)))))
(if (<= M 3.2e-130)
0.0
(if (<= M 2.5e-106)
t_1
(if (<= M 1.35e-69)
0.0
(if (<= M 1.16e-42)
(* (* c0 (/ c0 D)) (/ (/ (* d t_0) h) D))
(if (<= M 0.00035) 0.0 t_1)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = d / (w * w);
double t_1 = t_0 * (((c0 / D) * (c0 / D)) * (d / h));
double tmp;
if (M <= 3.2e-130) {
tmp = 0.0;
} else if (M <= 2.5e-106) {
tmp = t_1;
} else if (M <= 1.35e-69) {
tmp = 0.0;
} else if (M <= 1.16e-42) {
tmp = (c0 * (c0 / D)) * (((d * t_0) / h) / D);
} else if (M <= 0.00035) {
tmp = 0.0;
} else {
tmp = 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) :: tmp
t_0 = d_1 / (w * w)
t_1 = t_0 * (((c0 / d) * (c0 / d)) * (d_1 / h))
if (m <= 3.2d-130) then
tmp = 0.0d0
else if (m <= 2.5d-106) then
tmp = t_1
else if (m <= 1.35d-69) then
tmp = 0.0d0
else if (m <= 1.16d-42) then
tmp = (c0 * (c0 / d)) * (((d_1 * t_0) / h) / d)
else if (m <= 0.00035d0) then
tmp = 0.0d0
else
tmp = 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 = d / (w * w);
double t_1 = t_0 * (((c0 / D) * (c0 / D)) * (d / h));
double tmp;
if (M <= 3.2e-130) {
tmp = 0.0;
} else if (M <= 2.5e-106) {
tmp = t_1;
} else if (M <= 1.35e-69) {
tmp = 0.0;
} else if (M <= 1.16e-42) {
tmp = (c0 * (c0 / D)) * (((d * t_0) / h) / D);
} else if (M <= 0.00035) {
tmp = 0.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = d / (w * w) t_1 = t_0 * (((c0 / D) * (c0 / D)) * (d / h)) tmp = 0 if M <= 3.2e-130: tmp = 0.0 elif M <= 2.5e-106: tmp = t_1 elif M <= 1.35e-69: tmp = 0.0 elif M <= 1.16e-42: tmp = (c0 * (c0 / D)) * (((d * t_0) / h) / D) elif M <= 0.00035: tmp = 0.0 else: tmp = t_1 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / Float64(w * w)) t_1 = Float64(t_0 * Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(d / h))) tmp = 0.0 if (M <= 3.2e-130) tmp = 0.0; elseif (M <= 2.5e-106) tmp = t_1; elseif (M <= 1.35e-69) tmp = 0.0; elseif (M <= 1.16e-42) tmp = Float64(Float64(c0 * Float64(c0 / D)) * Float64(Float64(Float64(d * t_0) / h) / D)); elseif (M <= 0.00035) tmp = 0.0; else tmp = t_1; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = d / (w * w); t_1 = t_0 * (((c0 / D) * (c0 / D)) * (d / h)); tmp = 0.0; if (M <= 3.2e-130) tmp = 0.0; elseif (M <= 2.5e-106) tmp = t_1; elseif (M <= 1.35e-69) tmp = 0.0; elseif (M <= 1.16e-42) tmp = (c0 * (c0 / D)) * (((d * t_0) / h) / D); elseif (M <= 0.00035) tmp = 0.0; else tmp = t_1; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(d / N[(w * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 3.2e-130], 0.0, If[LessEqual[M, 2.5e-106], t$95$1, If[LessEqual[M, 1.35e-69], 0.0, If[LessEqual[M, 1.16e-42], N[(N[(c0 * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 0.00035], 0.0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{w \cdot w}\\
t_1 := t_0 \cdot \left(\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \frac{d}{h}\right)\\
\mathbf{if}\;M \leq 3.2 \cdot 10^{-130}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 2.5 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;M \leq 1.35 \cdot 10^{-69}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 1.16 \cdot 10^{-42}:\\
\;\;\;\;\left(c0 \cdot \frac{c0}{D}\right) \cdot \frac{\frac{d \cdot t_0}{h}}{D}\\
\mathbf{elif}\;M \leq 0.00035:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if M < 3.2e-130 or 2.49999999999999991e-106 < M < 1.3499999999999999e-69 or 1.1600000000000001e-42 < M < 3.49999999999999996e-4Initial program 27.5%
Simplified28.6%
Taylor expanded in c0 around -inf 2.9%
mul-1-neg2.9%
distribute-rgt-in2.4%
Simplified30.0%
Taylor expanded in c0 around 0 38.0%
if 3.2e-130 < M < 2.49999999999999991e-106 or 3.49999999999999996e-4 < M Initial program 21.3%
Simplified21.3%
Taylor expanded in c0 around inf 38.6%
associate-*r/38.6%
associate-*r*40.8%
*-commutative40.8%
unpow240.8%
*-commutative40.8%
associate-*r/40.8%
times-frac40.9%
unpow240.9%
*-commutative40.9%
associate-/r*38.8%
unpow238.8%
associate-/r*47.4%
unpow247.4%
associate-*l/50.0%
associate-*r/50.0%
unpow250.0%
times-frac47.7%
Simplified47.7%
Taylor expanded in c0 around 0 29.6%
times-frac29.6%
unpow229.6%
unpow229.6%
unpow229.6%
unpow229.6%
Simplified29.6%
pow129.6%
times-frac46.8%
times-frac49.1%
Applied egg-rr49.1%
unpow149.1%
associate-*r*49.1%
Simplified49.1%
if 1.3499999999999999e-69 < M < 1.1600000000000001e-42Initial program 50.7%
Simplified50.7%
Taylor expanded in c0 around inf 74.6%
associate-*r/74.6%
associate-*r*50.7%
*-commutative50.7%
unpow250.7%
*-commutative50.7%
associate-*r/50.7%
times-frac50.7%
unpow250.7%
*-commutative50.7%
associate-/r*50.7%
unpow250.7%
associate-/r*51.7%
unpow251.7%
associate-*l/52.6%
associate-*r/52.6%
unpow252.6%
times-frac52.6%
Simplified52.6%
Taylor expanded in c0 around 0 25.9%
times-frac25.9%
unpow225.9%
unpow225.9%
unpow225.9%
unpow225.9%
Simplified25.9%
associate-*l/25.9%
times-frac25.9%
Applied egg-rr25.9%
unpow225.9%
times-frac26.9%
unpow226.9%
associate-*r/26.9%
*-commutative26.9%
associate-*r/26.9%
Simplified26.9%
Final simplification39.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 26.7%
Simplified27.6%
Taylor expanded in c0 around -inf 2.4%
mul-1-neg2.4%
distribute-rgt-in1.9%
Simplified26.5%
Taylor expanded in c0 around 0 33.4%
Final simplification33.4%
herbie shell --seed 2023293
(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))))))