
(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 9 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))))
(if (<= (* M M) 1e-304)
0.0
(if (<= (* M M) 5e-258)
(* t_0 (* 2.0 (/ (* d (/ c0 (/ (* D (* w h)) d))) D)))
(if (<= (* M M) 9e-213)
0.0
(if (<= (* M M) 1.42e-157)
(* t_0 (* 2.0 (/ (* d (* (/ (/ d D) w) (/ c0 h))) D)))
(if (<= (* M M) 1e-105)
0.0
(if (<= (* M M) 1.9e-55)
(* t_0 (* 2.0 (* (/ c0 w) (/ (* (/ d D) (/ d D)) h))))
(if (<= (* M M) 0.12)
0.0
(*
t_0
(/ 2.0 (/ D (* (/ d w) (/ (/ c0 (/ D d)) h))))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double tmp;
if ((M * M) <= 1e-304) {
tmp = 0.0;
} else if ((M * M) <= 5e-258) {
tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D));
} else if ((M * M) <= 9e-213) {
tmp = 0.0;
} else if ((M * M) <= 1.42e-157) {
tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D));
} else if ((M * M) <= 1e-105) {
tmp = 0.0;
} else if ((M * M) <= 1.9e-55) {
tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h)));
} else if ((M * M) <= 0.12) {
tmp = 0.0;
} else {
tmp = t_0 * (2.0 / (D / ((d / w) * ((c0 / (D / d)) / 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)
if ((m * m) <= 1d-304) then
tmp = 0.0d0
else if ((m * m) <= 5d-258) then
tmp = t_0 * (2.0d0 * ((d_1 * (c0 / ((d * (w * h)) / d_1))) / d))
else if ((m * m) <= 9d-213) then
tmp = 0.0d0
else if ((m * m) <= 1.42d-157) then
tmp = t_0 * (2.0d0 * ((d_1 * (((d_1 / d) / w) * (c0 / h))) / d))
else if ((m * m) <= 1d-105) then
tmp = 0.0d0
else if ((m * m) <= 1.9d-55) then
tmp = t_0 * (2.0d0 * ((c0 / w) * (((d_1 / d) * (d_1 / d)) / h)))
else if ((m * m) <= 0.12d0) then
tmp = 0.0d0
else
tmp = t_0 * (2.0d0 / (d / ((d_1 / w) * ((c0 / (d / d_1)) / 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 tmp;
if ((M * M) <= 1e-304) {
tmp = 0.0;
} else if ((M * M) <= 5e-258) {
tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D));
} else if ((M * M) <= 9e-213) {
tmp = 0.0;
} else if ((M * M) <= 1.42e-157) {
tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D));
} else if ((M * M) <= 1e-105) {
tmp = 0.0;
} else if ((M * M) <= 1.9e-55) {
tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h)));
} else if ((M * M) <= 0.12) {
tmp = 0.0;
} else {
tmp = t_0 * (2.0 / (D / ((d / w) * ((c0 / (D / d)) / h))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) tmp = 0 if (M * M) <= 1e-304: tmp = 0.0 elif (M * M) <= 5e-258: tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D)) elif (M * M) <= 9e-213: tmp = 0.0 elif (M * M) <= 1.42e-157: tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D)) elif (M * M) <= 1e-105: tmp = 0.0 elif (M * M) <= 1.9e-55: tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h))) elif (M * M) <= 0.12: tmp = 0.0 else: tmp = t_0 * (2.0 / (D / ((d / w) * ((c0 / (D / d)) / h)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (Float64(M * M) <= 1e-304) tmp = 0.0; elseif (Float64(M * M) <= 5e-258) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * Float64(c0 / Float64(Float64(D * Float64(w * h)) / d))) / D))); elseif (Float64(M * M) <= 9e-213) tmp = 0.0; elseif (Float64(M * M) <= 1.42e-157) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * Float64(Float64(Float64(d / D) / w) * Float64(c0 / h))) / D))); elseif (Float64(M * M) <= 1e-105) tmp = 0.0; elseif (Float64(M * M) <= 1.9e-55) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / h)))); elseif (Float64(M * M) <= 0.12) tmp = 0.0; else tmp = Float64(t_0 * Float64(2.0 / Float64(D / Float64(Float64(d / w) * Float64(Float64(c0 / Float64(D / d)) / h))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); tmp = 0.0; if ((M * M) <= 1e-304) tmp = 0.0; elseif ((M * M) <= 5e-258) tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D)); elseif ((M * M) <= 9e-213) tmp = 0.0; elseif ((M * M) <= 1.42e-157) tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D)); elseif ((M * M) <= 1e-105) tmp = 0.0; elseif ((M * M) <= 1.9e-55) tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h))); elseif ((M * M) <= 0.12) tmp = 0.0; else tmp = t_0 * (2.0 / (D / ((d / w) * ((c0 / (D / d)) / 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]}, If[LessEqual[N[(M * M), $MachinePrecision], 1e-304], 0.0, If[LessEqual[N[(M * M), $MachinePrecision], 5e-258], N[(t$95$0 * N[(2.0 * N[(N[(d * N[(c0 / N[(N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 9e-213], 0.0, If[LessEqual[N[(M * M), $MachinePrecision], 1.42e-157], N[(t$95$0 * N[(2.0 * N[(N[(d * N[(N[(N[(d / D), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 1e-105], 0.0, If[LessEqual[N[(M * M), $MachinePrecision], 1.9e-55], N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 0.12], 0.0, N[(t$95$0 * N[(2.0 / N[(D / N[(N[(d / w), $MachinePrecision] * N[(N[(c0 / N[(D / d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;M \cdot M \leq 10^{-304}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-258}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \frac{c0}{\frac{D \cdot \left(w \cdot h\right)}{d}}}{D}\right)\\
\mathbf{elif}\;M \cdot M \leq 9 \cdot 10^{-213}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \cdot M \leq 1.42 \cdot 10^{-157}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \left(\frac{\frac{d}{D}}{w} \cdot \frac{c0}{h}\right)}{D}\right)\\
\mathbf{elif}\;M \cdot M \leq 10^{-105}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \cdot M \leq 1.9 \cdot 10^{-55}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h}\right)\right)\\
\mathbf{elif}\;M \cdot M \leq 0.12:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \frac{2}{\frac{D}{\frac{d}{w} \cdot \frac{\frac{c0}{\frac{D}{d}}}{h}}}\\
\end{array}
\end{array}
if (*.f64 M M) < 9.99999999999999971e-305 or 4.9999999999999999e-258 < (*.f64 M M) < 9.0000000000000002e-213 or 1.42000000000000001e-157 < (*.f64 M M) < 9.99999999999999965e-106 or 1.8999999999999998e-55 < (*.f64 M M) < 0.12Initial program 21.8%
times-frac21.0%
Simplified21.9%
Taylor expanded in c0 around -inf 4.5%
associate-*r*4.5%
neg-mul-14.5%
distribute-lft1-in4.5%
metadata-eval4.5%
mul0-lft44.1%
distribute-lft-neg-in44.1%
distribute-rgt-neg-in44.1%
metadata-eval44.1%
Simplified44.1%
Taylor expanded in c0 around 0 56.9%
if 9.99999999999999971e-305 < (*.f64 M M) < 4.9999999999999999e-258Initial program 41.7%
times-frac33.3%
Simplified41.5%
Taylor expanded in c0 around inf 42.4%
pow242.4%
pow242.4%
*-commutative42.4%
*-commutative42.4%
times-frac42.1%
frac-times50.0%
unpow250.0%
associate-*l/58.3%
times-frac57.2%
Applied egg-rr57.2%
frac-times58.3%
associate-*l/50.0%
*-commutative50.0%
unpow250.0%
associate-*r*66.7%
associate-*l/66.7%
associate-*r/66.5%
Applied egg-rr66.5%
Taylor expanded in d around 0 66.7%
associate-/l*91.5%
Simplified91.5%
if 9.0000000000000002e-213 < (*.f64 M M) < 1.42000000000000001e-157Initial program 40.0%
times-frac30.2%
Simplified30.2%
Taylor expanded in c0 around inf 35.6%
pow235.6%
pow235.6%
*-commutative35.6%
*-commutative35.6%
times-frac30.7%
frac-times45.6%
unpow245.6%
associate-*l/45.6%
times-frac55.7%
Applied egg-rr55.7%
frac-times45.6%
associate-*l/45.6%
*-commutative45.6%
unpow245.6%
associate-*r*56.2%
associate-*l/56.2%
associate-*r/55.8%
Applied egg-rr55.8%
times-frac66.0%
Applied egg-rr66.0%
if 9.99999999999999965e-106 < (*.f64 M M) < 1.8999999999999998e-55Initial program 41.7%
times-frac41.7%
Simplified41.7%
Taylor expanded in c0 around inf 41.8%
pow241.8%
pow241.8%
*-commutative41.8%
*-commutative41.8%
times-frac41.8%
frac-times60.5%
unpow260.5%
associate-*l/60.6%
times-frac60.6%
Applied egg-rr60.6%
unpow260.6%
Applied egg-rr60.6%
if 0.12 < (*.f64 M M) Initial program 17.5%
times-frac15.3%
Simplified15.4%
Taylor expanded in c0 around inf 40.0%
pow240.0%
pow240.0%
*-commutative40.0%
*-commutative40.0%
times-frac39.0%
frac-times47.8%
unpow247.8%
associate-*l/48.9%
times-frac51.1%
Applied egg-rr51.1%
frac-times48.9%
associate-*l/47.8%
*-commutative47.8%
unpow247.8%
associate-*r*50.3%
associate-*l/50.3%
associate-*r/51.4%
Applied egg-rr51.4%
expm1-log1p-u26.0%
expm1-udef24.0%
associate-/r*24.0%
associate-*r/24.0%
associate-*r/23.7%
associate-*l/23.7%
Applied egg-rr23.7%
expm1-def25.8%
expm1-log1p51.2%
associate-/l/51.2%
associate-/l*51.2%
times-frac54.3%
*-commutative54.3%
associate-/l*54.5%
Simplified54.5%
Final simplification58.5%
(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_0 (sqrt (- (* t_0 t_0) (* M M)))))))
(if (<= t_1 INFINITY) t_1 0.0)))
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)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} 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 * (d * d)) / ((D * D) * (w * h));
double t_1 = (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = 0.0;
}
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_0 + math.sqrt(((t_0 * t_0) - (M * M)))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = 0.0 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(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = 0.0; 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_0 + sqrt(((t_0 * t_0) - (M * M)))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = 0.0; 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[(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]}, If[LessEqual[t$95$1, Infinity], t$95$1, 0.0]]]
\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} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\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 87.3%
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%
times-frac0.0%
Simplified1.1%
Taylor expanded in c0 around -inf 0.2%
associate-*r*0.2%
neg-mul-10.2%
distribute-lft1-in0.2%
metadata-eval0.2%
mul0-lft38.3%
distribute-lft-neg-in38.3%
distribute-rgt-neg-in38.3%
metadata-eval38.3%
Simplified38.3%
Taylor expanded in c0 around 0 47.1%
Final simplification57.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))))
(if (<= d 4.6e+108)
(* t_0 (* 2.0 (/ (* d (* (/ (/ d D) w) (/ c0 h))) D)))
(if (<= d 1.15e+154)
0.0
(if (<= d 7.1e+204)
(* t_0 (* 2.0 (* (/ c0 w) (/ (* (/ d D) (/ d D)) h))))
(if (<= d 3.1e+228)
0.0
(* t_0 (* 2.0 (/ (* d (/ c0 (/ (* D (* w h)) d))) D)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double tmp;
if (d <= 4.6e+108) {
tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D));
} else if (d <= 1.15e+154) {
tmp = 0.0;
} else if (d <= 7.1e+204) {
tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h)));
} else if (d <= 3.1e+228) {
tmp = 0.0;
} else {
tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
if (d_1 <= 4.6d+108) then
tmp = t_0 * (2.0d0 * ((d_1 * (((d_1 / d) / w) * (c0 / h))) / d))
else if (d_1 <= 1.15d+154) then
tmp = 0.0d0
else if (d_1 <= 7.1d+204) then
tmp = t_0 * (2.0d0 * ((c0 / w) * (((d_1 / d) * (d_1 / d)) / h)))
else if (d_1 <= 3.1d+228) then
tmp = 0.0d0
else
tmp = t_0 * (2.0d0 * ((d_1 * (c0 / ((d * (w * h)) / d_1))) / d))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double tmp;
if (d <= 4.6e+108) {
tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D));
} else if (d <= 1.15e+154) {
tmp = 0.0;
} else if (d <= 7.1e+204) {
tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h)));
} else if (d <= 3.1e+228) {
tmp = 0.0;
} else {
tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) tmp = 0 if d <= 4.6e+108: tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D)) elif d <= 1.15e+154: tmp = 0.0 elif d <= 7.1e+204: tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h))) elif d <= 3.1e+228: tmp = 0.0 else: tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (d <= 4.6e+108) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * Float64(Float64(Float64(d / D) / w) * Float64(c0 / h))) / D))); elseif (d <= 1.15e+154) tmp = 0.0; elseif (d <= 7.1e+204) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / h)))); elseif (d <= 3.1e+228) tmp = 0.0; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * Float64(c0 / Float64(Float64(D * Float64(w * h)) / d))) / D))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); tmp = 0.0; if (d <= 4.6e+108) tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D)); elseif (d <= 1.15e+154) tmp = 0.0; elseif (d <= 7.1e+204) tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h))); elseif (d <= 3.1e+228) tmp = 0.0; else tmp = t_0 * (2.0 * ((d * (c0 / ((D * (w * h)) / d))) / D)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 4.6e+108], N[(t$95$0 * N[(2.0 * N[(N[(d * N[(N[(N[(d / D), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e+154], 0.0, If[LessEqual[d, 7.1e+204], N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.1e+228], 0.0, N[(t$95$0 * N[(2.0 * N[(N[(d * N[(c0 / N[(N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \leq 4.6 \cdot 10^{+108}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \left(\frac{\frac{d}{D}}{w} \cdot \frac{c0}{h}\right)}{D}\right)\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{+154}:\\
\;\;\;\;0\\
\mathbf{elif}\;d \leq 7.1 \cdot 10^{+204}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h}\right)\right)\\
\mathbf{elif}\;d \leq 3.1 \cdot 10^{+228}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \frac{c0}{\frac{D \cdot \left(w \cdot h\right)}{d}}}{D}\right)\\
\end{array}
\end{array}
if d < 4.5999999999999998e108Initial program 24.3%
times-frac21.9%
Simplified22.4%
Taylor expanded in c0 around inf 32.2%
pow232.2%
pow232.2%
*-commutative32.2%
*-commutative32.2%
times-frac32.1%
frac-times40.9%
unpow240.9%
associate-*l/41.0%
times-frac43.0%
Applied egg-rr43.0%
frac-times41.0%
associate-*l/40.9%
*-commutative40.9%
unpow240.9%
associate-*r*44.3%
associate-*l/43.8%
associate-*r/44.7%
Applied egg-rr44.7%
times-frac45.5%
Applied egg-rr45.5%
if 4.5999999999999998e108 < d < 1.15e154 or 7.09999999999999957e204 < d < 3.0999999999999999e228Initial program 13.7%
times-frac13.7%
Simplified13.7%
Taylor expanded in c0 around -inf 0.4%
associate-*r*0.4%
neg-mul-10.4%
distribute-lft1-in0.4%
metadata-eval0.4%
mul0-lft47.9%
distribute-lft-neg-in47.9%
distribute-rgt-neg-in47.9%
metadata-eval47.9%
Simplified47.9%
Taylor expanded in c0 around 0 61.3%
if 1.15e154 < d < 7.09999999999999957e204Initial program 29.4%
times-frac29.4%
Simplified29.4%
Taylor expanded in c0 around inf 36.0%
pow236.0%
pow236.0%
*-commutative36.0%
*-commutative36.0%
times-frac36.0%
frac-times47.9%
unpow247.9%
associate-*l/47.8%
times-frac48.0%
Applied egg-rr48.0%
unpow248.0%
Applied egg-rr48.0%
if 3.0999999999999999e228 < d Initial program 19.2%
times-frac15.4%
Simplified19.2%
Taylor expanded in c0 around inf 27.3%
pow227.3%
pow227.3%
*-commutative27.3%
*-commutative27.3%
times-frac27.3%
frac-times39.1%
unpow239.1%
associate-*l/43.0%
times-frac43.3%
Applied egg-rr43.3%
frac-times43.0%
associate-*l/39.1%
*-commutative39.1%
unpow239.1%
associate-*r*46.2%
associate-*l/46.1%
associate-*r/43.2%
Applied egg-rr43.2%
Taylor expanded in d around 0 39.5%
associate-/l*50.4%
Simplified50.4%
Final simplification47.0%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 9.2e-237)
0.0
(if (or (<= M 2.5e-220)
(and (not (<= M 4e-53)) (or (<= M 6.8e-28) (not (<= M 8.5e+16)))))
(* (/ c0 w) (* (* (/ d D) (/ d D)) (/ c0 (* w h))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 9.2e-237) {
tmp = 0.0;
} else if ((M <= 2.5e-220) || (!(M <= 4e-53) && ((M <= 6.8e-28) || !(M <= 8.5e+16)))) {
tmp = (c0 / w) * (((d / D) * (d / D)) * (c0 / (w * 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) :: tmp
if (m <= 9.2d-237) then
tmp = 0.0d0
else if ((m <= 2.5d-220) .or. (.not. (m <= 4d-53)) .and. (m <= 6.8d-28) .or. (.not. (m <= 8.5d+16))) then
tmp = (c0 / w) * (((d_1 / d) * (d_1 / d)) * (c0 / (w * 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 tmp;
if (M <= 9.2e-237) {
tmp = 0.0;
} else if ((M <= 2.5e-220) || (!(M <= 4e-53) && ((M <= 6.8e-28) || !(M <= 8.5e+16)))) {
tmp = (c0 / w) * (((d / D) * (d / D)) * (c0 / (w * h)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 9.2e-237: tmp = 0.0 elif (M <= 2.5e-220) or (not (M <= 4e-53) and ((M <= 6.8e-28) or not (M <= 8.5e+16))): tmp = (c0 / w) * (((d / D) * (d / D)) * (c0 / (w * h))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 9.2e-237) tmp = 0.0; elseif ((M <= 2.5e-220) || (!(M <= 4e-53) && ((M <= 6.8e-28) || !(M <= 8.5e+16)))) tmp = Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 / Float64(w * h)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 9.2e-237) tmp = 0.0; elseif ((M <= 2.5e-220) || (~((M <= 4e-53)) && ((M <= 6.8e-28) || ~((M <= 8.5e+16))))) tmp = (c0 / w) * (((d / D) * (d / D)) * (c0 / (w * h))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 9.2e-237], 0.0, If[Or[LessEqual[M, 2.5e-220], And[N[Not[LessEqual[M, 4e-53]], $MachinePrecision], Or[LessEqual[M, 6.8e-28], N[Not[LessEqual[M, 8.5e+16]], $MachinePrecision]]]], N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 9.2 \cdot 10^{-237}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 2.5 \cdot 10^{-220} \lor \neg \left(M \leq 4 \cdot 10^{-53}\right) \land \left(M \leq 6.8 \cdot 10^{-28} \lor \neg \left(M \leq 8.5 \cdot 10^{+16}\right)\right):\\
\;\;\;\;\frac{c0}{w} \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if M < 9.20000000000000046e-237 or 2.5000000000000001e-220 < M < 4.00000000000000012e-53 or 6.8000000000000001e-28 < M < 8.5e16Initial program 24.6%
times-frac22.3%
Simplified23.3%
Taylor expanded in c0 around -inf 3.2%
associate-*r*3.2%
neg-mul-13.2%
distribute-lft1-in3.2%
metadata-eval3.2%
mul0-lft33.9%
distribute-lft-neg-in33.9%
distribute-rgt-neg-in33.9%
metadata-eval33.9%
Simplified33.9%
Taylor expanded in c0 around 0 41.9%
if 9.20000000000000046e-237 < M < 2.5000000000000001e-220 or 4.00000000000000012e-53 < M < 6.8000000000000001e-28 or 8.5e16 < M Initial program 18.7%
times-frac16.6%
Simplified16.7%
Taylor expanded in c0 around inf 42.5%
expm1-log1p-u19.1%
expm1-udef17.2%
Applied egg-rr19.6%
expm1-def21.5%
expm1-log1p49.1%
associate-*l/48.1%
times-frac49.1%
*-commutative49.1%
associate-/l*49.1%
metadata-eval49.1%
/-rgt-identity49.1%
*-commutative49.1%
associate-/r*48.8%
Simplified48.8%
unpow253.1%
Applied egg-rr48.8%
Taylor expanded in c0 around 0 49.1%
Final simplification43.2%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= d 6.8e+108) (and (not (<= d 1.2e+153)) (<= d 7.4e+204))) (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 w) (/ (* (/ d D) (/ d D)) h)))) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d <= 6.8e+108) || (!(d <= 1.2e+153) && (d <= 7.4e+204))) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / 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) :: tmp
if ((d_1 <= 6.8d+108) .or. (.not. (d_1 <= 1.2d+153)) .and. (d_1 <= 7.4d+204)) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / w) * (((d_1 / d) * (d_1 / d)) / 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 tmp;
if ((d <= 6.8e+108) || (!(d <= 1.2e+153) && (d <= 7.4e+204))) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d <= 6.8e+108) or (not (d <= 1.2e+153) and (d <= 7.4e+204)): tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((d <= 6.8e+108) || (!(d <= 1.2e+153) && (d <= 7.4e+204))) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / h)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d <= 6.8e+108) || (~((d <= 1.2e+153)) && (d <= 7.4e+204))) tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[d, 6.8e+108], And[N[Not[LessEqual[d, 1.2e+153]], $MachinePrecision], LessEqual[d, 7.4e+204]]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 6.8 \cdot 10^{+108} \lor \neg \left(d \leq 1.2 \cdot 10^{+153}\right) \land d \leq 7.4 \cdot 10^{+204}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if d < 6.79999999999999992e108 or 1.19999999999999996e153 < d < 7.4000000000000001e204Initial program 24.7%
times-frac22.5%
Simplified23.0%
Taylor expanded in c0 around inf 32.5%
pow232.5%
pow232.5%
*-commutative32.5%
*-commutative32.5%
times-frac32.4%
frac-times41.5%
unpow241.5%
associate-*l/41.5%
times-frac43.4%
Applied egg-rr43.4%
unpow243.4%
Applied egg-rr43.4%
if 6.79999999999999992e108 < d < 1.19999999999999996e153 or 7.4000000000000001e204 < d Initial program 17.2%
times-frac14.8%
Simplified17.2%
Taylor expanded in c0 around -inf 0.1%
associate-*r*0.1%
neg-mul-10.1%
distribute-lft1-in0.1%
metadata-eval0.1%
mul0-lft42.1%
distribute-lft-neg-in42.1%
distribute-rgt-neg-in42.1%
metadata-eval42.1%
Simplified42.1%
Taylor expanded in c0 around 0 51.9%
Final simplification44.7%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))))
(if (<= d 1.22e+109)
(* t_0 (* 2.0 (/ (* d (* (/ (/ d D) w) (/ c0 h))) D)))
(if (<= d 9.6e+151)
0.0
(if (<= d 8e+204)
(* t_0 (* 2.0 (* (/ c0 w) (/ (* (/ d D) (/ d D)) 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 tmp;
if (d <= 1.22e+109) {
tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D));
} else if (d <= 9.6e+151) {
tmp = 0.0;
} else if (d <= 8e+204) {
tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / 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 = c0 / (2.0d0 * w)
if (d_1 <= 1.22d+109) then
tmp = t_0 * (2.0d0 * ((d_1 * (((d_1 / d) / w) * (c0 / h))) / d))
else if (d_1 <= 9.6d+151) then
tmp = 0.0d0
else if (d_1 <= 8d+204) then
tmp = t_0 * (2.0d0 * ((c0 / w) * (((d_1 / d) * (d_1 / d)) / 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 = c0 / (2.0 * w);
double tmp;
if (d <= 1.22e+109) {
tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D));
} else if (d <= 9.6e+151) {
tmp = 0.0;
} else if (d <= 8e+204) {
tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) tmp = 0 if d <= 1.22e+109: tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D)) elif d <= 9.6e+151: tmp = 0.0 elif d <= 8e+204: tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / h))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (d <= 1.22e+109) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * Float64(Float64(Float64(d / D) / w) * Float64(c0 / h))) / D))); elseif (d <= 9.6e+151) tmp = 0.0; elseif (d <= 8e+204) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / 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); tmp = 0.0; if (d <= 1.22e+109) tmp = t_0 * (2.0 * ((d * (((d / D) / w) * (c0 / h))) / D)); elseif (d <= 9.6e+151) tmp = 0.0; elseif (d <= 8e+204) tmp = t_0 * (2.0 * ((c0 / w) * (((d / D) * (d / D)) / 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]}, If[LessEqual[d, 1.22e+109], N[(t$95$0 * N[(2.0 * N[(N[(d * N[(N[(N[(d / D), $MachinePrecision] / w), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.6e+151], 0.0, If[LessEqual[d, 8e+204], N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \leq 1.22 \cdot 10^{+109}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \left(\frac{\frac{d}{D}}{w} \cdot \frac{c0}{h}\right)}{D}\right)\\
\mathbf{elif}\;d \leq 9.6 \cdot 10^{+151}:\\
\;\;\;\;0\\
\mathbf{elif}\;d \leq 8 \cdot 10^{+204}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if d < 1.2200000000000001e109Initial program 24.3%
times-frac21.9%
Simplified22.4%
Taylor expanded in c0 around inf 32.2%
pow232.2%
pow232.2%
*-commutative32.2%
*-commutative32.2%
times-frac32.1%
frac-times40.9%
unpow240.9%
associate-*l/41.0%
times-frac43.0%
Applied egg-rr43.0%
frac-times41.0%
associate-*l/40.9%
*-commutative40.9%
unpow240.9%
associate-*r*44.3%
associate-*l/43.8%
associate-*r/44.7%
Applied egg-rr44.7%
times-frac45.5%
Applied egg-rr45.5%
if 1.2200000000000001e109 < d < 9.6000000000000004e151 or 7.99999999999999991e204 < d Initial program 17.2%
times-frac14.8%
Simplified17.2%
Taylor expanded in c0 around -inf 0.1%
associate-*r*0.1%
neg-mul-10.1%
distribute-lft1-in0.1%
metadata-eval0.1%
mul0-lft42.1%
distribute-lft-neg-in42.1%
distribute-rgt-neg-in42.1%
metadata-eval42.1%
Simplified42.1%
Taylor expanded in c0 around 0 51.9%
if 9.6000000000000004e151 < d < 7.99999999999999991e204Initial program 29.4%
times-frac29.4%
Simplified29.4%
Taylor expanded in c0 around inf 36.0%
pow236.0%
pow236.0%
*-commutative36.0%
*-commutative36.0%
times-frac36.0%
frac-times47.9%
unpow247.9%
associate-*l/47.8%
times-frac48.0%
Applied egg-rr48.0%
unpow248.0%
Applied egg-rr48.0%
Final simplification46.6%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D))))
(if (<= d 2e+108)
(* (/ c0 w) (* t_0 (/ (/ c0 h) w)))
(if (<= d 6.6e+155)
0.0
(if (<= d 7.4e+204) (* (/ c0 w) (* t_0 (/ c0 (* w h)))) 0.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double tmp;
if (d <= 2e+108) {
tmp = (c0 / w) * (t_0 * ((c0 / h) / w));
} else if (d <= 6.6e+155) {
tmp = 0.0;
} else if (d <= 7.4e+204) {
tmp = (c0 / w) * (t_0 * (c0 / (w * 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 / d) * (d_1 / d)
if (d_1 <= 2d+108) then
tmp = (c0 / w) * (t_0 * ((c0 / h) / w))
else if (d_1 <= 6.6d+155) then
tmp = 0.0d0
else if (d_1 <= 7.4d+204) then
tmp = (c0 / w) * (t_0 * (c0 / (w * 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 / D) * (d / D);
double tmp;
if (d <= 2e+108) {
tmp = (c0 / w) * (t_0 * ((c0 / h) / w));
} else if (d <= 6.6e+155) {
tmp = 0.0;
} else if (d <= 7.4e+204) {
tmp = (c0 / w) * (t_0 * (c0 / (w * h)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) tmp = 0 if d <= 2e+108: tmp = (c0 / w) * (t_0 * ((c0 / h) / w)) elif d <= 6.6e+155: tmp = 0.0 elif d <= 7.4e+204: tmp = (c0 / w) * (t_0 * (c0 / (w * h))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) tmp = 0.0 if (d <= 2e+108) tmp = Float64(Float64(c0 / w) * Float64(t_0 * Float64(Float64(c0 / h) / w))); elseif (d <= 6.6e+155) tmp = 0.0; elseif (d <= 7.4e+204) tmp = Float64(Float64(c0 / w) * Float64(t_0 * Float64(c0 / Float64(w * h)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); tmp = 0.0; if (d <= 2e+108) tmp = (c0 / w) * (t_0 * ((c0 / h) / w)); elseif (d <= 6.6e+155) tmp = 0.0; elseif (d <= 7.4e+204) tmp = (c0 / w) * (t_0 * (c0 / (w * h))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 2e+108], N[(N[(c0 / w), $MachinePrecision] * N[(t$95$0 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.6e+155], 0.0, If[LessEqual[d, 7.4e+204], N[(N[(c0 / w), $MachinePrecision] * N[(t$95$0 * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
\mathbf{if}\;d \leq 2 \cdot 10^{+108}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(t_0 \cdot \frac{\frac{c0}{h}}{w}\right)\\
\mathbf{elif}\;d \leq 6.6 \cdot 10^{+155}:\\
\;\;\;\;0\\
\mathbf{elif}\;d \leq 7.4 \cdot 10^{+204}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(t_0 \cdot \frac{c0}{w \cdot h}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if d < 2.0000000000000001e108Initial program 24.3%
times-frac21.9%
Simplified22.4%
Taylor expanded in c0 around inf 32.2%
expm1-log1p-u15.7%
expm1-udef14.3%
Applied egg-rr19.4%
expm1-def20.3%
expm1-log1p40.9%
associate-*l/40.2%
times-frac40.9%
*-commutative40.9%
associate-/l*40.9%
metadata-eval40.9%
/-rgt-identity40.9%
*-commutative40.9%
associate-/r*40.9%
Simplified40.9%
unpow243.0%
Applied egg-rr40.9%
if 2.0000000000000001e108 < d < 6.5999999999999997e155 or 7.4000000000000001e204 < d Initial program 17.2%
times-frac14.8%
Simplified17.2%
Taylor expanded in c0 around -inf 0.1%
associate-*r*0.1%
neg-mul-10.1%
distribute-lft1-in0.1%
metadata-eval0.1%
mul0-lft42.1%
distribute-lft-neg-in42.1%
distribute-rgt-neg-in42.1%
metadata-eval42.1%
Simplified42.1%
Taylor expanded in c0 around 0 51.9%
if 6.5999999999999997e155 < d < 7.4000000000000001e204Initial program 29.4%
times-frac29.4%
Simplified29.4%
Taylor expanded in c0 around inf 36.0%
expm1-log1p-u23.7%
expm1-udef23.7%
Applied egg-rr29.6%
expm1-def23.9%
expm1-log1p47.9%
associate-*l/47.8%
times-frac47.9%
*-commutative47.9%
associate-/l*47.9%
metadata-eval47.9%
/-rgt-identity47.9%
*-commutative47.9%
associate-/r*42.4%
Simplified42.4%
unpow248.0%
Applied egg-rr42.4%
Taylor expanded in c0 around 0 47.9%
Final simplification43.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D))))
(if (<= d 8.8e+108)
(* (/ c0 w) (* t_0 (* (/ c0 h) (/ 1.0 w))))
(if (<= d 7.6e+155)
0.0
(if (<= d 7.9e+204) (* (/ c0 w) (* t_0 (/ c0 (* w h)))) 0.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double tmp;
if (d <= 8.8e+108) {
tmp = (c0 / w) * (t_0 * ((c0 / h) * (1.0 / w)));
} else if (d <= 7.6e+155) {
tmp = 0.0;
} else if (d <= 7.9e+204) {
tmp = (c0 / w) * (t_0 * (c0 / (w * 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 / d) * (d_1 / d)
if (d_1 <= 8.8d+108) then
tmp = (c0 / w) * (t_0 * ((c0 / h) * (1.0d0 / w)))
else if (d_1 <= 7.6d+155) then
tmp = 0.0d0
else if (d_1 <= 7.9d+204) then
tmp = (c0 / w) * (t_0 * (c0 / (w * 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 / D) * (d / D);
double tmp;
if (d <= 8.8e+108) {
tmp = (c0 / w) * (t_0 * ((c0 / h) * (1.0 / w)));
} else if (d <= 7.6e+155) {
tmp = 0.0;
} else if (d <= 7.9e+204) {
tmp = (c0 / w) * (t_0 * (c0 / (w * h)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) tmp = 0 if d <= 8.8e+108: tmp = (c0 / w) * (t_0 * ((c0 / h) * (1.0 / w))) elif d <= 7.6e+155: tmp = 0.0 elif d <= 7.9e+204: tmp = (c0 / w) * (t_0 * (c0 / (w * h))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) tmp = 0.0 if (d <= 8.8e+108) tmp = Float64(Float64(c0 / w) * Float64(t_0 * Float64(Float64(c0 / h) * Float64(1.0 / w)))); elseif (d <= 7.6e+155) tmp = 0.0; elseif (d <= 7.9e+204) tmp = Float64(Float64(c0 / w) * Float64(t_0 * Float64(c0 / Float64(w * h)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); tmp = 0.0; if (d <= 8.8e+108) tmp = (c0 / w) * (t_0 * ((c0 / h) * (1.0 / w))); elseif (d <= 7.6e+155) tmp = 0.0; elseif (d <= 7.9e+204) tmp = (c0 / w) * (t_0 * (c0 / (w * h))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 8.8e+108], N[(N[(c0 / w), $MachinePrecision] * N[(t$95$0 * N[(N[(c0 / h), $MachinePrecision] * N[(1.0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.6e+155], 0.0, If[LessEqual[d, 7.9e+204], N[(N[(c0 / w), $MachinePrecision] * N[(t$95$0 * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
\mathbf{if}\;d \leq 8.8 \cdot 10^{+108}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(t_0 \cdot \left(\frac{c0}{h} \cdot \frac{1}{w}\right)\right)\\
\mathbf{elif}\;d \leq 7.6 \cdot 10^{+155}:\\
\;\;\;\;0\\
\mathbf{elif}\;d \leq 7.9 \cdot 10^{+204}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(t_0 \cdot \frac{c0}{w \cdot h}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if d < 8.8000000000000005e108Initial program 24.3%
times-frac21.9%
Simplified22.4%
Taylor expanded in c0 around inf 32.2%
expm1-log1p-u15.7%
expm1-udef14.3%
Applied egg-rr19.4%
expm1-def20.3%
expm1-log1p40.9%
associate-*l/40.2%
times-frac40.9%
*-commutative40.9%
associate-/l*40.9%
metadata-eval40.9%
/-rgt-identity40.9%
*-commutative40.9%
associate-/r*40.9%
Simplified40.9%
unpow243.0%
Applied egg-rr40.9%
div-inv40.9%
Applied egg-rr40.9%
if 8.8000000000000005e108 < d < 7.6000000000000001e155 or 7.90000000000000012e204 < d Initial program 17.2%
times-frac14.8%
Simplified17.2%
Taylor expanded in c0 around -inf 0.1%
associate-*r*0.1%
neg-mul-10.1%
distribute-lft1-in0.1%
metadata-eval0.1%
mul0-lft42.1%
distribute-lft-neg-in42.1%
distribute-rgt-neg-in42.1%
metadata-eval42.1%
Simplified42.1%
Taylor expanded in c0 around 0 51.9%
if 7.6000000000000001e155 < d < 7.90000000000000012e204Initial program 29.4%
times-frac29.4%
Simplified29.4%
Taylor expanded in c0 around inf 36.0%
expm1-log1p-u23.7%
expm1-udef23.7%
Applied egg-rr29.6%
expm1-def23.9%
expm1-log1p47.9%
associate-*l/47.8%
times-frac47.9%
*-commutative47.9%
associate-/l*47.9%
metadata-eval47.9%
/-rgt-identity47.9%
*-commutative47.9%
associate-/r*42.4%
Simplified42.4%
unpow248.0%
Applied egg-rr42.4%
Taylor expanded in c0 around 0 47.9%
Final simplification43.1%
(FPCore (c0 w h D d M) :precision binary64 0.0)
double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
def code(c0, w, h, D, d, M): return 0.0
function code(c0, w, h, D, d, M) return 0.0 end
function tmp = code(c0, w, h, D, d, M) tmp = 0.0; end
code[c0_, w_, h_, D_, d_, M_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 23.5%
times-frac21.2%
Simplified22.1%
Taylor expanded in c0 around -inf 2.6%
associate-*r*2.6%
neg-mul-12.6%
distribute-lft1-in2.6%
metadata-eval2.6%
mul0-lft30.8%
distribute-lft-neg-in30.8%
distribute-rgt-neg-in30.8%
metadata-eval30.8%
Simplified30.8%
Taylor expanded in c0 around 0 37.3%
Final simplification37.3%
herbie shell --seed 2023318
(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))))))