
(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 13 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)) (* (* w h) (* D D)))))
(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)))))
(/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M))))))
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)) / ((w * h) * (D * D));
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 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
}
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)) / ((w * h) * (D * D));
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 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) 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 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) 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(w * h) * Float64(D * D))) 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(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))); 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)) / ((w * h) * (D * D)); 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 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); 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[(w * h), $MachinePrecision] * N[(D * D), $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[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $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(w \cdot h\right) \cdot \left(D \cdot D\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}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\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 72.9%
times-frac70.2%
fma-def68.9%
associate-/r*68.9%
difference-of-squares68.9%
Simplified71.0%
Taylor expanded in c0 around inf 72.1%
*-commutative72.1%
unpow272.1%
associate-/l/75.7%
associate-/r*77.0%
associate-/r*73.1%
unpow273.1%
associate-/l/71.9%
unpow271.9%
*-commutative71.9%
unpow271.9%
associate-*r*71.8%
*-commutative71.8%
Simplified71.8%
*-commutative71.8%
*-commutative71.8%
*-commutative71.8%
associate-*r*71.9%
times-frac71.8%
Applied egg-rr71.8%
unpow271.8%
unpow271.8%
associate-/r*71.7%
unpow271.7%
unpow271.7%
Simplified71.7%
Taylor expanded in c0 around 0 72.1%
times-frac75.6%
unpow275.6%
unpow275.6%
*-commutative75.6%
*-commutative75.6%
times-frac77.1%
unpow277.1%
Simplified77.1%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Taylor expanded in c0 around -inf 1.7%
fma-def1.7%
times-frac2.8%
unpow22.8%
unpow22.8%
*-commutative2.8%
unpow22.8%
associate-*r*2.8%
Simplified32.1%
Taylor expanded in c0 around 0 46.9%
associate-/l*46.5%
associate-*r/46.5%
unpow246.5%
associate-/r*44.4%
unpow244.4%
associate-/l*48.9%
unpow248.9%
Simplified48.9%
Final simplification57.2%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 1.6e-298)
(/ (* c0 (* 2.0 (/ (* c0 (/ (* d d) h)) (* w (* D D))))) (* 2.0 w))
(if (<= M 4.7e-194)
(* 0.25 (/ (* (* D D) (* h (* M M))) (* d d)))
(if (or (<= M 6.8e-95) (not (<= M 9.5e+59)))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 w) (/ (pow (/ d D) 2.0) h))))
(/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 1.6e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if (M <= 4.7e-194) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else if ((M <= 6.8e-95) || !(M <= 9.5e+59)) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (pow((d / D), 2.0) / h)));
} else {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (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 (m <= 1.6d-298) then
tmp = (c0 * (2.0d0 * ((c0 * ((d_1 * d_1) / h)) / (w * (d * d))))) / (2.0d0 * w)
else if (m <= 4.7d-194) then
tmp = 0.25d0 * (((d * d) * (h * (m * m))) / (d_1 * d_1))
else if ((m <= 6.8d-95) .or. (.not. (m <= 9.5d+59))) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / w) * (((d_1 / d) ** 2.0d0) / h)))
else
tmp = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (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 (M <= 1.6e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if (M <= 4.7e-194) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else if ((M <= 6.8e-95) || !(M <= 9.5e+59)) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (Math.pow((d / D), 2.0) / h)));
} else {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 1.6e-298: tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w) elif M <= 4.7e-194: tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)) elif (M <= 6.8e-95) or not (M <= 9.5e+59): tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (math.pow((d / D), 2.0) / h))) else: tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 1.6e-298) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(c0 * Float64(Float64(d * d) / h)) / Float64(w * Float64(D * D))))) / Float64(2.0 * w)); elseif (M <= 4.7e-194) tmp = Float64(0.25 * Float64(Float64(Float64(D * D) * Float64(h * Float64(M * M))) / Float64(d * d))); elseif ((M <= 6.8e-95) || !(M <= 9.5e+59)) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / w) * Float64((Float64(d / D) ^ 2.0) / h)))); else tmp = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 1.6e-298) tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w); elseif (M <= 4.7e-194) tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)); elseif ((M <= 6.8e-95) || ~((M <= 9.5e+59))) tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (((d / D) ^ 2.0) / h))); else tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 1.6e-298], N[(N[(c0 * N[(2.0 * N[(N[(c0 * N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 4.7e-194], N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[M, 6.8e-95], N[Not[LessEqual[M, 9.5e+59]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.6 \cdot 10^{-298}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\
\mathbf{elif}\;M \leq 4.7 \cdot 10^{-194}:\\
\;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{elif}\;M \leq 6.8 \cdot 10^{-95} \lor \neg \left(M \leq 9.5 \cdot 10^{+59}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\end{array}
\end{array}
if M < 1.59999999999999999e-298Initial program 24.5%
times-frac23.7%
fma-def23.0%
associate-/r*23.0%
difference-of-squares25.3%
Simplified31.7%
Taylor expanded in c0 around inf 28.4%
*-commutative28.4%
unpow228.4%
associate-/l/30.1%
associate-/r*31.7%
associate-/r*31.0%
unpow231.0%
associate-/l/30.7%
unpow230.7%
*-commutative30.7%
unpow230.7%
associate-*r*32.1%
*-commutative32.1%
Simplified32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
associate-*r*30.7%
times-frac31.8%
Applied egg-rr31.8%
unpow231.8%
unpow231.8%
associate-/r*30.3%
unpow230.3%
unpow230.3%
Simplified30.3%
associate-*l/30.3%
*-commutative30.3%
frac-times30.4%
*-commutative30.4%
Applied egg-rr30.4%
if 1.59999999999999999e-298 < M < 4.7000000000000003e-194Initial program 21.2%
Taylor expanded in c0 around -inf 10.2%
fma-def10.2%
times-frac10.2%
unpow210.2%
unpow210.2%
*-commutative10.2%
unpow210.2%
associate-*r*10.2%
Simplified50.4%
Taylor expanded in c0 around 0 60.9%
*-commutative60.9%
unpow260.9%
*-commutative60.9%
unpow260.9%
unpow260.9%
Simplified60.9%
if 4.7000000000000003e-194 < M < 6.79999999999999986e-95 or 9.50000000000000023e59 < M Initial program 18.6%
times-frac18.7%
fma-def18.6%
associate-/r*18.6%
difference-of-squares32.5%
Simplified37.8%
Taylor expanded in c0 around inf 36.4%
*-commutative36.4%
unpow236.4%
associate-/l/37.8%
associate-/r*37.9%
associate-/r*36.1%
unpow236.1%
associate-/l/33.1%
unpow233.1%
*-commutative33.1%
unpow233.1%
associate-*r*33.1%
*-commutative33.1%
Simplified33.1%
*-commutative33.1%
*-commutative33.1%
*-commutative33.1%
associate-*r*33.1%
times-frac36.1%
Applied egg-rr36.1%
unpow236.1%
unpow236.1%
associate-/r*38.8%
unpow238.8%
unpow238.8%
Simplified38.8%
Taylor expanded in d around 0 36.1%
associate-/r*38.7%
unpow238.7%
unpow238.7%
times-frac46.7%
unpow246.7%
Simplified46.7%
if 6.79999999999999986e-95 < M < 9.50000000000000023e59Initial program 16.8%
Taylor expanded in c0 around -inf 2.9%
fma-def2.9%
times-frac2.9%
unpow22.9%
unpow22.9%
*-commutative2.9%
unpow22.9%
associate-*r*2.9%
Simplified42.3%
Taylor expanded in c0 around 0 50.7%
associate-/l*55.9%
associate-*r/55.9%
unpow255.9%
associate-/r*53.3%
unpow253.3%
associate-/l*53.3%
unpow253.3%
Simplified53.3%
Final simplification40.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M)))))
(if (<= M 1.6e-298)
(/ (* c0 (* 2.0 (/ (* c0 (/ (* d d) h)) (* w (* D D))))) (* 2.0 w))
(if (<= M 1.75e-133)
t_0
(if (<= M 1.5e-123)
(* (pow (/ d D) 2.0) (/ (* c0 c0) (* h (* w w))))
(if (<= M 1.9e+60)
t_0
(*
(/ c0 (* 2.0 w))
(* 2.0 (* (* d (* c0 d)) (/ 1.0 (* w (* h (* D D)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
double tmp;
if (M <= 1.6e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if (M <= 1.75e-133) {
tmp = t_0;
} else if (M <= 1.5e-123) {
tmp = pow((d / D), 2.0) * ((c0 * c0) / (h * (w * w)));
} else if (M <= 1.9e+60) {
tmp = t_0;
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (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 = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
if (m <= 1.6d-298) then
tmp = (c0 * (2.0d0 * ((c0 * ((d_1 * d_1) / h)) / (w * (d * d))))) / (2.0d0 * w)
else if (m <= 1.75d-133) then
tmp = t_0
else if (m <= 1.5d-123) then
tmp = ((d_1 / d) ** 2.0d0) * ((c0 * c0) / (h * (w * w)))
else if (m <= 1.9d+60) then
tmp = t_0
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((d_1 * (c0 * d_1)) * (1.0d0 / (w * (h * (d * 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 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
double tmp;
if (M <= 1.6e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if (M <= 1.75e-133) {
tmp = t_0;
} else if (M <= 1.5e-123) {
tmp = Math.pow((d / D), 2.0) * ((c0 * c0) / (h * (w * w)));
} else if (M <= 1.9e+60) {
tmp = t_0;
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (w * (h * (D * D))))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) tmp = 0 if M <= 1.6e-298: tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w) elif M <= 1.75e-133: tmp = t_0 elif M <= 1.5e-123: tmp = math.pow((d / D), 2.0) * ((c0 * c0) / (h * (w * w))) elif M <= 1.9e+60: tmp = t_0 else: tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (w * (h * (D * D)))))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))) tmp = 0.0 if (M <= 1.6e-298) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(c0 * Float64(Float64(d * d) / h)) / Float64(w * Float64(D * D))))) / Float64(2.0 * w)); elseif (M <= 1.75e-133) tmp = t_0; elseif (M <= 1.5e-123) tmp = Float64((Float64(d / D) ^ 2.0) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))); elseif (M <= 1.9e+60) tmp = t_0; else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(d * Float64(c0 * d)) * Float64(1.0 / Float64(w * Float64(h * Float64(D * D))))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); tmp = 0.0; if (M <= 1.6e-298) tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w); elseif (M <= 1.75e-133) tmp = t_0; elseif (M <= 1.5e-123) tmp = ((d / D) ^ 2.0) * ((c0 * c0) / (h * (w * w))); elseif (M <= 1.9e+60) tmp = t_0; else tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (w * (h * (D * D)))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 1.6e-298], N[(N[(c0 * N[(2.0 * N[(N[(c0 * N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.75e-133], t$95$0, If[LessEqual[M, 1.5e-123], N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.9e+60], t$95$0, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(w * N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{if}\;M \leq 1.6 \cdot 10^{-298}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\
\mathbf{elif}\;M \leq 1.75 \cdot 10^{-133}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;M \leq 1.5 \cdot 10^{-123}:\\
\;\;\;\;{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\mathbf{elif}\;M \leq 1.9 \cdot 10^{+60}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot \left(c0 \cdot d\right)\right) \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right)\right)\\
\end{array}
\end{array}
if M < 1.59999999999999999e-298Initial program 24.5%
times-frac23.7%
fma-def23.0%
associate-/r*23.0%
difference-of-squares25.3%
Simplified31.7%
Taylor expanded in c0 around inf 28.4%
*-commutative28.4%
unpow228.4%
associate-/l/30.1%
associate-/r*31.7%
associate-/r*31.0%
unpow231.0%
associate-/l/30.7%
unpow230.7%
*-commutative30.7%
unpow230.7%
associate-*r*32.1%
*-commutative32.1%
Simplified32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
associate-*r*30.7%
times-frac31.8%
Applied egg-rr31.8%
unpow231.8%
unpow231.8%
associate-/r*30.3%
unpow230.3%
unpow230.3%
Simplified30.3%
associate-*l/30.3%
*-commutative30.3%
frac-times30.4%
*-commutative30.4%
Applied egg-rr30.4%
if 1.59999999999999999e-298 < M < 1.75000000000000001e-133 or 1.49999999999999992e-123 < M < 1.90000000000000005e60Initial program 18.7%
Taylor expanded in c0 around -inf 5.9%
fma-def5.9%
times-frac5.9%
unpow25.9%
unpow25.9%
*-commutative5.9%
unpow25.9%
associate-*r*5.9%
Simplified42.4%
Taylor expanded in c0 around 0 52.3%
associate-/l*55.3%
associate-*r/55.3%
unpow255.3%
associate-/r*52.4%
unpow252.4%
associate-/l*53.8%
unpow253.8%
Simplified53.8%
if 1.75000000000000001e-133 < M < 1.49999999999999992e-123Initial program 50.0%
times-frac50.0%
fma-def50.0%
associate-/r*50.0%
difference-of-squares50.0%
Simplified50.4%
Taylor expanded in c0 around inf 63.2%
*-commutative63.2%
unpow263.2%
associate-/l/63.2%
associate-/r*51.2%
associate-/r*51.2%
unpow251.2%
associate-/l/51.2%
unpow251.2%
*-commutative51.2%
unpow251.2%
associate-*r*51.2%
*-commutative51.2%
Simplified51.2%
*-commutative51.2%
*-commutative51.2%
*-commutative51.2%
associate-*r*51.2%
times-frac51.2%
Applied egg-rr51.2%
unpow251.2%
unpow251.2%
associate-/r*51.2%
unpow251.2%
unpow251.2%
Simplified51.2%
Taylor expanded in c0 around 0 38.2%
times-frac38.2%
unpow238.2%
unpow238.2%
times-frac62.7%
unpow262.7%
unpow262.7%
*-commutative62.7%
unpow262.7%
Simplified62.7%
if 1.90000000000000005e60 < M Initial program 12.1%
times-frac12.1%
fma-def12.1%
associate-/r*12.1%
difference-of-squares33.9%
Simplified36.3%
Taylor expanded in c0 around inf 37.1%
*-commutative37.1%
unpow237.1%
associate-/l/37.1%
associate-/r*39.5%
associate-/r*39.5%
unpow239.5%
associate-/l/37.0%
unpow237.0%
*-commutative37.0%
unpow237.0%
associate-*r*37.0%
*-commutative37.0%
Simplified37.0%
div-inv37.0%
associate-*l*41.9%
*-commutative41.9%
*-commutative41.9%
associate-*r*41.9%
Applied egg-rr41.9%
Final simplification39.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M)))))
(if (<= (* M M) 3e-266)
t_1
(if (<= (* M M) 4.3e-246)
(* t_0 (* 2.0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* M M) 8.8e+120)
t_1
(* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* 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 t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
double tmp;
if ((M * M) <= 3e-266) {
tmp = t_1;
} else if ((M * M) <= 4.3e-246) {
tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
} else if ((M * M) <= 8.8e+120) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (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) :: t_1
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
if ((m * m) <= 3d-266) then
tmp = t_1
else if ((m * m) <= 4.3d-246) then
tmp = t_0 * (2.0d0 * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d))))
else if ((m * m) <= 8.8d+120) then
tmp = t_1
else
tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * 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 t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
double tmp;
if ((M * M) <= 3e-266) {
tmp = t_1;
} else if ((M * M) <= 4.3e-246) {
tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
} else if ((M * M) <= 8.8e+120) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) tmp = 0 if (M * M) <= 3e-266: tmp = t_1 elif (M * M) <= 4.3e-246: tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D)))) elif (M * M) <= 8.8e+120: tmp = t_1 else: tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))) tmp = 0.0 if (Float64(M * M) <= 3e-266) tmp = t_1; elseif (Float64(M * M) <= 4.3e-246) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))))); elseif (Float64(M * M) <= 8.8e+120) tmp = t_1; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * 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 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); tmp = 0.0; if ((M * M) <= 3e-266) tmp = t_1; elseif ((M * M) <= 4.3e-246) tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D)))); elseif ((M * M) <= 8.8e+120) tmp = t_1; else tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (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]}, Block[{t$95$1 = N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 3e-266], t$95$1, If[LessEqual[N[(M * M), $MachinePrecision], 4.3e-246], N[(t$95$0 * N[(2.0 * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 8.8e+120], t$95$1, 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]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{if}\;M \cdot M \leq 3 \cdot 10^{-266}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;M \cdot M \leq 4.3 \cdot 10^{-246}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\\
\mathbf{elif}\;M \cdot M \leq 8.8 \cdot 10^{+120}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 3e-266 or 4.29999999999999992e-246 < (*.f64 M M) < 8.8000000000000005e120Initial program 21.9%
Taylor expanded in c0 around -inf 5.0%
fma-def5.0%
times-frac5.6%
unpow25.6%
unpow25.6%
*-commutative5.6%
unpow25.6%
associate-*r*5.6%
Simplified34.2%
Taylor expanded in c0 around 0 47.5%
associate-/l*47.8%
associate-*r/47.8%
unpow247.8%
associate-/r*45.5%
unpow245.5%
associate-/l*49.5%
unpow249.5%
Simplified49.5%
if 3e-266 < (*.f64 M M) < 4.29999999999999992e-246Initial program 50.2%
times-frac50.1%
fma-def50.2%
associate-/r*50.2%
difference-of-squares50.2%
Simplified50.4%
Taylor expanded in c0 around inf 59.0%
*-commutative59.0%
unpow259.0%
associate-/l/58.8%
associate-/r*50.8%
associate-/r*51.0%
unpow251.0%
associate-/l/51.0%
unpow251.0%
*-commutative51.0%
unpow251.0%
associate-*r*50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in D around 0 59.0%
unpow259.0%
Simplified59.0%
if 8.8000000000000005e120 < (*.f64 M M) Initial program 16.1%
times-frac16.1%
fma-def16.1%
associate-/r*16.2%
difference-of-squares34.0%
Simplified37.8%
Taylor expanded in c0 around inf 41.2%
*-commutative41.2%
unpow241.2%
associate-/l/41.8%
associate-/r*44.7%
associate-/r*44.7%
unpow244.7%
associate-/l/42.7%
unpow242.7%
*-commutative42.7%
unpow242.7%
associate-*r*42.7%
*-commutative42.7%
Simplified42.7%
times-frac44.9%
*-commutative44.9%
associate-*r*44.8%
Applied egg-rr44.8%
Final simplification48.7%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 2.05e-298)
(/ (* c0 (* 2.0 (/ (* c0 (/ (* d d) h)) (* w (* D D))))) (* 2.0 w))
(if (or (<= M 2.3e-134) (and (not (<= M 1.7e-123)) (<= M 6.5e+60)))
(/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M)))
(*
(/ c0 (* 2.0 w))
(* 2.0 (* (* d (* c0 d)) (/ 1.0 (* w (* h (* D D))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 2.05e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if ((M <= 2.3e-134) || (!(M <= 1.7e-123) && (M <= 6.5e+60))) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (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) :: tmp
if (m <= 2.05d-298) then
tmp = (c0 * (2.0d0 * ((c0 * ((d_1 * d_1) / h)) / (w * (d * d))))) / (2.0d0 * w)
else if ((m <= 2.3d-134) .or. (.not. (m <= 1.7d-123)) .and. (m <= 6.5d+60)) then
tmp = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((d_1 * (c0 * d_1)) * (1.0d0 / (w * (h * (d * d))))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 2.05e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if ((M <= 2.3e-134) || (!(M <= 1.7e-123) && (M <= 6.5e+60))) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (w * (h * (D * D))))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 2.05e-298: tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w) elif (M <= 2.3e-134) or (not (M <= 1.7e-123) and (M <= 6.5e+60)): tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) else: tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (w * (h * (D * D)))))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 2.05e-298) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(c0 * Float64(Float64(d * d) / h)) / Float64(w * Float64(D * D))))) / Float64(2.0 * w)); elseif ((M <= 2.3e-134) || (!(M <= 1.7e-123) && (M <= 6.5e+60))) tmp = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(d * Float64(c0 * d)) * Float64(1.0 / Float64(w * Float64(h * Float64(D * D))))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 2.05e-298) tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w); elseif ((M <= 2.3e-134) || (~((M <= 1.7e-123)) && (M <= 6.5e+60))) tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); else tmp = (c0 / (2.0 * w)) * (2.0 * ((d * (c0 * d)) * (1.0 / (w * (h * (D * D)))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 2.05e-298], N[(N[(c0 * N[(2.0 * N[(N[(c0 * N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[M, 2.3e-134], And[N[Not[LessEqual[M, 1.7e-123]], $MachinePrecision], LessEqual[M, 6.5e+60]]], N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(w * N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.05 \cdot 10^{-298}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\
\mathbf{elif}\;M \leq 2.3 \cdot 10^{-134} \lor \neg \left(M \leq 1.7 \cdot 10^{-123}\right) \land M \leq 6.5 \cdot 10^{+60}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot \left(c0 \cdot d\right)\right) \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right)\right)\\
\end{array}
\end{array}
if M < 2.0499999999999999e-298Initial program 24.5%
times-frac23.7%
fma-def23.0%
associate-/r*23.0%
difference-of-squares25.3%
Simplified31.7%
Taylor expanded in c0 around inf 28.4%
*-commutative28.4%
unpow228.4%
associate-/l/30.1%
associate-/r*31.7%
associate-/r*31.0%
unpow231.0%
associate-/l/30.7%
unpow230.7%
*-commutative30.7%
unpow230.7%
associate-*r*32.1%
*-commutative32.1%
Simplified32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
associate-*r*30.7%
times-frac31.8%
Applied egg-rr31.8%
unpow231.8%
unpow231.8%
associate-/r*30.3%
unpow230.3%
unpow230.3%
Simplified30.3%
associate-*l/30.3%
*-commutative30.3%
frac-times30.4%
*-commutative30.4%
Applied egg-rr30.4%
if 2.0499999999999999e-298 < M < 2.3e-134 or 1.7e-123 < M < 6.49999999999999931e60Initial program 18.7%
Taylor expanded in c0 around -inf 5.9%
fma-def5.9%
times-frac5.9%
unpow25.9%
unpow25.9%
*-commutative5.9%
unpow25.9%
associate-*r*5.9%
Simplified42.4%
Taylor expanded in c0 around 0 52.3%
associate-/l*55.3%
associate-*r/55.3%
unpow255.3%
associate-/r*52.4%
unpow252.4%
associate-/l*53.8%
unpow253.8%
Simplified53.8%
if 2.3e-134 < M < 1.7e-123 or 6.49999999999999931e60 < M Initial program 18.1%
times-frac18.1%
fma-def18.2%
associate-/r*18.2%
difference-of-squares36.5%
Simplified38.5%
Taylor expanded in c0 around inf 41.2%
*-commutative41.2%
unpow241.2%
associate-/l/41.3%
associate-/r*41.4%
associate-/r*41.4%
unpow241.4%
associate-/l/39.3%
unpow239.3%
*-commutative39.3%
unpow239.3%
associate-*r*39.3%
*-commutative39.3%
Simplified39.3%
div-inv39.3%
associate-*l*45.2%
*-commutative45.2%
*-commutative45.2%
associate-*r*45.2%
Applied egg-rr45.2%
Final simplification39.8%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M)))))
(if (<= M 2e-298)
(/ (* c0 (* 2.0 (/ (* c0 (/ (* d d) h)) (* w (* D D))))) (* 2.0 w))
(if (<= M 1.72e-133)
t_1
(if (<= M 1.5e-123)
(* t_0 (* 2.0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= M 4.6e+60)
t_1
(* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* 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 t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
double tmp;
if (M <= 2e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if (M <= 1.72e-133) {
tmp = t_1;
} else if (M <= 1.5e-123) {
tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
} else if (M <= 4.6e+60) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (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) :: t_1
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
if (m <= 2d-298) then
tmp = (c0 * (2.0d0 * ((c0 * ((d_1 * d_1) / h)) / (w * (d * d))))) / (2.0d0 * w)
else if (m <= 1.72d-133) then
tmp = t_1
else if (m <= 1.5d-123) then
tmp = t_0 * (2.0d0 * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d))))
else if (m <= 4.6d+60) then
tmp = t_1
else
tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * 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 t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
double tmp;
if (M <= 2e-298) {
tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
} else if (M <= 1.72e-133) {
tmp = t_1;
} else if (M <= 1.5e-123) {
tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
} else if (M <= 4.6e+60) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) tmp = 0 if M <= 2e-298: tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w) elif M <= 1.72e-133: tmp = t_1 elif M <= 1.5e-123: tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D)))) elif M <= 4.6e+60: tmp = t_1 else: tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))) tmp = 0.0 if (M <= 2e-298) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(c0 * Float64(Float64(d * d) / h)) / Float64(w * Float64(D * D))))) / Float64(2.0 * w)); elseif (M <= 1.72e-133) tmp = t_1; elseif (M <= 1.5e-123) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))))); elseif (M <= 4.6e+60) tmp = t_1; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * 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 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); tmp = 0.0; if (M <= 2e-298) tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w); elseif (M <= 1.72e-133) tmp = t_1; elseif (M <= 1.5e-123) tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D)))); elseif (M <= 4.6e+60) tmp = t_1; else tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (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]}, Block[{t$95$1 = N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2e-298], N[(N[(c0 * N[(2.0 * N[(N[(c0 * N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.72e-133], t$95$1, If[LessEqual[M, 1.5e-123], N[(t$95$0 * N[(2.0 * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 4.6e+60], t$95$1, 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]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{if}\;M \leq 2 \cdot 10^{-298}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\
\mathbf{elif}\;M \leq 1.72 \cdot 10^{-133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;M \leq 1.5 \cdot 10^{-123}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\\
\mathbf{elif}\;M \leq 4.6 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\
\end{array}
\end{array}
if M < 1.99999999999999982e-298Initial program 24.5%
times-frac23.7%
fma-def23.0%
associate-/r*23.0%
difference-of-squares25.3%
Simplified31.7%
Taylor expanded in c0 around inf 28.4%
*-commutative28.4%
unpow228.4%
associate-/l/30.1%
associate-/r*31.7%
associate-/r*31.0%
unpow231.0%
associate-/l/30.7%
unpow230.7%
*-commutative30.7%
unpow230.7%
associate-*r*32.1%
*-commutative32.1%
Simplified32.1%
*-commutative32.1%
*-commutative32.1%
*-commutative32.1%
associate-*r*30.7%
times-frac31.8%
Applied egg-rr31.8%
unpow231.8%
unpow231.8%
associate-/r*30.3%
unpow230.3%
unpow230.3%
Simplified30.3%
associate-*l/30.3%
*-commutative30.3%
frac-times30.4%
*-commutative30.4%
Applied egg-rr30.4%
if 1.99999999999999982e-298 < M < 1.71999999999999995e-133 or 1.49999999999999992e-123 < M < 4.60000000000000034e60Initial program 18.7%
Taylor expanded in c0 around -inf 5.9%
fma-def5.9%
times-frac5.9%
unpow25.9%
unpow25.9%
*-commutative5.9%
unpow25.9%
associate-*r*5.9%
Simplified42.4%
Taylor expanded in c0 around 0 52.3%
associate-/l*55.3%
associate-*r/55.3%
unpow255.3%
associate-/r*52.4%
unpow252.4%
associate-/l*53.8%
unpow253.8%
Simplified53.8%
if 1.71999999999999995e-133 < M < 1.49999999999999992e-123Initial program 50.0%
times-frac50.0%
fma-def50.0%
associate-/r*50.0%
difference-of-squares50.0%
Simplified50.4%
Taylor expanded in c0 around inf 63.2%
*-commutative63.2%
unpow263.2%
associate-/l/63.2%
associate-/r*51.2%
associate-/r*51.2%
unpow251.2%
associate-/l/51.2%
unpow251.2%
*-commutative51.2%
unpow251.2%
associate-*r*51.2%
*-commutative51.2%
Simplified51.2%
Taylor expanded in D around 0 63.2%
unpow263.2%
Simplified63.2%
if 4.60000000000000034e60 < M Initial program 12.1%
times-frac12.1%
fma-def12.1%
associate-/r*12.1%
difference-of-squares33.9%
Simplified36.3%
Taylor expanded in c0 around inf 37.1%
*-commutative37.1%
unpow237.1%
associate-/l/37.1%
associate-/r*39.5%
associate-/r*39.5%
unpow239.5%
associate-/l/37.0%
unpow237.0%
*-commutative37.0%
unpow237.0%
associate-*r*37.0%
*-commutative37.0%
Simplified37.0%
times-frac39.7%
*-commutative39.7%
associate-*r*39.5%
Applied egg-rr39.5%
Final simplification39.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ d (/ h d))))
(if (<= (* M M) 8.6e+120)
(/ (* (* D D) 0.25) (/ t_0 (* M M)))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 w) (/ t_0 (* D D))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = d / (h / d);
double tmp;
if ((M * M) <= 8.6e+120) {
tmp = ((D * D) * 0.25) / (t_0 / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (t_0 / (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 = d_1 / (h / d_1)
if ((m * m) <= 8.6d+120) then
tmp = ((d * d) * 0.25d0) / (t_0 / (m * m))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / w) * (t_0 / (d * 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 = d / (h / d);
double tmp;
if ((M * M) <= 8.6e+120) {
tmp = ((D * D) * 0.25) / (t_0 / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (t_0 / (D * D))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = d / (h / d) tmp = 0 if (M * M) <= 8.6e+120: tmp = ((D * D) * 0.25) / (t_0 / (M * M)) else: tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (t_0 / (D * D)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / Float64(h / d)) tmp = 0.0 if (Float64(M * M) <= 8.6e+120) tmp = Float64(Float64(Float64(D * D) * 0.25) / Float64(t_0 / Float64(M * M))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / w) * Float64(t_0 / Float64(D * D))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = d / (h / d); tmp = 0.0; if ((M * M) <= 8.6e+120) tmp = ((D * D) * 0.25) / (t_0 / (M * M)); else tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * (t_0 / (D * D)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 8.6e+120], N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(t$95$0 / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(t$95$0 / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\frac{h}{d}}\\
\mathbf{if}\;M \cdot M \leq 8.6 \cdot 10^{+120}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{t_0}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{t_0}{D \cdot D}\right)\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 8.6000000000000003e120Initial program 23.7%
Taylor expanded in c0 around -inf 5.3%
fma-def5.3%
times-frac5.9%
unpow25.9%
unpow25.9%
*-commutative5.9%
unpow25.9%
associate-*r*5.9%
Simplified32.6%
Taylor expanded in c0 around 0 45.6%
associate-/l*45.9%
associate-*r/45.9%
unpow245.9%
associate-/r*43.8%
unpow243.8%
associate-/l*47.5%
unpow247.5%
Simplified47.5%
if 8.6000000000000003e120 < (*.f64 M M) Initial program 16.1%
times-frac16.1%
fma-def16.1%
associate-/r*16.2%
difference-of-squares34.0%
Simplified37.8%
Taylor expanded in c0 around inf 41.2%
*-commutative41.2%
unpow241.2%
associate-/l/41.8%
associate-/r*44.7%
associate-/r*44.7%
unpow244.7%
associate-/l/42.7%
unpow242.7%
*-commutative42.7%
unpow242.7%
associate-*r*42.7%
*-commutative42.7%
Simplified42.7%
*-commutative42.7%
*-commutative42.7%
*-commutative42.7%
associate-*r*42.7%
times-frac44.8%
Applied egg-rr44.8%
unpow244.8%
unpow244.8%
associate-/r*40.4%
unpow240.4%
unpow240.4%
Simplified40.4%
Taylor expanded in d around 0 40.4%
unpow240.4%
associate-/l*40.4%
Simplified40.4%
Final simplification45.6%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* M M) 2.95e+121) (/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M))) (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ (* d d) (* D D)) (/ c0 (* w h)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 2.95e+121) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((m * m) <= 2.95d+121) then
tmp = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 * d_1) / (d * d)) * (c0 / (w * h))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 2.95e+121) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 2.95e+121: tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) else: tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h)))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 2.95e+121) tmp = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(c0 / Float64(w * h))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 2.95e+121) tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); else tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 2.95e+121], N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 2.95 \cdot 10^{+121}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{c0}{w \cdot h}\right)\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 2.95000000000000007e121Initial program 23.7%
Taylor expanded in c0 around -inf 5.3%
fma-def5.3%
times-frac5.9%
unpow25.9%
unpow25.9%
*-commutative5.9%
unpow25.9%
associate-*r*5.9%
Simplified32.6%
Taylor expanded in c0 around 0 45.6%
associate-/l*45.9%
associate-*r/45.9%
unpow245.9%
associate-/r*43.8%
unpow243.8%
associate-/l*47.5%
unpow247.5%
Simplified47.5%
if 2.95000000000000007e121 < (*.f64 M M) Initial program 16.1%
times-frac16.1%
fma-def16.1%
associate-/r*16.2%
difference-of-squares34.0%
Simplified37.8%
Applied egg-rr0.0%
unpow20.0%
associate--r-0.1%
+-inverses3.4%
unpow23.4%
associate-*l/3.4%
times-frac3.4%
Simplified4.8%
Taylor expanded in M around 0 41.2%
times-frac41.8%
unpow241.8%
unpow241.8%
Simplified41.8%
Final simplification46.0%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* M M) 7e+120) (/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M))) (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 w) (/ (* d d) (* h (* D D))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 7e+120) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (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) :: tmp
if ((m * m) <= 7d+120) then
tmp = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * d)))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 7e+120) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 7e+120: tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) else: tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 7e+120) tmp = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * Float64(D * D)))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 7e+120) tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); else tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 7e+120], N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 7 \cdot 10^{+120}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 7.00000000000000015e120Initial program 23.7%
Taylor expanded in c0 around -inf 5.3%
fma-def5.3%
times-frac5.9%
unpow25.9%
unpow25.9%
*-commutative5.9%
unpow25.9%
associate-*r*5.9%
Simplified32.6%
Taylor expanded in c0 around 0 45.6%
associate-/l*45.9%
associate-*r/45.9%
unpow245.9%
associate-/r*43.8%
unpow243.8%
associate-/l*47.5%
unpow247.5%
Simplified47.5%
if 7.00000000000000015e120 < (*.f64 M M) Initial program 16.1%
times-frac16.1%
fma-def16.1%
associate-/r*16.2%
difference-of-squares34.0%
Simplified37.8%
Taylor expanded in c0 around inf 41.2%
*-commutative41.2%
unpow241.2%
associate-/l/41.8%
associate-/r*44.7%
associate-/r*44.7%
unpow244.7%
associate-/l/42.7%
unpow242.7%
*-commutative42.7%
unpow242.7%
associate-*r*42.7%
*-commutative42.7%
Simplified42.7%
times-frac44.9%
*-commutative44.9%
associate-*r*44.8%
Applied egg-rr44.8%
Final simplification46.8%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* M M) 1.85e+133) (/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M))) (* (/ (* c0 c0) (* h (* w w))) (/ (* d d) (* D D)))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1.85e+133) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = ((c0 * c0) / (h * (w * w))) * ((d * d) / (D * D));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((m * m) <= 1.85d+133) then
tmp = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
else
tmp = ((c0 * c0) / (h * (w * w))) * ((d_1 * d_1) / (d * d))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1.85e+133) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = ((c0 * c0) / (h * (w * w))) * ((d * d) / (D * D));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 1.85e+133: tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) else: tmp = ((c0 * c0) / (h * (w * w))) * ((d * d) / (D * D)) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 1.85e+133) tmp = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))); else tmp = Float64(Float64(Float64(c0 * c0) / Float64(h * Float64(w * w))) * Float64(Float64(d * d) / Float64(D * D))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 1.85e+133) tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); else tmp = ((c0 * c0) / (h * (w * w))) * ((d * d) / (D * D)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1.85e+133], N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 1.85 \cdot 10^{+133}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \cdot \frac{d \cdot d}{D \cdot D}\\
\end{array}
\end{array}
if (*.f64 M M) < 1.85000000000000012e133Initial program 23.6%
Taylor expanded in c0 around -inf 5.3%
fma-def5.3%
times-frac5.9%
unpow25.9%
unpow25.9%
*-commutative5.9%
unpow25.9%
associate-*r*5.9%
Simplified32.4%
Taylor expanded in c0 around 0 45.4%
associate-/l*45.7%
associate-*r/45.7%
unpow245.7%
associate-/r*43.6%
unpow243.6%
associate-/l*47.3%
unpow247.3%
Simplified47.3%
if 1.85000000000000012e133 < (*.f64 M M) Initial program 16.3%
times-frac16.3%
fma-def16.3%
associate-/r*16.4%
difference-of-squares34.4%
Simplified38.3%
Taylor expanded in c0 around inf 34.5%
times-frac33.1%
unpow233.1%
unpow233.1%
unpow233.1%
*-commutative33.1%
unpow233.1%
Simplified33.1%
Final simplification43.5%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= c0 -4.8e+74) (not (<= c0 5.9e-80))) (* 0.25 (/ (* (* D D) (* h (* M M))) (* d d))) (* (/ c0 (* 2.0 w)) (* c0 0.0))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -4.8e+74) || !(c0 <= 5.9e-80)) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else {
tmp = (c0 / (2.0 * w)) * (c0 * 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 <= (-4.8d+74)) .or. (.not. (c0 <= 5.9d-80))) then
tmp = 0.25d0 * (((d * d) * (h * (m * m))) / (d_1 * d_1))
else
tmp = (c0 / (2.0d0 * w)) * (c0 * 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 <= -4.8e+74) || !(c0 <= 5.9e-80)) {
tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d));
} else {
tmp = (c0 / (2.0 * w)) * (c0 * 0.0);
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (c0 <= -4.8e+74) or not (c0 <= 5.9e-80): tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)) else: tmp = (c0 / (2.0 * w)) * (c0 * 0.0) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((c0 <= -4.8e+74) || !(c0 <= 5.9e-80)) tmp = Float64(0.25 * Float64(Float64(Float64(D * D) * Float64(h * Float64(M * M))) / Float64(d * d))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(c0 * 0.0)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((c0 <= -4.8e+74) || ~((c0 <= 5.9e-80))) tmp = 0.25 * (((D * D) * (h * (M * M))) / (d * d)); else tmp = (c0 / (2.0 * w)) * (c0 * 0.0); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[c0, -4.8e+74], N[Not[LessEqual[c0, 5.9e-80]], $MachinePrecision]], N[(0.25 * N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -4.8 \cdot 10^{+74} \lor \neg \left(c0 \leq 5.9 \cdot 10^{-80}\right):\\
\;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\
\end{array}
\end{array}
if c0 < -4.80000000000000017e74 or 5.9000000000000001e-80 < c0 Initial program 22.7%
Taylor expanded in c0 around -inf 5.1%
fma-def5.1%
times-frac5.8%
unpow25.8%
unpow25.8%
*-commutative5.8%
unpow25.8%
associate-*r*5.8%
Simplified24.3%
Taylor expanded in c0 around 0 40.1%
*-commutative40.1%
unpow240.1%
*-commutative40.1%
unpow240.1%
unpow240.1%
Simplified40.1%
if -4.80000000000000017e74 < c0 < 5.9000000000000001e-80Initial program 20.0%
times-frac19.3%
fma-def19.3%
associate-/r*19.4%
difference-of-squares22.5%
Simplified30.3%
Taylor expanded in c0 around -inf 5.1%
associate-*r*5.1%
distribute-rgt1-in5.1%
metadata-eval5.1%
mul0-lft44.5%
metadata-eval44.5%
mul0-lft5.1%
metadata-eval5.1%
distribute-lft1-in5.1%
*-commutative5.1%
distribute-lft1-in5.1%
metadata-eval5.1%
mul0-lft44.5%
Simplified44.5%
Final simplification41.8%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= c0 -6.8e+72) (not (<= c0 1.52e-223))) (/ (* (* D D) 0.25) (/ (/ d (/ h d)) (* M M))) (* (/ c0 (* 2.0 w)) (* c0 0.0))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -6.8e+72) || !(c0 <= 1.52e-223)) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (c0 * 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 <= (-6.8d+72)) .or. (.not. (c0 <= 1.52d-223))) then
tmp = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
else
tmp = (c0 / (2.0d0 * w)) * (c0 * 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 <= -6.8e+72) || !(c0 <= 1.52e-223)) {
tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
} else {
tmp = (c0 / (2.0 * w)) * (c0 * 0.0);
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (c0 <= -6.8e+72) or not (c0 <= 1.52e-223): tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)) else: tmp = (c0 / (2.0 * w)) * (c0 * 0.0) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((c0 <= -6.8e+72) || !(c0 <= 1.52e-223)) tmp = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(c0 * 0.0)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((c0 <= -6.8e+72) || ~((c0 <= 1.52e-223))) tmp = ((D * D) * 0.25) / ((d / (h / d)) / (M * M)); else tmp = (c0 / (2.0 * w)) * (c0 * 0.0); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[c0, -6.8e+72], N[Not[LessEqual[c0, 1.52e-223]], $MachinePrecision]], N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -6.8 \cdot 10^{+72} \lor \neg \left(c0 \leq 1.52 \cdot 10^{-223}\right):\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\
\end{array}
\end{array}
if c0 < -6.7999999999999997e72 or 1.52000000000000001e-223 < c0 Initial program 21.5%
Taylor expanded in c0 around -inf 5.0%
fma-def5.0%
times-frac5.6%
unpow25.6%
unpow25.6%
*-commutative5.6%
unpow25.6%
associate-*r*5.6%
Simplified23.5%
Taylor expanded in c0 around 0 38.3%
associate-/l*38.4%
associate-*r/38.4%
unpow238.4%
associate-/r*36.8%
unpow236.8%
associate-/l*40.2%
unpow240.2%
Simplified40.2%
if -6.7999999999999997e72 < c0 < 1.52000000000000001e-223Initial program 22.0%
times-frac20.8%
fma-def20.9%
associate-/r*20.9%
difference-of-squares24.8%
Simplified31.8%
Taylor expanded in c0 around -inf 5.3%
associate-*r*5.3%
distribute-rgt1-in5.3%
metadata-eval5.3%
mul0-lft48.4%
metadata-eval48.4%
mul0-lft5.3%
metadata-eval5.3%
distribute-lft1-in5.3%
*-commutative5.3%
distribute-lft1-in5.3%
metadata-eval5.3%
mul0-lft48.4%
Simplified48.4%
Final simplification42.8%
(FPCore (c0 w h D d M) :precision binary64 (* (/ c0 (* 2.0 w)) (* c0 0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
return (c0 / (2.0 * w)) * (c0 * 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)) * (c0 * 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)) * (c0 * 0.0);
}
def code(c0, w, h, D, d, M): return (c0 / (2.0 * w)) * (c0 * 0.0)
function code(c0, w, h, D, d, M) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(c0 * 0.0)) end
function tmp = code(c0, w, h, D, d, M) tmp = (c0 / (2.0 * w)) * (c0 * 0.0); end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)
\end{array}
Initial program 21.6%
times-frac20.9%
fma-def20.5%
associate-/r*20.5%
difference-of-squares25.3%
Simplified30.0%
Taylor expanded in c0 around -inf 4.1%
associate-*r*4.1%
distribute-rgt1-in4.1%
metadata-eval4.1%
mul0-lft32.6%
metadata-eval32.6%
mul0-lft4.5%
metadata-eval4.5%
distribute-lft1-in4.5%
*-commutative4.5%
distribute-lft1-in4.5%
metadata-eval4.5%
mul0-lft32.6%
Simplified32.6%
Final simplification32.6%
herbie shell --seed 2023222
(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))))))