
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 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 (* (pow (/ d D) 2.0) (/ c0 (* w h)))))
(* 0.25 (/ (* h (* (* D D) (* M M))) (* d d))))))
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 * (pow((d / D), 2.0) * (c0 / (w * h))));
} else {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
}
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 * (Math.pow((d / D), 2.0) * (c0 / (w * h))));
} else {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
}
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 * (math.pow((d / D), 2.0) * (c0 / (w * h)))) else: tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)) 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) ^ 2.0) * Float64(c0 / Float64(w * h))))); else tmp = Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d))); 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) ^ 2.0) * (c0 / (w * h)))); else tmp = 0.25 * ((h * ((D * D) * (M * M))) / (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]}, 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[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\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(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\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 75.9%
Simplified73.8%
Taylor expanded in c0 around inf 80.1%
associate-/l*79.3%
unpow279.3%
unpow279.3%
Simplified79.3%
*-commutative79.3%
*-commutative79.3%
associate-/l*80.1%
times-frac78.1%
frac-times84.9%
*-commutative84.9%
pow284.9%
*-commutative84.9%
Applied egg-rr84.9%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
frac-times0.0%
frac-times0.1%
*-commutative0.1%
pow20.1%
Applied egg-rr0.1%
Taylor expanded in c0 around -inf 1.8%
Simplified26.1%
Taylor expanded in c0 around 0 43.7%
associate-*r*44.8%
unpow244.8%
unpow244.8%
*-commutative44.8%
unpow244.8%
Simplified44.8%
Final simplification57.9%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= c0 -1.6e-141) (not (<= c0 3.7e-179))) (* (* (pow (/ d D) 2.0) (/ (/ c0 h) w)) (/ (* 2.0 (/ c0 2.0)) w)) (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -1.6e-141) || !(c0 <= 3.7e-179)) {
tmp = (pow((d / D), 2.0) * ((c0 / h) / w)) * ((2.0 * (c0 / 2.0)) / w);
} else {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((c0 <= (-1.6d-141)) .or. (.not. (c0 <= 3.7d-179))) then
tmp = (((d_1 / d) ** 2.0d0) * ((c0 / h) / w)) * ((2.0d0 * (c0 / 2.0d0)) / w)
else
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -1.6e-141) || !(c0 <= 3.7e-179)) {
tmp = (Math.pow((d / D), 2.0) * ((c0 / h) / w)) * ((2.0 * (c0 / 2.0)) / w);
} else {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (c0 <= -1.6e-141) or not (c0 <= 3.7e-179): tmp = (math.pow((d / D), 2.0) * ((c0 / h) / w)) * ((2.0 * (c0 / 2.0)) / w) else: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((c0 <= -1.6e-141) || !(c0 <= 3.7e-179)) tmp = Float64(Float64((Float64(d / D) ^ 2.0) * Float64(Float64(c0 / h) / w)) * Float64(Float64(2.0 * Float64(c0 / 2.0)) / w)); else tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((c0 <= -1.6e-141) || ~((c0 <= 3.7e-179))) tmp = (((d / D) ^ 2.0) * ((c0 / h) / w)) * ((2.0 * (c0 / 2.0)) / w); else tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[c0, -1.6e-141], N[Not[LessEqual[c0, 3.7e-179]], $MachinePrecision]], N[(N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * N[(c0 / 2.0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -1.6 \cdot 10^{-141} \lor \neg \left(c0 \leq 3.7 \cdot 10^{-179}\right):\\
\;\;\;\;\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{h}}{w}\right) \cdot \frac{2 \cdot \frac{c0}{2}}{w}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\end{array}
\end{array}
if c0 < -1.6000000000000001e-141 or 3.6999999999999999e-179 < c0 Initial program 26.1%
Simplified26.2%
Taylor expanded in c0 around inf 36.2%
associate-/l*37.7%
unpow237.7%
unpow237.7%
Simplified37.7%
*-commutative37.7%
*-commutative37.7%
associate-/l*36.2%
add-cube-cbrt36.2%
Applied egg-rr47.8%
pow147.8%
add-cube-cbrt47.9%
associate-*r*47.9%
associate-/r*47.9%
Applied egg-rr47.9%
unpow147.9%
*-commutative47.9%
associate-/r*49.7%
associate-*l/49.7%
Simplified49.7%
if -1.6000000000000001e-141 < c0 < 3.6999999999999999e-179Initial program 17.8%
frac-times16.0%
frac-times16.1%
*-commutative16.1%
pow216.1%
Applied egg-rr16.1%
Taylor expanded in c0 around -inf 2.6%
Simplified49.9%
Taylor expanded in c0 around 0 60.6%
associate-/l*60.6%
unpow260.6%
unpow260.6%
*-commutative60.6%
unpow260.6%
Simplified60.6%
Final simplification51.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))))
(if (<= (* D D) 5e-205)
(* t_0 (* 2.0 (* (* d d) (/ c0 (* D (* D (* w h)))))))
(if (<= (* D D) 4e-59)
(* 0.25 (/ (* h (* (* D D) (* M M))) (* d d)))
(if (<= (* D D) 4e+304)
(* t_0 (* 2.0 (/ c0 (* (/ (* D D) d) (/ (* w h) d)))))
(* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w)))))))))
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 * D) <= 5e-205) {
tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
} else if ((D * D) <= 4e-59) {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
} else if ((D * D) <= 4e+304) {
tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
} else {
tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
}
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 * d) <= 5d-205) then
tmp = t_0 * (2.0d0 * ((d_1 * d_1) * (c0 / (d * (d * (w * h))))))
else if ((d * d) <= 4d-59) then
tmp = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
else if ((d * d) <= 4d+304) then
tmp = t_0 * (2.0d0 * (c0 / (((d * d) / d_1) * ((w * h) / d_1))))
else
tmp = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
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 * D) <= 5e-205) {
tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
} else if ((D * D) <= 4e-59) {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
} else if ((D * D) <= 4e+304) {
tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
} else {
tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) tmp = 0 if (D * D) <= 5e-205: tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h)))))) elif (D * D) <= 4e-59: tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)) elif (D * D) <= 4e+304: tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d)))) else: tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (Float64(D * D) <= 5e-205) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * d) * Float64(c0 / Float64(D * Float64(D * Float64(w * h))))))); elseif (Float64(D * D) <= 4e-59) tmp = Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d))); elseif (Float64(D * D) <= 4e+304) tmp = Float64(t_0 * Float64(2.0 * Float64(c0 / Float64(Float64(Float64(D * D) / d) * Float64(Float64(w * h) / d))))); else tmp = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w)))); 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 * D) <= 5e-205) tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h)))))); elseif ((D * D) <= 4e-59) tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)); elseif ((D * D) <= 4e+304) tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d)))); else tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))); 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[(D * D), $MachinePrecision], 5e-205], N[(t$95$0 * N[(2.0 * N[(N[(d * d), $MachinePrecision] * N[(c0 / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 4e-59], N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 4e+304], N[(t$95$0 * N[(2.0 * N[(c0 / N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(w * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;D \cdot D \leq 5 \cdot 10^{-205}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-59}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{+304}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0}{\frac{D \cdot D}{d} \cdot \frac{w \cdot h}{d}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
\end{array}
\end{array}
if (*.f64 D D) < 5.00000000000000001e-205Initial program 27.9%
Simplified28.7%
Taylor expanded in c0 around inf 40.3%
associate-/l*42.5%
unpow242.5%
unpow242.5%
Simplified42.5%
associate-/r/42.5%
associate-*l*45.5%
Applied egg-rr45.5%
if 5.00000000000000001e-205 < (*.f64 D D) < 4.0000000000000001e-59Initial program 24.5%
frac-times22.9%
frac-times22.9%
*-commutative22.9%
pow222.9%
Applied egg-rr22.9%
Taylor expanded in c0 around -inf 2.6%
Simplified39.8%
Taylor expanded in c0 around 0 54.9%
associate-*r*56.6%
unpow256.6%
unpow256.6%
*-commutative56.6%
unpow256.6%
Simplified56.6%
if 4.0000000000000001e-59 < (*.f64 D D) < 3.9999999999999998e304Initial program 32.0%
Simplified30.2%
Taylor expanded in c0 around inf 40.1%
associate-/l*42.2%
unpow242.2%
unpow242.2%
Simplified42.2%
Taylor expanded in D around 0 42.2%
unpow242.2%
associate-*r*42.1%
unpow242.1%
associate-/r*52.5%
associate-*r*52.6%
unpow252.6%
associate-*r/52.8%
associate-*l/52.8%
unpow252.8%
Simplified52.8%
if 3.9999999999999998e304 < (*.f64 D D) Initial program 0.1%
Simplified0.1%
Taylor expanded in c0 around inf 0.2%
pow10.2%
pow20.2%
unpow20.2%
Applied egg-rr0.2%
unpow10.2%
associate-*l*28.0%
Simplified28.0%
pow228.0%
pow228.0%
times-frac31.6%
Applied egg-rr31.6%
associate-/l*34.8%
times-frac38.4%
unpow238.4%
associate-/r*38.1%
unpow238.1%
Simplified38.1%
Final simplification47.8%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w))))))
(if (<= (* D D) 2e-209)
t_0
(if (<= (* D D) 4e-59)
(* 0.25 (/ (* h (* (* D D) (* M M))) (* d d)))
(if (<= (* D D) 2e+286)
(* c0 (* (* c0 (/ d (* D D))) (/ d (* h (* w w)))))
t_0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
double tmp;
if ((D * D) <= 2e-209) {
tmp = t_0;
} else if ((D * D) <= 4e-59) {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
} else if ((D * D) <= 2e+286) {
tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
} else {
tmp = 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 = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
if ((d * d) <= 2d-209) then
tmp = t_0
else if ((d * d) <= 4d-59) then
tmp = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
else if ((d * d) <= 2d+286) then
tmp = c0 * ((c0 * (d_1 / (d * d))) * (d_1 / (h * (w * w))))
else
tmp = 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 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
double tmp;
if ((D * D) <= 2e-209) {
tmp = t_0;
} else if ((D * D) <= 4e-59) {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
} else if ((D * D) <= 2e+286) {
tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
} else {
tmp = t_0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))) tmp = 0 if (D * D) <= 2e-209: tmp = t_0 elif (D * D) <= 4e-59: tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)) elif (D * D) <= 2e+286: tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w)))) else: tmp = t_0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w)))) tmp = 0.0 if (Float64(D * D) <= 2e-209) tmp = t_0; elseif (Float64(D * D) <= 4e-59) tmp = Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d))); elseif (Float64(D * D) <= 2e+286) tmp = Float64(c0 * Float64(Float64(c0 * Float64(d / Float64(D * D))) * Float64(d / Float64(h * Float64(w * w))))); else tmp = t_0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))); tmp = 0.0; if ((D * D) <= 2e-209) tmp = t_0; elseif ((D * D) <= 4e-59) tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)); elseif ((D * D) <= 2e+286) tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w)))); else tmp = t_0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(D * D), $MachinePrecision], 2e-209], t$95$0, If[LessEqual[N[(D * D), $MachinePrecision], 4e-59], N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 2e+286], N[(c0 * N[(N[(c0 * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
\mathbf{if}\;D \cdot D \leq 2 \cdot 10^{-209}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-59}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+286}:\\
\;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 D D) < 2.0000000000000001e-209 or 2.00000000000000007e286 < (*.f64 D D) Initial program 24.1%
Simplified24.2%
Taylor expanded in c0 around inf 25.3%
pow125.3%
pow225.3%
unpow225.3%
Applied egg-rr25.3%
unpow125.3%
associate-*l*33.7%
Simplified33.7%
pow233.7%
pow233.7%
times-frac36.9%
Applied egg-rr36.9%
associate-/l*40.6%
times-frac42.8%
unpow242.8%
associate-/r*42.8%
unpow242.8%
Simplified42.8%
if 2.0000000000000001e-209 < (*.f64 D D) < 4.0000000000000001e-59Initial program 25.1%
frac-times23.6%
frac-times23.6%
*-commutative23.6%
pow223.6%
Applied egg-rr23.6%
Taylor expanded in c0 around -inf 2.4%
Simplified39.4%
Taylor expanded in c0 around 0 55.7%
associate-*r*57.4%
unpow257.4%
unpow257.4%
*-commutative57.4%
unpow257.4%
Simplified57.4%
if 4.0000000000000001e-59 < (*.f64 D D) < 2.00000000000000007e286Initial program 27.5%
Simplified27.8%
Taylor expanded in c0 around inf 24.5%
pow124.5%
pow224.5%
unpow224.5%
Applied egg-rr24.5%
unpow124.5%
associate-*l*24.5%
Simplified24.5%
pow224.5%
pow224.5%
associate-*r/20.9%
associate-*r*20.9%
associate-*l*27.7%
times-frac36.6%
Applied egg-rr36.6%
associate-*r*40.9%
Simplified40.9%
Final simplification44.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))))
(if (<= (* d d) 5e-284)
(*
(/ c0 2.0)
(/ (* 0.5 (/ (* (* (* D D) (* M M)) (* (/ h d) (/ w d))) c0)) w))
(if (<= (* d d) 2e+304)
(* t_0 (* 2.0 (* (* d d) (/ c0 (* D (* D (* w h)))))))
(* t_0 (* 2.0 (/ c0 (* (/ (* D D) d) (/ (* w h) 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 * d) <= 5e-284) {
tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w);
} else if ((d * d) <= 2e+304) {
tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
} else {
tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
if ((d_1 * d_1) <= 5d-284) then
tmp = (c0 / 2.0d0) * ((0.5d0 * ((((d * d) * (m * m)) * ((h / d_1) * (w / d_1))) / c0)) / w)
else if ((d_1 * d_1) <= 2d+304) then
tmp = t_0 * (2.0d0 * ((d_1 * d_1) * (c0 / (d * (d * (w * h))))))
else
tmp = t_0 * (2.0d0 * (c0 / (((d * d) / d_1) * ((w * h) / d_1))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double tmp;
if ((d * d) <= 5e-284) {
tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w);
} else if ((d * d) <= 2e+304) {
tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
} else {
tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) tmp = 0 if (d * d) <= 5e-284: tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w) elif (d * d) <= 2e+304: tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h)))))) else: tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (Float64(d * d) <= 5e-284) tmp = Float64(Float64(c0 / 2.0) * Float64(Float64(0.5 * Float64(Float64(Float64(Float64(D * D) * Float64(M * M)) * Float64(Float64(h / d) * Float64(w / d))) / c0)) / w)); elseif (Float64(d * d) <= 2e+304) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * d) * Float64(c0 / Float64(D * Float64(D * Float64(w * h))))))); else tmp = Float64(t_0 * Float64(2.0 * Float64(c0 / Float64(Float64(Float64(D * D) / d) * Float64(Float64(w * h) / 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 * d) <= 5e-284) tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w); elseif ((d * d) <= 2e+304) tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h)))))); else tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / 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[N[(d * d), $MachinePrecision], 5e-284], N[(N[(c0 / 2.0), $MachinePrecision] * N[(N[(0.5 * N[(N[(N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(w / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 2e+304], N[(t$95$0 * N[(2.0 * N[(N[(d * d), $MachinePrecision] * N[(c0 / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(c0 / N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(w * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \cdot d \leq 5 \cdot 10^{-284}:\\
\;\;\;\;\frac{c0}{2} \cdot \frac{0.5 \cdot \frac{\left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{h}{d} \cdot \frac{w}{d}\right)}{c0}}{w}\\
\mathbf{elif}\;d \cdot d \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0}{\frac{D \cdot D}{d} \cdot \frac{w \cdot h}{d}}\right)\\
\end{array}
\end{array}
if (*.f64 d d) < 4.99999999999999973e-284Initial program 4.0%
frac-times4.0%
frac-times4.1%
*-commutative4.1%
pow24.1%
Applied egg-rr4.1%
Taylor expanded in c0 around -inf 0.0%
Simplified0.1%
+-lft-identity0.1%
associate-*l/4.0%
*-commutative4.0%
times-frac7.9%
Applied egg-rr7.9%
times-frac7.9%
*-commutative7.9%
associate-*l/11.9%
times-frac32.8%
Simplified32.8%
if 4.99999999999999973e-284 < (*.f64 d d) < 1.9999999999999999e304Initial program 29.6%
Simplified30.0%
Taylor expanded in c0 around inf 43.2%
associate-/l*45.1%
unpow245.1%
unpow245.1%
Simplified45.1%
associate-/r/46.4%
associate-*l*54.2%
Applied egg-rr54.2%
if 1.9999999999999999e304 < (*.f64 d d) Initial program 24.2%
Simplified24.2%
Taylor expanded in c0 around inf 31.8%
associate-/l*31.8%
unpow231.8%
unpow231.8%
Simplified31.8%
Taylor expanded in D around 0 31.8%
unpow231.8%
associate-*r*34.9%
unpow234.9%
associate-/r*46.1%
associate-*r*43.1%
unpow243.1%
associate-*r/41.2%
associate-*l/40.2%
unpow240.2%
Simplified40.2%
Final simplification46.6%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))))
(if (<= w -4.1e+93)
(* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* h (* D D))))))
(if (<= w 1.3e-126)
(* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w))))
(if (or (<= w 2.2e-86) (not (<= w 5.9e+153)))
(* t_0 0.0)
(* c0 (* (* c0 (/ d (* D D))) (/ d (* h (* w w))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double tmp;
if (w <= -4.1e+93) {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
} else if (w <= 1.3e-126) {
tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
} else if ((w <= 2.2e-86) || !(w <= 5.9e+153)) {
tmp = t_0 * 0.0;
} else {
tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
}
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 (w <= (-4.1d+93)) then
tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * d)))))
else if (w <= 1.3d-126) then
tmp = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
else if ((w <= 2.2d-86) .or. (.not. (w <= 5.9d+153))) then
tmp = t_0 * 0.0d0
else
tmp = c0 * ((c0 * (d_1 / (d * d))) * (d_1 / (h * (w * w))))
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 (w <= -4.1e+93) {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
} else if (w <= 1.3e-126) {
tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
} else if ((w <= 2.2e-86) || !(w <= 5.9e+153)) {
tmp = t_0 * 0.0;
} else {
tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) tmp = 0 if w <= -4.1e+93: tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))) elif w <= 1.3e-126: tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))) elif (w <= 2.2e-86) or not (w <= 5.9e+153): tmp = t_0 * 0.0 else: tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (w <= -4.1e+93) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * Float64(D * D)))))); elseif (w <= 1.3e-126) tmp = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w)))); elseif ((w <= 2.2e-86) || !(w <= 5.9e+153)) tmp = Float64(t_0 * 0.0); else tmp = Float64(c0 * Float64(Float64(c0 * Float64(d / Float64(D * D))) * Float64(d / Float64(h * Float64(w * w))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); tmp = 0.0; if (w <= -4.1e+93) tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))); elseif (w <= 1.3e-126) tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))); elseif ((w <= 2.2e-86) || ~((w <= 5.9e+153))) tmp = t_0 * 0.0; else tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w)))); 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[w, -4.1e+93], N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 1.3e-126], N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, 2.2e-86], N[Not[LessEqual[w, 5.9e+153]], $MachinePrecision]], N[(t$95$0 * 0.0), $MachinePrecision], N[(c0 * N[(N[(c0 * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;w \leq -4.1 \cdot 10^{+93}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\
\mathbf{elif}\;w \leq 1.3 \cdot 10^{-126}:\\
\;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
\mathbf{elif}\;w \leq 2.2 \cdot 10^{-86} \lor \neg \left(w \leq 5.9 \cdot 10^{+153}\right):\\
\;\;\;\;t_0 \cdot 0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\
\end{array}
\end{array}
if w < -4.1000000000000001e93Initial program 24.6%
Simplified24.6%
Taylor expanded in c0 around inf 28.7%
associate-*r/28.7%
associate-*r*32.5%
*-commutative32.5%
unpow232.5%
*-commutative32.5%
associate-*r/32.5%
times-frac39.3%
unpow239.3%
unpow239.3%
*-commutative39.3%
unpow239.3%
Simplified39.3%
if -4.1000000000000001e93 < w < 1.3e-126Initial program 29.6%
Simplified30.4%
Taylor expanded in c0 around inf 29.7%
pow129.7%
pow229.7%
unpow229.7%
Applied egg-rr29.7%
unpow129.7%
associate-*l*35.4%
Simplified35.4%
pow235.4%
pow235.4%
times-frac39.4%
Applied egg-rr39.4%
associate-/l*42.2%
times-frac48.5%
unpow248.5%
associate-/r*49.1%
unpow249.1%
Simplified49.1%
if 1.3e-126 < w < 2.2000000000000002e-86 or 5.9000000000000002e153 < w Initial program 14.2%
Simplified12.2%
Taylor expanded in c0 around -inf 6.4%
mul-1-neg6.4%
distribute-lft-in6.4%
Simplified47.7%
if 2.2000000000000002e-86 < w < 5.9000000000000002e153Initial program 18.7%
Simplified18.9%
Taylor expanded in c0 around inf 36.3%
pow136.3%
pow236.3%
unpow236.3%
Applied egg-rr36.3%
unpow136.3%
associate-*l*38.5%
Simplified38.5%
pow238.5%
pow238.5%
associate-*r/34.8%
associate-*r*32.6%
associate-*l*35.0%
times-frac40.3%
Applied egg-rr40.3%
associate-*r*46.1%
Simplified46.1%
Final simplification47.2%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= c0 -1.2e-141)
(* (/ c0 (* 2.0 w)) (* 2.0 (* (* d d) (/ c0 (* D (* D (* w h)))))))
(if (<= c0 1.08e-163)
(* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
(if (or (<= c0 3e+50) (not (<= c0 6.5e+129)))
(* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w))))
(* -0.5 (/ (* c0 c0) (/ w 0.0)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (c0 <= -1.2e-141) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
} else if (c0 <= 1.08e-163) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if ((c0 <= 3e+50) || !(c0 <= 6.5e+129)) {
tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
} else {
tmp = -0.5 * ((c0 * c0) / (w / 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 (c0 <= (-1.2d-141)) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((d_1 * d_1) * (c0 / (d * (d * (w * h))))))
else if (c0 <= 1.08d-163) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else if ((c0 <= 3d+50) .or. (.not. (c0 <= 6.5d+129))) then
tmp = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
else
tmp = (-0.5d0) * ((c0 * c0) / (w / 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 (c0 <= -1.2e-141) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
} else if (c0 <= 1.08e-163) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if ((c0 <= 3e+50) || !(c0 <= 6.5e+129)) {
tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
} else {
tmp = -0.5 * ((c0 * c0) / (w / 0.0));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if c0 <= -1.2e-141: tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h)))))) elif c0 <= 1.08e-163: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) elif (c0 <= 3e+50) or not (c0 <= 6.5e+129): tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))) else: tmp = -0.5 * ((c0 * c0) / (w / 0.0)) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (c0 <= -1.2e-141) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(d * d) * Float64(c0 / Float64(D * Float64(D * Float64(w * h))))))); elseif (c0 <= 1.08e-163) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); elseif ((c0 <= 3e+50) || !(c0 <= 6.5e+129)) tmp = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w)))); else tmp = Float64(-0.5 * Float64(Float64(c0 * c0) / Float64(w / 0.0))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (c0 <= -1.2e-141) tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h)))))); elseif (c0 <= 1.08e-163) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); elseif ((c0 <= 3e+50) || ~((c0 <= 6.5e+129))) tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w))); else tmp = -0.5 * ((c0 * c0) / (w / 0.0)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[c0, -1.2e-141], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(d * d), $MachinePrecision] * N[(c0 / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 1.08e-163], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 3e+50], N[Not[LessEqual[c0, 6.5e+129]], $MachinePrecision]], N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(c0 * c0), $MachinePrecision] / N[(w / 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -1.2 \cdot 10^{-141}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\
\mathbf{elif}\;c0 \leq 1.08 \cdot 10^{-163}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{elif}\;c0 \leq 3 \cdot 10^{+50} \lor \neg \left(c0 \leq 6.5 \cdot 10^{+129}\right):\\
\;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c0 \cdot c0}{\frac{w}{0}}\\
\end{array}
\end{array}
if c0 < -1.2e-141Initial program 24.6%
Simplified23.7%
Taylor expanded in c0 around inf 36.8%
associate-/l*37.8%
unpow237.8%
unpow237.8%
Simplified37.8%
associate-/r/37.7%
associate-*l*44.6%
Applied egg-rr44.6%
if -1.2e-141 < c0 < 1.0800000000000001e-163Initial program 19.4%
frac-times17.7%
frac-times17.7%
*-commutative17.7%
pow217.7%
Applied egg-rr17.7%
Taylor expanded in c0 around -inf 2.5%
Simplified50.0%
Taylor expanded in c0 around 0 60.1%
associate-/l*60.1%
unpow260.1%
unpow260.1%
*-commutative60.1%
unpow260.1%
Simplified60.1%
if 1.0800000000000001e-163 < c0 < 2.9999999999999998e50 or 6.4999999999999995e129 < c0 Initial program 29.2%
Simplified30.3%
Taylor expanded in c0 around inf 32.4%
pow132.4%
pow232.4%
unpow232.4%
Applied egg-rr32.4%
unpow132.4%
associate-*l*38.0%
Simplified38.0%
pow238.0%
pow238.0%
times-frac40.8%
Applied egg-rr40.8%
associate-/l*41.8%
times-frac48.5%
unpow248.5%
associate-/r*48.4%
unpow248.4%
Simplified48.4%
if 2.9999999999999998e50 < c0 < 6.4999999999999995e129Initial program 18.5%
Simplified18.8%
Taylor expanded in c0 around -inf 5.0%
associate-/l*5.0%
unpow25.0%
distribute-lft1-in5.0%
metadata-eval5.0%
mul0-lft42.6%
Simplified42.6%
Final simplification48.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* c0 (* (* c0 (/ d (* D D))) (/ d (* h (* w w)))))))
(if (<= w -4.3e-99)
(* 0.25 (/ (* h (* (* D D) (* M M))) (* d d)))
(if (<= w 1.5e-217)
t_0
(if (<= w 2.5e-86)
(* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
(if (<= w 2.1e+139) t_0 (* (/ c0 (* 2.0 w)) 0.0)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
double tmp;
if (w <= -4.3e-99) {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
} else if (w <= 1.5e-217) {
tmp = t_0;
} else if (w <= 2.5e-86) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if (w <= 2.1e+139) {
tmp = t_0;
} else {
tmp = (c0 / (2.0 * w)) * 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 * ((c0 * (d_1 / (d * d))) * (d_1 / (h * (w * w))))
if (w <= (-4.3d-99)) then
tmp = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
else if (w <= 1.5d-217) then
tmp = t_0
else if (w <= 2.5d-86) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else if (w <= 2.1d+139) then
tmp = t_0
else
tmp = (c0 / (2.0d0 * w)) * 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 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
double tmp;
if (w <= -4.3e-99) {
tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
} else if (w <= 1.5e-217) {
tmp = t_0;
} else if (w <= 2.5e-86) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else if (w <= 2.1e+139) {
tmp = t_0;
} else {
tmp = (c0 / (2.0 * w)) * 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w)))) tmp = 0 if w <= -4.3e-99: tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)) elif w <= 1.5e-217: tmp = t_0 elif w <= 2.5e-86: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) elif w <= 2.1e+139: tmp = t_0 else: tmp = (c0 / (2.0 * w)) * 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 * Float64(Float64(c0 * Float64(d / Float64(D * D))) * Float64(d / Float64(h * Float64(w * w))))) tmp = 0.0 if (w <= -4.3e-99) tmp = Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d))); elseif (w <= 1.5e-217) tmp = t_0; elseif (w <= 2.5e-86) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); elseif (w <= 2.1e+139) tmp = t_0; else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w)))); tmp = 0.0; if (w <= -4.3e-99) tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)); elseif (w <= 1.5e-217) tmp = t_0; elseif (w <= 2.5e-86) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); elseif (w <= 2.1e+139) tmp = t_0; else tmp = (c0 / (2.0 * w)) * 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 * N[(N[(c0 * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -4.3e-99], N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 1.5e-217], t$95$0, If[LessEqual[w, 2.5e-86], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.1e+139], t$95$0, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\
\mathbf{if}\;w \leq -4.3 \cdot 10^{-99}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{elif}\;w \leq 1.5 \cdot 10^{-217}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq 2.5 \cdot 10^{-86}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{elif}\;w \leq 2.1 \cdot 10^{+139}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\
\end{array}
\end{array}
if w < -4.2999999999999999e-99Initial program 18.5%
frac-times18.5%
frac-times18.5%
*-commutative18.5%
pow218.5%
Applied egg-rr18.5%
Taylor expanded in c0 around -inf 6.1%
Simplified23.3%
Taylor expanded in c0 around 0 34.2%
associate-*r*36.0%
unpow236.0%
unpow236.0%
*-commutative36.0%
unpow236.0%
Simplified36.0%
if -4.2999999999999999e-99 < w < 1.50000000000000002e-217 or 2.4999999999999999e-86 < w < 2.0999999999999999e139Initial program 32.4%
Simplified33.2%
Taylor expanded in c0 around inf 37.6%
pow137.6%
pow237.6%
unpow237.6%
Applied egg-rr37.6%
unpow137.6%
associate-*l*41.6%
Simplified41.6%
pow241.6%
pow241.6%
associate-*r/43.4%
associate-*r*39.4%
associate-*l*44.1%
times-frac47.7%
Applied egg-rr47.7%
associate-*r*50.6%
Simplified50.6%
if 1.50000000000000002e-217 < w < 2.4999999999999999e-86Initial program 15.1%
frac-times15.2%
frac-times15.7%
*-commutative15.7%
pow215.7%
Applied egg-rr15.7%
Taylor expanded in c0 around -inf 0.1%
Simplified23.4%
Taylor expanded in c0 around 0 43.7%
associate-/l*43.7%
unpow243.7%
unpow243.7%
*-commutative43.7%
unpow243.7%
Simplified43.7%
if 2.0999999999999999e139 < w Initial program 15.8%
Simplified13.0%
Taylor expanded in c0 around -inf 8.9%
mul-1-neg8.9%
distribute-lft-in8.9%
Simplified42.3%
Final simplification45.1%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* d d) 7.8e+301) (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M))))) (* (/ c0 (* 2.0 w)) 0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d * d) <= 7.8e+301) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * 0.0;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((d_1 * d_1) <= 7.8d+301) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
else
tmp = (c0 / (2.0d0 * w)) * 0.0d0
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d * d) <= 7.8e+301) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = (c0 / (2.0 * w)) * 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d * d) <= 7.8e+301: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) else: tmp = (c0 / (2.0 * w)) * 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(d * d) <= 7.8e+301) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d * d) <= 7.8e+301) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); else tmp = (c0 / (2.0 * w)) * 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(d * d), $MachinePrecision], 7.8e+301], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \cdot d \leq 7.8 \cdot 10^{+301}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\
\end{array}
\end{array}
if (*.f64 d d) < 7.8000000000000003e301Initial program 25.7%
frac-times24.6%
frac-times24.6%
*-commutative24.6%
pow224.6%
Applied egg-rr24.6%
Taylor expanded in c0 around -inf 5.4%
Simplified17.4%
Taylor expanded in c0 around 0 37.0%
associate-/l*36.0%
unpow236.0%
unpow236.0%
*-commutative36.0%
unpow236.0%
Simplified36.0%
if 7.8000000000000003e301 < (*.f64 d d) Initial program 23.7%
Simplified23.8%
Taylor expanded in c0 around -inf 0.0%
mul-1-neg0.0%
distribute-lft-in0.0%
Simplified33.1%
Final simplification34.8%
(FPCore (c0 w h D d M) :precision binary64 (* 0.25 (/ (* h (* (* D D) (* M M))) (* d d))))
double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
}
def code(c0, w, h, D, d, M): return 0.25 * ((h * ((D * D) * (M * M))) / (d * d))
function code(c0, w, h, D, d, M) return Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d))) end
function tmp = code(c0, w, h, D, d, M) tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d)); end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}
\end{array}
Initial program 24.9%
frac-times24.2%
frac-times24.3%
*-commutative24.3%
pow224.3%
Applied egg-rr24.3%
Taylor expanded in c0 around -inf 3.3%
Simplified20.2%
Taylor expanded in c0 around 0 33.7%
associate-*r*33.7%
unpow233.7%
unpow233.7%
*-commutative33.7%
unpow233.7%
Simplified33.7%
Final simplification33.7%
(FPCore (c0 w h D d M) :precision binary64 (* (/ c0 (* 2.0 w)) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
return (c0 / (2.0 * w)) * 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 = (c0 / (2.0d0 * w)) * 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return (c0 / (2.0 * w)) * 0.0;
}
def code(c0, w, h, D, d, M): return (c0 / (2.0 * w)) * 0.0
function code(c0, w, h, D, d, M) return Float64(Float64(c0 / Float64(2.0 * w)) * 0.0) end
function tmp = code(c0, w, h, D, d, M) tmp = (c0 / (2.0 * w)) * 0.0; end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{c0}{2 \cdot w} \cdot 0
\end{array}
Initial program 24.9%
Simplified25.1%
Taylor expanded in c0 around -inf 2.6%
mul-1-neg2.6%
distribute-lft-in2.2%
Simplified25.0%
Final simplification25.0%
herbie shell --seed 2023280
(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))))))