
(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 (cbrt (* (/ d D) (/ (* c0 d) (* h (* w D))))))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
(* t_1 (* 2.0 (* t_0 (* t_0 t_0))))
(* (/ 0.25 d) (/ D (/ d (* D (* h (pow M 2.0)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = cbrt(((d / D) * ((c0 * d) / (h * (w * D)))));
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_1 * (2.0 * (t_0 * (t_0 * t_0)));
} else {
tmp = (0.25 / d) * (D / (d / (D * (h * pow(M, 2.0)))));
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = Math.cbrt(((d / D) * ((c0 * d) / (h * (w * D)))));
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 * (2.0 * (t_0 * (t_0 * t_0)));
} else {
tmp = (0.25 / d) * (D / (d / (D * (h * Math.pow(M, 2.0)))));
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = cbrt(Float64(Float64(d / D) * Float64(Float64(c0 * d) / Float64(h * Float64(w * D))))) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf) tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(t_0 * t_0)))); else tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * (M ^ 2.0)))))); end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[Power[N[(N[(d / D), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_1 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \left(t_0 \cdot t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot {M}^{2}\right)}}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 72.4%
times-frac68.9%
fma-def66.6%
associate-/r*66.8%
difference-of-squares66.8%
Simplified69.8%
Taylor expanded in c0 around inf 73.4%
*-commutative73.4%
unpow273.4%
associate-/l/72.2%
associate-/r*73.2%
associate-/r*72.0%
unpow272.0%
associate-/l/73.3%
unpow273.3%
*-commutative73.3%
unpow273.3%
associate-*r*75.3%
*-commutative75.3%
Simplified75.3%
div-inv75.2%
associate-*l*78.5%
associate-*l*77.4%
Applied egg-rr77.4%
associate-*r*74.1%
unpow274.1%
associate-*r/74.1%
*-rgt-identity74.1%
unpow274.1%
associate-*r*77.4%
associate-*l*78.6%
Simplified78.6%
add-cube-cbrt78.5%
times-frac78.5%
*-commutative78.5%
*-commutative78.5%
times-frac78.5%
*-commutative78.5%
*-commutative78.5%
times-frac84.0%
Applied egg-rr84.0%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Taylor expanded in c0 around -inf 1.5%
Taylor expanded in c0 around 0 38.8%
associate-*r/38.8%
unpow238.8%
*-commutative38.8%
unpow238.8%
associate-*r*42.5%
unpow242.5%
Simplified42.5%
*-un-lft-identity42.5%
times-frac51.9%
associate-*l*47.7%
Applied egg-rr47.7%
*-lft-identity47.7%
unpow247.7%
associate-/l*48.3%
unpow248.3%
associate-/l*61.1%
Simplified61.1%
Taylor expanded in d around 0 63.8%
Final simplification70.6%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
INFINITY)
(/ (* c0 (* 2.0 (* (/ d D) (/ (* c0 d) (* h (* w D)))))) (* 2.0 w))
(* (/ 0.25 d) (/ D (/ d (* D (* h (pow M 2.0)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
} else {
tmp = (0.25 / d) * (D / (d / (D * (h * pow(M, 2.0)))));
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
} else {
tmp = (0.25 / d) * (D / (d / (D * (h * Math.pow(M, 2.0)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf: tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w) else: tmp = (0.25 / d) * (D / (d / (D * (h * math.pow(M, 2.0))))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(d / D) * Float64(Float64(c0 * d) / Float64(h * Float64(w * D)))))) / Float64(2.0 * w)); else tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * (M ^ 2.0)))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf) tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w); else tmp = (0.25 / d) * (D / (d / (D * (h * (M ^ 2.0))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[(c0 * N[(2.0 * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[Power[M, 2.0], $MachinePrecision]), $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)}\\
\mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}\right)\right)}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot {M}^{2}\right)}}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 72.4%
times-frac68.9%
fma-def66.6%
associate-/r*66.8%
difference-of-squares66.8%
Simplified69.8%
Taylor expanded in c0 around inf 73.4%
*-commutative73.4%
unpow273.4%
associate-/l/72.2%
associate-/r*73.2%
associate-/r*72.0%
unpow272.0%
associate-/l/73.3%
unpow273.3%
*-commutative73.3%
unpow273.3%
associate-*r*75.3%
*-commutative75.3%
Simplified75.3%
div-inv75.2%
associate-*l*78.5%
associate-*l*77.4%
Applied egg-rr77.4%
associate-*r*74.1%
unpow274.1%
associate-*r/74.1%
*-rgt-identity74.1%
unpow274.1%
associate-*r*77.4%
associate-*l*78.6%
Simplified78.6%
add-cbrt-cube73.8%
associate-*r*72.6%
associate-*l*71.5%
associate-*l/70.5%
Applied egg-rr79.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%
Taylor expanded in c0 around -inf 1.5%
Taylor expanded in c0 around 0 38.8%
associate-*r/38.8%
unpow238.8%
*-commutative38.8%
unpow238.8%
associate-*r*42.5%
unpow242.5%
Simplified42.5%
*-un-lft-identity42.5%
times-frac51.9%
associate-*l*47.7%
Applied egg-rr47.7%
*-lft-identity47.7%
unpow247.7%
associate-/l*48.3%
unpow248.3%
associate-/l*61.1%
Simplified61.1%
Taylor expanded in d around 0 63.8%
Final simplification69.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
(t_2 (* (/ d D) (/ d D))))
(if (<= d -6.2e+43)
t_1
(if (<= d -1.45e-130)
(* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* D (* h D))))))
(if (<= d 1.25e-226)
t_1
(if (<= d 1.6e-48)
(* t_0 (* 2.0 (* t_2 (/ (/ c0 h) w))))
(if (<= d 1.5e+99)
(* (/ 0.25 d) (/ D (/ (/ d h) (* D (* M M)))))
(if (<= d 5.8e+128)
(* (/ c0 w) (* (/ d D) (/ c0 (/ D (/ d (* w h))))))
(if (<= d 1.25e+205)
t_1
(* t_0 (* 2.0 (* (/ c0 w) (/ t_2 h)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
double t_2 = (d / D) * (d / D);
double tmp;
if (d <= -6.2e+43) {
tmp = t_1;
} else if (d <= -1.45e-130) {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D)))));
} else if (d <= 1.25e-226) {
tmp = t_1;
} else if (d <= 1.6e-48) {
tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w)));
} else if (d <= 1.5e+99) {
tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
} else if (d <= 5.8e+128) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if (d <= 1.25e+205) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
t_2 = (d_1 / d) * (d_1 / d)
if (d_1 <= (-6.2d+43)) then
tmp = t_1
else if (d_1 <= (-1.45d-130)) then
tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (d * (h * d)))))
else if (d_1 <= 1.25d-226) then
tmp = t_1
else if (d_1 <= 1.6d-48) then
tmp = t_0 * (2.0d0 * (t_2 * ((c0 / h) / w)))
else if (d_1 <= 1.5d+99) then
tmp = (0.25d0 / d_1) * (d / ((d_1 / h) / (d * (m * m))))
else if (d_1 <= 5.8d+128) then
tmp = (c0 / w) * ((d_1 / d) * (c0 / (d / (d_1 / (w * h)))))
else if (d_1 <= 1.25d+205) then
tmp = t_1
else
tmp = t_0 * (2.0d0 * ((c0 / w) * (t_2 / h)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
double t_2 = (d / D) * (d / D);
double tmp;
if (d <= -6.2e+43) {
tmp = t_1;
} else if (d <= -1.45e-130) {
tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D)))));
} else if (d <= 1.25e-226) {
tmp = t_1;
} else if (d <= 1.6e-48) {
tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w)));
} else if (d <= 1.5e+99) {
tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
} else if (d <= 5.8e+128) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if (d <= 1.25e+205) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M))))) t_2 = (d / D) * (d / D) tmp = 0 if d <= -6.2e+43: tmp = t_1 elif d <= -1.45e-130: tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D))))) elif d <= 1.25e-226: tmp = t_1 elif d <= 1.6e-48: tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w))) elif d <= 1.5e+99: tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M)))) elif d <= 5.8e+128: tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))) elif d <= 1.25e+205: tmp = t_1 else: tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M)))))) t_2 = Float64(Float64(d / D) * Float64(d / D)) tmp = 0.0 if (d <= -6.2e+43) tmp = t_1; elseif (d <= -1.45e-130) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(D * Float64(h * D)))))); elseif (d <= 1.25e-226) tmp = t_1; elseif (d <= 1.6e-48) tmp = Float64(t_0 * Float64(2.0 * Float64(t_2 * Float64(Float64(c0 / h) / w)))); elseif (d <= 1.5e+99) tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(Float64(d / h) / Float64(D * Float64(M * M))))); elseif (d <= 5.8e+128) tmp = Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(c0 / Float64(D / Float64(d / Float64(w * h)))))); elseif (d <= 1.25e+205) tmp = t_1; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(t_2 / h)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M))))); t_2 = (d / D) * (d / D); tmp = 0.0; if (d <= -6.2e+43) tmp = t_1; elseif (d <= -1.45e-130) tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D))))); elseif (d <= 1.25e-226) tmp = t_1; elseif (d <= 1.6e-48) tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w))); elseif (d <= 1.5e+99) tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M)))); elseif (d <= 5.8e+128) tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))); elseif (d <= 1.25e+205) tmp = t_1; else tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.2e+43], t$95$1, If[LessEqual[d, -1.45e-130], N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.25e-226], t$95$1, If[LessEqual[d, 1.6e-48], N[(t$95$0 * N[(2.0 * N[(t$95$2 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e+99], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(N[(d / h), $MachinePrecision] / N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.8e+128], N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(D / N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.25e+205], t$95$1, N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(t$95$2 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\
t_2 := \frac{d}{D} \cdot \frac{d}{D}\\
\mathbf{if}\;d \leq -6.2 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq -1.45 \cdot 10^{-130}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{D \cdot \left(h \cdot D\right)}\right)\right)\\
\mathbf{elif}\;d \leq 1.25 \cdot 10^{-226}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq 1.6 \cdot 10^{-48}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(t_2 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\
\mathbf{elif}\;d \leq 1.5 \cdot 10^{+99}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\
\mathbf{elif}\;d \leq 5.8 \cdot 10^{+128}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\
\mathbf{elif}\;d \leq 1.25 \cdot 10^{+205}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{t_2}{h}\right)\right)\\
\end{array}
\end{array}
if d < -6.2000000000000003e43 or -1.45e-130 < d < 1.2499999999999999e-226 or 5.8000000000000001e128 < d < 1.25e205Initial program 15.5%
Taylor expanded in c0 around -inf 3.5%
Taylor expanded in c0 around 0 36.5%
associate-*r/36.5%
unpow236.5%
*-commutative36.5%
unpow236.5%
associate-*r*39.1%
unpow239.1%
Simplified39.1%
*-un-lft-identity39.1%
times-frac50.3%
associate-*l*46.9%
Applied egg-rr46.9%
*-lft-identity46.9%
unpow246.9%
associate-/l*47.8%
unpow247.8%
associate-/l*59.0%
Simplified59.0%
Taylor expanded in d around 0 62.1%
*-commutative62.1%
unpow262.1%
Simplified62.1%
if -6.2000000000000003e43 < d < -1.45e-130Initial program 49.5%
times-frac49.4%
fma-def47.1%
associate-/r*47.2%
difference-of-squares49.7%
Simplified52.2%
Taylor expanded in c0 around inf 52.8%
*-commutative52.8%
unpow252.8%
associate-/l/52.8%
associate-/r*57.8%
associate-/r*55.5%
unpow255.5%
associate-/l/53.3%
unpow253.3%
*-commutative53.3%
unpow253.3%
associate-*r*57.7%
*-commutative57.7%
Simplified57.7%
times-frac60.1%
*-commutative60.1%
Applied egg-rr60.1%
if 1.2499999999999999e-226 < d < 1.5999999999999999e-48Initial program 28.9%
times-frac21.3%
fma-def21.3%
associate-/r*21.4%
difference-of-squares21.4%
Simplified24.8%
Taylor expanded in c0 around inf 36.1%
*-commutative36.1%
unpow236.1%
associate-/l/35.9%
associate-/r*36.0%
associate-/r*35.9%
unpow235.9%
associate-/l/36.1%
unpow236.1%
*-commutative36.1%
unpow236.1%
associate-*r*39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in d around 0 36.1%
times-frac26.1%
unpow226.1%
unpow226.1%
*-commutative26.1%
*-commutative26.1%
associate-/r*29.8%
times-frac55.6%
Simplified55.6%
if 1.5999999999999999e-48 < d < 1.50000000000000007e99Initial program 10.0%
Taylor expanded in c0 around -inf 6.7%
Taylor expanded in c0 around 0 44.8%
associate-*r/44.8%
unpow244.8%
*-commutative44.8%
unpow244.8%
associate-*r*48.2%
unpow248.2%
Simplified48.2%
*-un-lft-identity48.2%
times-frac48.1%
associate-*l*44.8%
Applied egg-rr44.8%
*-lft-identity44.8%
unpow244.8%
associate-/l*44.8%
unpow244.8%
associate-/l*51.8%
Simplified51.8%
div-inv51.8%
associate-/r*51.7%
Applied egg-rr51.7%
associate-*r/51.7%
*-rgt-identity51.7%
unpow251.7%
associate-/l/57.7%
unpow257.7%
Simplified57.7%
if 1.50000000000000007e99 < d < 5.8000000000000001e128Initial program 50.5%
times-frac50.5%
fma-def50.5%
associate-/r*50.5%
difference-of-squares67.2%
Simplified83.9%
Taylor expanded in c0 around inf 67.2%
*-commutative67.2%
unpow267.2%
associate-/l/67.2%
associate-/r*67.2%
associate-/r*67.2%
unpow267.2%
associate-/l/67.2%
unpow267.2%
*-commutative67.2%
unpow267.2%
associate-*r*83.9%
*-commutative83.9%
Simplified83.9%
div-inv83.9%
associate-*l*83.9%
associate-*l*83.9%
Applied egg-rr83.9%
associate-*r*83.9%
unpow283.9%
associate-*r/83.9%
*-rgt-identity83.9%
unpow283.9%
associate-*r*83.9%
associate-*l*83.9%
Simplified83.9%
add-cbrt-cube83.9%
associate-*r*83.9%
associate-*l*83.9%
associate-*l/83.9%
Applied egg-rr83.9%
times-frac99.7%
*-commutative99.7%
associate-/l*99.7%
associate-/l*99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
if 1.25e205 < d Initial program 29.0%
times-frac25.8%
fma-def25.8%
associate-/r*25.8%
difference-of-squares32.3%
Simplified32.7%
Taylor expanded in c0 around inf 36.4%
*-commutative36.4%
unpow236.4%
associate-/l/36.4%
associate-/r*39.7%
associate-/r*39.4%
unpow239.4%
associate-/l/39.4%
unpow239.4%
*-commutative39.4%
unpow239.4%
associate-*r*39.5%
*-commutative39.5%
Simplified39.5%
*-commutative39.5%
*-commutative39.5%
associate-*r*39.4%
*-commutative39.4%
times-frac39.4%
associate-*r*39.5%
*-commutative39.5%
*-commutative39.5%
Applied egg-rr39.5%
unpow239.5%
associate-/r*39.7%
unpow239.7%
associate-*r/46.1%
associate-/r*46.6%
associate-*r/40.3%
unpow240.3%
associate-/r*39.7%
unpow239.7%
times-frac49.7%
Simplified49.7%
Final simplification59.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* (/ d D) (/ d D))))
(if (<= d -5.6e+58)
t_0
(if (<= d -6.8e-130)
(/ (* c0 (* 2.0 (* (/ d D) (/ (* c0 d) (* h (* w D)))))) (* 2.0 w))
(if (<= d 2.6e-223)
t_0
(if (<= d 6.5e-42)
(* t_1 (* 2.0 (* t_2 (/ (/ c0 h) w))))
(if (<= d 1.5e+86)
(* (/ 0.25 d) (/ D (/ (/ d h) (* D (* M M)))))
(if (<= d 9e+131)
(* (/ c0 w) (* (/ d D) (/ c0 (/ D (/ d (* w h))))))
(if (<= d 1.02e+210)
t_0
(* t_1 (* 2.0 (* (/ c0 w) (/ t_2 h)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
double t_1 = c0 / (2.0 * w);
double t_2 = (d / D) * (d / D);
double tmp;
if (d <= -5.6e+58) {
tmp = t_0;
} else if (d <= -6.8e-130) {
tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
} else if (d <= 2.6e-223) {
tmp = t_0;
} else if (d <= 6.5e-42) {
tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w)));
} else if (d <= 1.5e+86) {
tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
} else if (d <= 9e+131) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if (d <= 1.02e+210) {
tmp = t_0;
} else {
tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
t_1 = c0 / (2.0d0 * w)
t_2 = (d_1 / d) * (d_1 / d)
if (d_1 <= (-5.6d+58)) then
tmp = t_0
else if (d_1 <= (-6.8d-130)) then
tmp = (c0 * (2.0d0 * ((d_1 / d) * ((c0 * d_1) / (h * (w * d)))))) / (2.0d0 * w)
else if (d_1 <= 2.6d-223) then
tmp = t_0
else if (d_1 <= 6.5d-42) then
tmp = t_1 * (2.0d0 * (t_2 * ((c0 / h) / w)))
else if (d_1 <= 1.5d+86) then
tmp = (0.25d0 / d_1) * (d / ((d_1 / h) / (d * (m * m))))
else if (d_1 <= 9d+131) then
tmp = (c0 / w) * ((d_1 / d) * (c0 / (d / (d_1 / (w * h)))))
else if (d_1 <= 1.02d+210) then
tmp = t_0
else
tmp = t_1 * (2.0d0 * ((c0 / w) * (t_2 / h)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
double t_1 = c0 / (2.0 * w);
double t_2 = (d / D) * (d / D);
double tmp;
if (d <= -5.6e+58) {
tmp = t_0;
} else if (d <= -6.8e-130) {
tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
} else if (d <= 2.6e-223) {
tmp = t_0;
} else if (d <= 6.5e-42) {
tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w)));
} else if (d <= 1.5e+86) {
tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
} else if (d <= 9e+131) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if (d <= 1.02e+210) {
tmp = t_0;
} else {
tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M))))) t_1 = c0 / (2.0 * w) t_2 = (d / D) * (d / D) tmp = 0 if d <= -5.6e+58: tmp = t_0 elif d <= -6.8e-130: tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w) elif d <= 2.6e-223: tmp = t_0 elif d <= 6.5e-42: tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w))) elif d <= 1.5e+86: tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M)))) elif d <= 9e+131: tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))) elif d <= 1.02e+210: tmp = t_0 else: tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M)))))) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(d / D) * Float64(d / D)) tmp = 0.0 if (d <= -5.6e+58) tmp = t_0; elseif (d <= -6.8e-130) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(d / D) * Float64(Float64(c0 * d) / Float64(h * Float64(w * D)))))) / Float64(2.0 * w)); elseif (d <= 2.6e-223) tmp = t_0; elseif (d <= 6.5e-42) tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * Float64(Float64(c0 / h) / w)))); elseif (d <= 1.5e+86) tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(Float64(d / h) / Float64(D * Float64(M * M))))); elseif (d <= 9e+131) tmp = Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(c0 / Float64(D / Float64(d / Float64(w * h)))))); elseif (d <= 1.02e+210) tmp = t_0; else tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(t_2 / h)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M))))); t_1 = c0 / (2.0 * w); t_2 = (d / D) * (d / D); tmp = 0.0; if (d <= -5.6e+58) tmp = t_0; elseif (d <= -6.8e-130) tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w); elseif (d <= 2.6e-223) tmp = t_0; elseif (d <= 6.5e-42) tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w))); elseif (d <= 1.5e+86) tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M)))); elseif (d <= 9e+131) tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))); elseif (d <= 1.02e+210) tmp = t_0; else tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5.6e+58], t$95$0, If[LessEqual[d, -6.8e-130], N[(N[(c0 * N[(2.0 * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.6e-223], t$95$0, If[LessEqual[d, 6.5e-42], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e+86], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(N[(d / h), $MachinePrecision] / N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9e+131], N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(D / N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.02e+210], t$95$0, N[(t$95$1 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(t$95$2 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{d}{D} \cdot \frac{d}{D}\\
\mathbf{if}\;d \leq -5.6 \cdot 10^{+58}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq -6.8 \cdot 10^{-130}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}\right)\right)}{2 \cdot w}\\
\mathbf{elif}\;d \leq 2.6 \cdot 10^{-223}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;d \leq 6.5 \cdot 10^{-42}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_2 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\
\mathbf{elif}\;d \leq 1.5 \cdot 10^{+86}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\
\mathbf{elif}\;d \leq 9 \cdot 10^{+131}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\
\mathbf{elif}\;d \leq 1.02 \cdot 10^{+210}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{t_2}{h}\right)\right)\\
\end{array}
\end{array}
if d < -5.5999999999999996e58 or -6.8000000000000001e-130 < d < 2.6e-223 or 9.00000000000000039e131 < d < 1.02000000000000005e210Initial program 14.3%
Taylor expanded in c0 around -inf 2.8%
Taylor expanded in c0 around 0 36.0%
associate-*r/36.0%
unpow236.0%
*-commutative36.0%
unpow236.0%
associate-*r*38.7%
unpow238.7%
Simplified38.7%
*-un-lft-identity38.7%
times-frac50.3%
associate-*l*46.8%
Applied egg-rr46.8%
*-lft-identity46.8%
unpow246.8%
associate-/l*47.7%
unpow247.7%
associate-/l*59.2%
Simplified59.2%
Taylor expanded in d around 0 62.4%
*-commutative62.4%
unpow262.4%
Simplified62.4%
if -5.5999999999999996e58 < d < -6.8000000000000001e-130Initial program 49.5%
times-frac49.4%
fma-def47.3%
associate-/r*47.4%
difference-of-squares49.7%
Simplified52.0%
Taylor expanded in c0 around inf 52.6%
*-commutative52.6%
unpow252.6%
associate-/l/52.6%
associate-/r*57.3%
associate-/r*55.1%
unpow255.1%
associate-/l/53.1%
unpow253.1%
*-commutative53.1%
unpow253.1%
associate-*r*59.2%
*-commutative59.2%
Simplified59.2%
div-inv59.1%
associate-*l*59.1%
associate-*l*57.2%
Applied egg-rr57.2%
associate-*r*57.2%
unpow257.2%
associate-*r/57.2%
*-rgt-identity57.2%
unpow257.2%
associate-*r*57.2%
associate-*l*59.2%
Simplified59.2%
add-cbrt-cube52.3%
associate-*r*50.3%
associate-*l*50.2%
associate-*l/50.2%
Applied egg-rr59.3%
if 2.6e-223 < d < 6.4999999999999998e-42Initial program 28.9%
times-frac21.3%
fma-def21.3%
associate-/r*21.4%
difference-of-squares21.4%
Simplified24.8%
Taylor expanded in c0 around inf 36.1%
*-commutative36.1%
unpow236.1%
associate-/l/35.9%
associate-/r*36.0%
associate-/r*35.9%
unpow235.9%
associate-/l/36.1%
unpow236.1%
*-commutative36.1%
unpow236.1%
associate-*r*39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in d around 0 36.1%
times-frac26.1%
unpow226.1%
unpow226.1%
*-commutative26.1%
*-commutative26.1%
associate-/r*29.8%
times-frac55.6%
Simplified55.6%
if 6.4999999999999998e-42 < d < 1.49999999999999988e86Initial program 10.0%
Taylor expanded in c0 around -inf 6.7%
Taylor expanded in c0 around 0 44.8%
associate-*r/44.8%
unpow244.8%
*-commutative44.8%
unpow244.8%
associate-*r*48.2%
unpow248.2%
Simplified48.2%
*-un-lft-identity48.2%
times-frac48.1%
associate-*l*44.8%
Applied egg-rr44.8%
*-lft-identity44.8%
unpow244.8%
associate-/l*44.8%
unpow244.8%
associate-/l*51.8%
Simplified51.8%
div-inv51.8%
associate-/r*51.7%
Applied egg-rr51.7%
associate-*r/51.7%
*-rgt-identity51.7%
unpow251.7%
associate-/l/57.7%
unpow257.7%
Simplified57.7%
if 1.49999999999999988e86 < d < 9.00000000000000039e131Initial program 50.5%
times-frac50.5%
fma-def50.5%
associate-/r*50.5%
difference-of-squares67.2%
Simplified83.9%
Taylor expanded in c0 around inf 67.2%
*-commutative67.2%
unpow267.2%
associate-/l/67.2%
associate-/r*67.2%
associate-/r*67.2%
unpow267.2%
associate-/l/67.2%
unpow267.2%
*-commutative67.2%
unpow267.2%
associate-*r*83.9%
*-commutative83.9%
Simplified83.9%
div-inv83.9%
associate-*l*83.9%
associate-*l*83.9%
Applied egg-rr83.9%
associate-*r*83.9%
unpow283.9%
associate-*r/83.9%
*-rgt-identity83.9%
unpow283.9%
associate-*r*83.9%
associate-*l*83.9%
Simplified83.9%
add-cbrt-cube83.9%
associate-*r*83.9%
associate-*l*83.9%
associate-*l/83.9%
Applied egg-rr83.9%
times-frac99.7%
*-commutative99.7%
associate-/l*99.7%
associate-/l*99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
if 1.02000000000000005e210 < d Initial program 29.0%
times-frac25.8%
fma-def25.8%
associate-/r*25.8%
difference-of-squares32.3%
Simplified32.7%
Taylor expanded in c0 around inf 36.4%
*-commutative36.4%
unpow236.4%
associate-/l/36.4%
associate-/r*39.7%
associate-/r*39.4%
unpow239.4%
associate-/l/39.4%
unpow239.4%
*-commutative39.4%
unpow239.4%
associate-*r*39.5%
*-commutative39.5%
Simplified39.5%
*-commutative39.5%
*-commutative39.5%
associate-*r*39.4%
*-commutative39.4%
times-frac39.4%
associate-*r*39.5%
*-commutative39.5%
*-commutative39.5%
Applied egg-rr39.5%
unpow239.5%
associate-/r*39.7%
unpow239.7%
associate-*r/46.1%
associate-/r*46.6%
associate-*r/40.3%
unpow240.3%
associate-/r*39.7%
unpow239.7%
times-frac49.7%
Simplified49.7%
Final simplification59.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (/ d D)))
(t_1 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
(t_2 (/ c0 (* 2.0 w))))
(if (<= d -3.1e+59)
t_1
(if (<= d -1.75e-130)
(/ (* c0 (* 2.0 (* (/ d D) (/ (* c0 d) (* h (* w D)))))) (* 2.0 w))
(if (<= d 5e-234)
t_1
(if (<= d 5e-43)
(* t_2 (* 2.0 (* (* (/ c0 h) (/ 1.0 w)) t_0)))
(if (<= d 9.4e+98)
(* (/ 0.25 d) (/ D (/ (/ d h) (* D (* M M)))))
(if (<= d 6.3e+131)
(* (/ c0 w) (* (/ d D) (/ c0 (/ D (/ d (* w h))))))
(if (<= d 1.45e+198)
t_1
(* t_2 (* 2.0 (* (/ c0 w) (/ t_0 h)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
double t_2 = c0 / (2.0 * w);
double tmp;
if (d <= -3.1e+59) {
tmp = t_1;
} else if (d <= -1.75e-130) {
tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
} else if (d <= 5e-234) {
tmp = t_1;
} else if (d <= 5e-43) {
tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
} else if (d <= 9.4e+98) {
tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
} else if (d <= 6.3e+131) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if (d <= 1.45e+198) {
tmp = t_1;
} else {
tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (d_1 / d) * (d_1 / d)
t_1 = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
t_2 = c0 / (2.0d0 * w)
if (d_1 <= (-3.1d+59)) then
tmp = t_1
else if (d_1 <= (-1.75d-130)) then
tmp = (c0 * (2.0d0 * ((d_1 / d) * ((c0 * d_1) / (h * (w * d)))))) / (2.0d0 * w)
else if (d_1 <= 5d-234) then
tmp = t_1
else if (d_1 <= 5d-43) then
tmp = t_2 * (2.0d0 * (((c0 / h) * (1.0d0 / w)) * t_0))
else if (d_1 <= 9.4d+98) then
tmp = (0.25d0 / d_1) * (d / ((d_1 / h) / (d * (m * m))))
else if (d_1 <= 6.3d+131) then
tmp = (c0 / w) * ((d_1 / d) * (c0 / (d / (d_1 / (w * h)))))
else if (d_1 <= 1.45d+198) then
tmp = t_1
else
tmp = t_2 * (2.0d0 * ((c0 / w) * (t_0 / h)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * (d / D);
double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
double t_2 = c0 / (2.0 * w);
double tmp;
if (d <= -3.1e+59) {
tmp = t_1;
} else if (d <= -1.75e-130) {
tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
} else if (d <= 5e-234) {
tmp = t_1;
} else if (d <= 5e-43) {
tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
} else if (d <= 9.4e+98) {
tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
} else if (d <= 6.3e+131) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if (d <= 1.45e+198) {
tmp = t_1;
} else {
tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * (d / D) t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M))))) t_2 = c0 / (2.0 * w) tmp = 0 if d <= -3.1e+59: tmp = t_1 elif d <= -1.75e-130: tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w) elif d <= 5e-234: tmp = t_1 elif d <= 5e-43: tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0)) elif d <= 9.4e+98: tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M)))) elif d <= 6.3e+131: tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))) elif d <= 1.45e+198: tmp = t_1 else: tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * Float64(d / D)) t_1 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M)))))) t_2 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (d <= -3.1e+59) tmp = t_1; elseif (d <= -1.75e-130) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(d / D) * Float64(Float64(c0 * d) / Float64(h * Float64(w * D)))))) / Float64(2.0 * w)); elseif (d <= 5e-234) tmp = t_1; elseif (d <= 5e-43) tmp = Float64(t_2 * Float64(2.0 * Float64(Float64(Float64(c0 / h) * Float64(1.0 / w)) * t_0))); elseif (d <= 9.4e+98) tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(Float64(d / h) / Float64(D * Float64(M * M))))); elseif (d <= 6.3e+131) tmp = Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(c0 / Float64(D / Float64(d / Float64(w * h)))))); elseif (d <= 1.45e+198) tmp = t_1; else tmp = Float64(t_2 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(t_0 / h)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * (d / D); t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M))))); t_2 = c0 / (2.0 * w); tmp = 0.0; if (d <= -3.1e+59) tmp = t_1; elseif (d <= -1.75e-130) tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w); elseif (d <= 5e-234) tmp = t_1; elseif (d <= 5e-43) tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0)); elseif (d <= 9.4e+98) tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M)))); elseif (d <= 6.3e+131) tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))); elseif (d <= 1.45e+198) tmp = t_1; else tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.1e+59], t$95$1, If[LessEqual[d, -1.75e-130], N[(N[(c0 * N[(2.0 * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5e-234], t$95$1, If[LessEqual[d, 5e-43], N[(t$95$2 * N[(2.0 * N[(N[(N[(c0 / h), $MachinePrecision] * N[(1.0 / w), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.4e+98], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(N[(d / h), $MachinePrecision] / N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.3e+131], N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(D / N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.45e+198], t$95$1, N[(t$95$2 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(t$95$0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{d}{D}\\
t_1 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\
t_2 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \leq -3.1 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq -1.75 \cdot 10^{-130}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}\right)\right)}{2 \cdot w}\\
\mathbf{elif}\;d \leq 5 \cdot 10^{-234}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;d \leq 5 \cdot 10^{-43}:\\
\;\;\;\;t_2 \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot t_0\right)\right)\\
\mathbf{elif}\;d \leq 9.4 \cdot 10^{+98}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\
\mathbf{elif}\;d \leq 6.3 \cdot 10^{+131}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{+198}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{t_0}{h}\right)\right)\\
\end{array}
\end{array}
if d < -3.10000000000000015e59 or -1.75e-130 < d < 4.99999999999999979e-234 or 6.29999999999999996e131 < d < 1.45e198Initial program 14.3%
Taylor expanded in c0 around -inf 2.8%
Taylor expanded in c0 around 0 36.0%
associate-*r/36.0%
unpow236.0%
*-commutative36.0%
unpow236.0%
associate-*r*38.7%
unpow238.7%
Simplified38.7%
*-un-lft-identity38.7%
times-frac50.3%
associate-*l*46.8%
Applied egg-rr46.8%
*-lft-identity46.8%
unpow246.8%
associate-/l*47.7%
unpow247.7%
associate-/l*59.2%
Simplified59.2%
Taylor expanded in d around 0 62.4%
*-commutative62.4%
unpow262.4%
Simplified62.4%
if -3.10000000000000015e59 < d < -1.75e-130Initial program 49.5%
times-frac49.4%
fma-def47.3%
associate-/r*47.4%
difference-of-squares49.7%
Simplified52.0%
Taylor expanded in c0 around inf 52.6%
*-commutative52.6%
unpow252.6%
associate-/l/52.6%
associate-/r*57.3%
associate-/r*55.1%
unpow255.1%
associate-/l/53.1%
unpow253.1%
*-commutative53.1%
unpow253.1%
associate-*r*59.2%
*-commutative59.2%
Simplified59.2%
div-inv59.1%
associate-*l*59.1%
associate-*l*57.2%
Applied egg-rr57.2%
associate-*r*57.2%
unpow257.2%
associate-*r/57.2%
*-rgt-identity57.2%
unpow257.2%
associate-*r*57.2%
associate-*l*59.2%
Simplified59.2%
add-cbrt-cube52.3%
associate-*r*50.3%
associate-*l*50.2%
associate-*l/50.2%
Applied egg-rr59.3%
if 4.99999999999999979e-234 < d < 5.00000000000000019e-43Initial program 28.9%
times-frac21.3%
fma-def21.3%
associate-/r*21.4%
difference-of-squares21.4%
Simplified24.8%
Taylor expanded in c0 around inf 36.1%
*-commutative36.1%
unpow236.1%
associate-/l/35.9%
associate-/r*36.0%
associate-/r*35.9%
unpow235.9%
associate-/l/36.1%
unpow236.1%
*-commutative36.1%
unpow236.1%
associate-*r*39.0%
*-commutative39.0%
Simplified39.0%
Taylor expanded in d around 0 36.1%
times-frac26.1%
unpow226.1%
unpow226.1%
*-commutative26.1%
*-commutative26.1%
associate-/r*29.8%
times-frac55.6%
Simplified55.6%
div-inv55.7%
Applied egg-rr55.7%
if 5.00000000000000019e-43 < d < 9.3999999999999994e98Initial program 10.0%
Taylor expanded in c0 around -inf 6.7%
Taylor expanded in c0 around 0 44.8%
associate-*r/44.8%
unpow244.8%
*-commutative44.8%
unpow244.8%
associate-*r*48.2%
unpow248.2%
Simplified48.2%
*-un-lft-identity48.2%
times-frac48.1%
associate-*l*44.8%
Applied egg-rr44.8%
*-lft-identity44.8%
unpow244.8%
associate-/l*44.8%
unpow244.8%
associate-/l*51.8%
Simplified51.8%
div-inv51.8%
associate-/r*51.7%
Applied egg-rr51.7%
associate-*r/51.7%
*-rgt-identity51.7%
unpow251.7%
associate-/l/57.7%
unpow257.7%
Simplified57.7%
if 9.3999999999999994e98 < d < 6.29999999999999996e131Initial program 50.5%
times-frac50.5%
fma-def50.5%
associate-/r*50.5%
difference-of-squares67.2%
Simplified83.9%
Taylor expanded in c0 around inf 67.2%
*-commutative67.2%
unpow267.2%
associate-/l/67.2%
associate-/r*67.2%
associate-/r*67.2%
unpow267.2%
associate-/l/67.2%
unpow267.2%
*-commutative67.2%
unpow267.2%
associate-*r*83.9%
*-commutative83.9%
Simplified83.9%
div-inv83.9%
associate-*l*83.9%
associate-*l*83.9%
Applied egg-rr83.9%
associate-*r*83.9%
unpow283.9%
associate-*r/83.9%
*-rgt-identity83.9%
unpow283.9%
associate-*r*83.9%
associate-*l*83.9%
Simplified83.9%
add-cbrt-cube83.9%
associate-*r*83.9%
associate-*l*83.9%
associate-*l/83.9%
Applied egg-rr83.9%
times-frac99.7%
*-commutative99.7%
associate-/l*99.7%
associate-/l*99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
if 1.45e198 < d Initial program 29.0%
times-frac25.8%
fma-def25.8%
associate-/r*25.8%
difference-of-squares32.3%
Simplified32.7%
Taylor expanded in c0 around inf 36.4%
*-commutative36.4%
unpow236.4%
associate-/l/36.4%
associate-/r*39.7%
associate-/r*39.4%
unpow239.4%
associate-/l/39.4%
unpow239.4%
*-commutative39.4%
unpow239.4%
associate-*r*39.5%
*-commutative39.5%
Simplified39.5%
*-commutative39.5%
*-commutative39.5%
associate-*r*39.4%
*-commutative39.4%
times-frac39.4%
associate-*r*39.5%
*-commutative39.5%
*-commutative39.5%
Applied egg-rr39.5%
unpow239.5%
associate-/r*39.7%
unpow239.7%
associate-*r/46.1%
associate-/r*46.6%
associate-*r/40.3%
unpow240.3%
associate-/r*39.7%
unpow239.7%
times-frac49.7%
Simplified49.7%
Final simplification59.9%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* h (* M M))))
(if (<= (* d d) 2e-257)
(* (/ 0.25 d) (/ D (/ (/ d t_0) D)))
(if (<= (* d d) 1e-6)
(* (/ c0 w) (* (/ d D) (/ c0 (/ D (/ d (* w h))))))
(if (<= (* d d) 1e+62)
(* (/ 0.25 d) (* D (/ (* D (* M M)) (/ d h))))
(if (<= (* d d) 5e+86)
(/ (* d d) (/ (* h (* (* w D) (* w D))) (* c0 c0)))
(* (/ 0.25 d) (/ D (/ d (* D t_0))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = h * (M * M);
double tmp;
if ((d * d) <= 2e-257) {
tmp = (0.25 / d) * (D / ((d / t_0) / D));
} else if ((d * d) <= 1e-6) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if ((d * d) <= 1e+62) {
tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)));
} else if ((d * d) <= 5e+86) {
tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
} else {
tmp = (0.25 / d) * (D / (d / (D * t_0)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = h * (m * m)
if ((d_1 * d_1) <= 2d-257) then
tmp = (0.25d0 / d_1) * (d / ((d_1 / t_0) / d))
else if ((d_1 * d_1) <= 1d-6) then
tmp = (c0 / w) * ((d_1 / d) * (c0 / (d / (d_1 / (w * h)))))
else if ((d_1 * d_1) <= 1d+62) then
tmp = (0.25d0 / d_1) * (d * ((d * (m * m)) / (d_1 / h)))
else if ((d_1 * d_1) <= 5d+86) then
tmp = (d_1 * d_1) / ((h * ((w * d) * (w * d))) / (c0 * c0))
else
tmp = (0.25d0 / d_1) * (d / (d_1 / (d * t_0)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = h * (M * M);
double tmp;
if ((d * d) <= 2e-257) {
tmp = (0.25 / d) * (D / ((d / t_0) / D));
} else if ((d * d) <= 1e-6) {
tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
} else if ((d * d) <= 1e+62) {
tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)));
} else if ((d * d) <= 5e+86) {
tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
} else {
tmp = (0.25 / d) * (D / (d / (D * t_0)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = h * (M * M) tmp = 0 if (d * d) <= 2e-257: tmp = (0.25 / d) * (D / ((d / t_0) / D)) elif (d * d) <= 1e-6: tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))) elif (d * d) <= 1e+62: tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h))) elif (d * d) <= 5e+86: tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0)) else: tmp = (0.25 / d) * (D / (d / (D * t_0))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(h * Float64(M * M)) tmp = 0.0 if (Float64(d * d) <= 2e-257) tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(Float64(d / t_0) / D))); elseif (Float64(d * d) <= 1e-6) tmp = Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(c0 / Float64(D / Float64(d / Float64(w * h)))))); elseif (Float64(d * d) <= 1e+62) tmp = Float64(Float64(0.25 / d) * Float64(D * Float64(Float64(D * Float64(M * M)) / Float64(d / h)))); elseif (Float64(d * d) <= 5e+86) tmp = Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(w * D) * Float64(w * D))) / Float64(c0 * c0))); else tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * t_0)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = h * (M * M); tmp = 0.0; if ((d * d) <= 2e-257) tmp = (0.25 / d) * (D / ((d / t_0) / D)); elseif ((d * d) <= 1e-6) tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h))))); elseif ((d * d) <= 1e+62) tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h))); elseif ((d * d) <= 5e+86) tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0)); else tmp = (0.25 / d) * (D / (d / (D * t_0))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(d * d), $MachinePrecision], 2e-257], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(N[(d / t$95$0), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e-6], N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(D / N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e+62], N[(N[(0.25 / d), $MachinePrecision] * N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 5e+86], N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(w * D), $MachinePrecision] * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c0 * c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := h \cdot \left(M \cdot M\right)\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-257}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{t_0}}{D}}\\
\mathbf{elif}\;d \cdot d \leq 10^{-6}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\
\mathbf{elif}\;d \cdot d \leq 10^{+62}:\\
\;\;\;\;\frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)\\
\mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{+86}:\\
\;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot t_0}}\\
\end{array}
\end{array}
if (*.f64 d d) < 2e-257Initial program 7.0%
Taylor expanded in c0 around -inf 3.5%
Taylor expanded in c0 around 0 15.2%
associate-*r/15.2%
unpow215.2%
*-commutative15.2%
unpow215.2%
associate-*r*15.3%
unpow215.3%
Simplified15.3%
*-un-lft-identity15.3%
times-frac40.6%
associate-*l*40.5%
Applied egg-rr40.5%
*-lft-identity40.5%
unpow240.5%
associate-/l*43.6%
unpow243.6%
associate-/l*59.3%
Simplified59.3%
if 2e-257 < (*.f64 d d) < 9.99999999999999955e-7Initial program 37.9%
times-frac35.9%
fma-def35.9%
associate-/r*36.0%
difference-of-squares42.0%
Simplified45.7%
Taylor expanded in c0 around inf 51.7%
*-commutative51.7%
unpow251.7%
associate-/l/51.7%
associate-/r*53.7%
associate-/r*50.1%
unpow250.1%
associate-/l/48.3%
unpow248.3%
*-commutative48.3%
unpow248.3%
associate-*r*53.6%
*-commutative53.6%
Simplified53.6%
div-inv53.6%
associate-*l*53.6%
associate-*l*53.5%
Applied egg-rr53.5%
associate-*r*53.5%
unpow253.5%
associate-*r/53.5%
*-rgt-identity53.5%
unpow253.5%
associate-*r*53.5%
associate-*l*55.2%
Simplified55.2%
add-cbrt-cube48.9%
associate-*r*47.0%
associate-*l*47.0%
associate-*l/45.3%
Applied egg-rr55.4%
times-frac58.9%
*-commutative58.9%
associate-/l*58.9%
associate-/l*59.2%
*-commutative59.2%
*-commutative59.2%
associate-*r*60.9%
associate-/l*53.5%
metadata-eval53.5%
Simplified53.5%
if 9.99999999999999955e-7 < (*.f64 d d) < 1.00000000000000004e62Initial program 27.3%
Taylor expanded in c0 around -inf 13.4%
Taylor expanded in c0 around 0 47.7%
associate-*r/47.7%
unpow247.7%
*-commutative47.7%
unpow247.7%
associate-*r*47.9%
unpow247.9%
Simplified47.9%
*-un-lft-identity47.9%
times-frac47.9%
associate-*l*47.7%
Applied egg-rr47.7%
*-lft-identity47.7%
unpow247.7%
associate-/l*47.7%
unpow247.7%
associate-/l*49.1%
Simplified49.1%
Taylor expanded in D around 0 47.7%
associate-/l*47.7%
associate-/l/47.7%
unpow247.7%
unpow247.7%
associate-*r/49.2%
unpow249.2%
associate-/r/55.2%
associate-*l/55.5%
unpow255.5%
Simplified55.5%
if 1.00000000000000004e62 < (*.f64 d d) < 4.9999999999999998e86Initial program 55.9%
times-frac55.9%
fma-def55.9%
associate-/r*55.9%
difference-of-squares67.0%
Simplified67.0%
Taylor expanded in c0 around inf 56.1%
associate-/l*56.1%
unpow256.1%
associate-*r*67.2%
unpow267.2%
unpow267.2%
unswap-sqr78.3%
unpow278.3%
Simplified78.3%
if 4.9999999999999998e86 < (*.f64 d d) Initial program 21.0%
Taylor expanded in c0 around -inf 2.1%
Taylor expanded in c0 around 0 35.7%
associate-*r/35.7%
unpow235.7%
*-commutative35.7%
unpow235.7%
associate-*r*39.8%
unpow239.8%
Simplified39.8%
*-un-lft-identity39.8%
times-frac45.5%
associate-*l*40.7%
Applied egg-rr40.7%
*-lft-identity40.7%
unpow240.7%
associate-/l*40.2%
unpow240.2%
associate-/l*49.2%
Simplified49.2%
Taylor expanded in d around 0 52.3%
*-commutative52.3%
unpow252.3%
Simplified52.3%
Final simplification54.5%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= d -3.45e+44) (not (<= d -1.28e-85))) (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))) (* (/ (* d d) (* D D)) (/ (* c0 c0) (* h (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d <= -3.45e+44) || !(d <= -1.28e-85)) {
tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
} else {
tmp = ((d * d) / (D * D)) * ((c0 * c0) / (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) :: tmp
if ((d_1 <= (-3.45d+44)) .or. (.not. (d_1 <= (-1.28d-85)))) then
tmp = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
else
tmp = ((d_1 * d_1) / (d * d)) * ((c0 * c0) / (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 tmp;
if ((d <= -3.45e+44) || !(d <= -1.28e-85)) {
tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
} else {
tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d <= -3.45e+44) or not (d <= -1.28e-85): tmp = (0.25 / d) * (D / (d / (D * (h * (M * M))))) else: tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((d <= -3.45e+44) || !(d <= -1.28e-85)) tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M)))))); else tmp = Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d <= -3.45e+44) || ~((d <= -1.28e-85))) tmp = (0.25 / d) * (D / (d / (D * (h * (M * M))))); else tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[d, -3.45e+44], N[Not[LessEqual[d, -1.28e-85]], $MachinePrecision]], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.45 \cdot 10^{+44} \lor \neg \left(d \leq -1.28 \cdot 10^{-85}\right):\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\end{array}
\end{array}
if d < -3.4499999999999999e44 or -1.28000000000000002e-85 < d Initial program 19.8%
Taylor expanded in c0 around -inf 3.4%
Taylor expanded in c0 around 0 31.8%
associate-*r/31.8%
unpow231.8%
*-commutative31.8%
unpow231.8%
associate-*r*34.6%
unpow234.6%
Simplified34.6%
*-un-lft-identity34.6%
times-frac42.0%
associate-*l*38.7%
Applied egg-rr38.7%
*-lft-identity38.7%
unpow238.7%
associate-/l*38.8%
unpow238.8%
associate-/l*48.9%
Simplified48.9%
Taylor expanded in d around 0 50.5%
*-commutative50.5%
unpow250.5%
Simplified50.5%
if -3.4499999999999999e44 < d < -1.28000000000000002e-85Initial program 53.7%
times-frac53.7%
fma-def50.8%
associate-/r*50.9%
difference-of-squares54.0%
Simplified57.0%
Taylor expanded in c0 around inf 45.4%
times-frac45.4%
unpow245.4%
unpow245.4%
unpow245.4%
*-commutative45.4%
unpow245.4%
Simplified45.4%
Final simplification49.8%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= d -4.4e+58) (not (<= d -2.6e-135))) (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))) (/ (* d d) (/ (* h (* (* w D) (* w D))) (* c0 c0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d <= -4.4e+58) || !(d <= -2.6e-135)) {
tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
} else {
tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
}
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 <= (-4.4d+58)) .or. (.not. (d_1 <= (-2.6d-135)))) then
tmp = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
else
tmp = (d_1 * d_1) / ((h * ((w * d) * (w * d))) / (c0 * c0))
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 <= -4.4e+58) || !(d <= -2.6e-135)) {
tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
} else {
tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d <= -4.4e+58) or not (d <= -2.6e-135): tmp = (0.25 / d) * (D / (d / (D * (h * (M * M))))) else: tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0)) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((d <= -4.4e+58) || !(d <= -2.6e-135)) tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M)))))); else tmp = Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(w * D) * Float64(w * D))) / Float64(c0 * c0))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d <= -4.4e+58) || ~((d <= -2.6e-135))) tmp = (0.25 / d) * (D / (d / (D * (h * (M * M))))); else tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[d, -4.4e+58], N[Not[LessEqual[d, -2.6e-135]], $MachinePrecision]], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(w * D), $MachinePrecision] * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c0 * c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.4 \cdot 10^{+58} \lor \neg \left(d \leq -2.6 \cdot 10^{-135}\right):\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\
\end{array}
\end{array}
if d < -4.4000000000000001e58 or -2.60000000000000004e-135 < d Initial program 18.7%
Taylor expanded in c0 around -inf 3.1%
Taylor expanded in c0 around 0 31.8%
associate-*r/31.8%
unpow231.8%
*-commutative31.8%
unpow231.8%
associate-*r*34.7%
unpow234.7%
Simplified34.7%
*-un-lft-identity34.7%
times-frac42.5%
associate-*l*39.1%
Applied egg-rr39.1%
*-lft-identity39.1%
unpow239.1%
associate-/l*39.1%
unpow239.1%
associate-/l*49.5%
Simplified49.5%
Taylor expanded in d around 0 51.2%
*-commutative51.2%
unpow251.2%
Simplified51.2%
if -4.4000000000000001e58 < d < -2.60000000000000004e-135Initial program 49.5%
times-frac49.4%
fma-def47.3%
associate-/r*47.4%
difference-of-squares49.7%
Simplified52.0%
Taylor expanded in c0 around inf 43.7%
associate-/l*43.8%
unpow243.8%
associate-*r*48.1%
unpow248.1%
unpow248.1%
unswap-sqr59.0%
unpow259.0%
Simplified59.0%
Final simplification52.6%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* M M) 1e+185) (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D)))) (* (/ 0.25 d) (* D (/ (* D (* M M)) (/ d h))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1e+185) {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
} else {
tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if ((m * m) <= 1d+185) then
tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
else
tmp = (0.25d0 / d_1) * (d * ((d * (m * m)) / (d_1 / h)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((M * M) <= 1e+185) {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
} else {
tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (M * M) <= 1e+185: tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))) else: tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(M * M) <= 1e+185) tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D)))); else tmp = Float64(Float64(0.25 / d) * Float64(D * Float64(Float64(D * Float64(M * M)) / Float64(d / h)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((M * M) <= 1e+185) tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))); else tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1e+185], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 / d), $MachinePrecision] * N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 10^{+185}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 9.9999999999999998e184Initial program 29.4%
Taylor expanded in c0 around -inf 3.5%
Taylor expanded in c0 around 0 36.3%
associate-*r/36.3%
unpow236.3%
*-commutative36.3%
unpow236.3%
associate-*r*36.3%
unpow236.3%
Simplified36.3%
Taylor expanded in D around 0 36.3%
*-commutative36.3%
unpow236.3%
associate-/l*35.8%
unpow235.8%
unpow235.8%
times-frac47.9%
unpow247.9%
Simplified47.9%
unpow247.9%
Applied egg-rr47.9%
if 9.9999999999999998e184 < (*.f64 M M) Initial program 8.3%
Taylor expanded in c0 around -inf 3.5%
Taylor expanded in c0 around 0 10.8%
associate-*r/10.8%
unpow210.8%
*-commutative10.8%
unpow210.8%
associate-*r*21.0%
unpow221.0%
Simplified21.0%
*-un-lft-identity21.0%
times-frac33.0%
associate-*l*21.3%
Applied egg-rr21.3%
*-lft-identity21.3%
unpow221.3%
associate-/l*21.3%
unpow221.3%
associate-/l*39.7%
Simplified39.7%
Taylor expanded in D around 0 21.3%
associate-/l*21.3%
associate-/l/19.4%
unpow219.4%
unpow219.4%
associate-*r/32.9%
unpow232.9%
associate-/r/32.5%
associate-*l/36.0%
unpow236.0%
Simplified36.0%
Final simplification45.1%
(FPCore (c0 w h D d M) :precision binary64 (if (<= M -3.4e+134) 0.0 (* 0.25 (* (* h (* M M)) (* (/ D d) (/ D d))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= -3.4e+134) {
tmp = 0.0;
} else {
tmp = 0.25 * ((h * (M * M)) * ((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 <= (-3.4d+134)) then
tmp = 0.0d0
else
tmp = 0.25d0 * ((h * (m * m)) * ((d / d_1) * (d / 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 tmp;
if (M <= -3.4e+134) {
tmp = 0.0;
} else {
tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= -3.4e+134: tmp = 0.0 else: tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= -3.4e+134) tmp = 0.0; else tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) * 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 <= -3.4e+134) tmp = 0.0; else tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, -3.4e+134], 0.0, N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -3.4 \cdot 10^{+134}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\end{array}
\end{array}
if M < -3.40000000000000018e134Initial program 3.4%
times-frac3.4%
fma-def3.5%
associate-/r*3.5%
difference-of-squares24.7%
Simplified24.7%
Taylor expanded in c0 around -inf 0.2%
associate-*r*0.2%
distribute-rgt1-in0.2%
metadata-eval0.2%
mul0-lft15.9%
metadata-eval15.9%
mul0-lft0.0%
metadata-eval0.0%
distribute-lft1-in0.0%
*-commutative0.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft15.9%
Simplified15.9%
Taylor expanded in c0 around 0 22.9%
if -3.40000000000000018e134 < M Initial program 27.0%
Taylor expanded in c0 around -inf 3.4%
Taylor expanded in c0 around 0 33.6%
associate-*r/33.6%
unpow233.6%
*-commutative33.6%
unpow233.6%
associate-*r*33.6%
unpow233.6%
Simplified33.6%
Taylor expanded in D around 0 33.6%
associate-/l*32.7%
unpow232.7%
unpow232.7%
unpow232.7%
Simplified32.7%
Taylor expanded in D around 0 33.6%
*-commutative33.6%
unpow233.6%
associate-*r/32.6%
unpow232.6%
unpow232.6%
times-frac44.0%
Simplified44.0%
Final simplification41.6%
(FPCore (c0 w h D d M) :precision binary64 (if (<= M -6.4e+134) 0.0 (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= -6.4e+134) {
tmp = 0.0;
} else {
tmp = 0.25 * ((h * (M * M)) / ((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 <= (-6.4d+134)) then
tmp = 0.0d0
else
tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= -6.4e+134) {
tmp = 0.0;
} else {
tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= -6.4e+134: tmp = 0.0 else: tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= -6.4e+134) tmp = 0.0; else tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / 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 <= -6.4e+134) tmp = 0.0; else tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, -6.4e+134], 0.0, N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -6.4 \cdot 10^{+134}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\
\end{array}
\end{array}
if M < -6.4000000000000001e134Initial program 3.4%
times-frac3.4%
fma-def3.5%
associate-/r*3.5%
difference-of-squares24.7%
Simplified24.7%
Taylor expanded in c0 around -inf 0.2%
associate-*r*0.2%
distribute-rgt1-in0.2%
metadata-eval0.2%
mul0-lft15.9%
metadata-eval15.9%
mul0-lft0.0%
metadata-eval0.0%
distribute-lft1-in0.0%
*-commutative0.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft15.9%
Simplified15.9%
Taylor expanded in c0 around 0 22.9%
if -6.4000000000000001e134 < M Initial program 27.0%
Taylor expanded in c0 around -inf 3.4%
Taylor expanded in c0 around 0 33.6%
associate-*r/33.6%
unpow233.6%
*-commutative33.6%
unpow233.6%
associate-*r*33.6%
unpow233.6%
Simplified33.6%
Taylor expanded in D around 0 33.6%
*-commutative33.6%
unpow233.6%
associate-/l*32.7%
unpow232.7%
unpow232.7%
times-frac44.0%
unpow244.0%
Simplified44.0%
unpow244.0%
Applied egg-rr44.0%
Final simplification41.6%
(FPCore (c0 w h D d M) :precision binary64 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
return (0.25 / d) * (D / (d / (D * (h * (M * M)))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return (0.25 / d) * (D / (d / (D * (h * (M * M)))));
}
def code(c0, w, h, D, d, M): return (0.25 / d) * (D / (d / (D * (h * (M * M)))))
function code(c0, w, h, D, d, M) return Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M)))))) end
function tmp = code(c0, w, h, D, d, M) tmp = (0.25 / d) * (D / (d / (D * (h * (M * M))))); end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}
\end{array}
Initial program 24.3%
Taylor expanded in c0 around -inf 3.5%
Taylor expanded in c0 around 0 30.2%
associate-*r/30.2%
unpow230.2%
*-commutative30.2%
unpow230.2%
associate-*r*32.7%
unpow232.7%
Simplified32.7%
*-un-lft-identity32.7%
times-frac39.1%
associate-*l*36.2%
Applied egg-rr36.2%
*-lft-identity36.2%
unpow236.2%
associate-/l*36.3%
unpow236.3%
associate-/l*45.2%
Simplified45.2%
Taylor expanded in d around 0 46.6%
*-commutative46.6%
unpow246.6%
Simplified46.6%
Final simplification46.6%
(FPCore (c0 w h D d M) :precision binary64 0.0)
double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.0;
}
def code(c0, w, h, D, d, M): return 0.0
function code(c0, w, h, D, d, M) return 0.0 end
function tmp = code(c0, w, h, D, d, M) tmp = 0.0; end
code[c0_, w_, h_, D_, d_, M_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 24.3%
times-frac23.2%
fma-def22.4%
associate-/r*22.5%
difference-of-squares28.4%
Simplified31.2%
Taylor expanded in c0 around -inf 3.4%
associate-*r*3.4%
distribute-rgt1-in3.4%
metadata-eval3.4%
mul0-lft26.6%
metadata-eval26.6%
mul0-lft4.2%
metadata-eval4.2%
distribute-lft1-in4.2%
*-commutative4.2%
distribute-lft1-in4.2%
metadata-eval4.2%
mul0-lft26.6%
Simplified26.6%
Taylor expanded in c0 around 0 30.9%
Final simplification30.9%
herbie shell --seed 2023187
(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))))))