
(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 10 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 (* d d)) (* (* w h) (* D D))))
(t_1 (* (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))) (/ c0 (* 2.0 w)))))
(if (<= t_1 INFINITY) t_1 (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d))))))
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 t_1 = (t_0 + sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
}
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 t_1 = (t_0 + Math.sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) t_1 = (t_0 + math.sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d)) 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))) t_1 = Float64(Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))) * Float64(c0 / Float64(2.0 * w))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); t_1 = (t_0 + sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d)); 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]}, Block[{t$95$1 = N[(N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $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)}\\
t_1 := \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \cdot \frac{c0}{2 \cdot w}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\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 77.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.9%
fma-def1.9%
times-frac2.5%
*-commutative2.5%
unpow22.5%
unpow22.5%
unpow22.5%
associate-*r*2.5%
Simplified30.1%
Taylor expanded in c0 around 0 40.9%
unpow240.9%
unpow240.9%
unpow240.9%
Simplified40.9%
*-un-lft-identity40.9%
times-frac52.1%
Applied egg-rr52.1%
*-lft-identity52.1%
associate-/l*55.6%
unpow255.6%
associate-/l*56.8%
unpow256.8%
Simplified56.8%
associate-*l/58.0%
associate-/r/57.3%
Applied egg-rr57.3%
associate-/r/61.6%
unpow261.6%
associate-*l/61.9%
*-commutative61.9%
associate-/l*60.9%
associate-*r/61.3%
unpow261.3%
Simplified61.3%
Final simplification67.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))))
(if (<= (* d d) 2e-249)
(* 0.25 (/ (* D (* (* M M) (/ h d))) (/ d D)))
(if (<= (* d d) 8.5e-7)
(* t_0 (* 2.0 (* (/ c0 (* w h)) (* (/ d D) (/ d D)))))
(if (<= (* d d) 1e+295)
(* 0.25 (* (* D (* D (* h (* M M)))) (/ 1.0 (* d d))))
(* t_0 (* 2.0 (* (pow (/ d D) 2.0) (/ (/ c0 w) h)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double tmp;
if ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if ((d * d) <= 8.5e-7) {
tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))));
} else if ((d * d) <= 1e+295) {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
} else {
tmp = t_0 * (2.0 * (pow((d / D), 2.0) * ((c0 / w) / h)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
if ((d_1 * d_1) <= 2d-249) then
tmp = 0.25d0 * ((d * ((m * m) * (h / d_1))) / (d_1 / d))
else if ((d_1 * d_1) <= 8.5d-7) then
tmp = t_0 * (2.0d0 * ((c0 / (w * h)) * ((d_1 / d) * (d_1 / d))))
else if ((d_1 * d_1) <= 1d+295) then
tmp = 0.25d0 * ((d * (d * (h * (m * m)))) * (1.0d0 / (d_1 * d_1)))
else
tmp = t_0 * (2.0d0 * (((d_1 / d) ** 2.0d0) * ((c0 / w) / h)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double tmp;
if ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if ((d * d) <= 8.5e-7) {
tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))));
} else if ((d * d) <= 1e+295) {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
} else {
tmp = t_0 * (2.0 * (Math.pow((d / D), 2.0) * ((c0 / w) / h)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) tmp = 0 if (d * d) <= 2e-249: tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)) elif (d * d) <= 8.5e-7: tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D)))) elif (d * d) <= 1e+295: tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))) else: tmp = t_0 * (2.0 * (math.pow((d / D), 2.0) * ((c0 / w) / h))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (Float64(d * d) <= 2e-249) tmp = Float64(0.25 * Float64(Float64(D * Float64(Float64(M * M) * Float64(h / d))) / Float64(d / D))); elseif (Float64(d * d) <= 8.5e-7) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d / D) * Float64(d / D))))); elseif (Float64(d * d) <= 1e+295) tmp = Float64(0.25 * Float64(Float64(D * Float64(D * Float64(h * Float64(M * M)))) * Float64(1.0 / Float64(d * d)))); else tmp = Float64(t_0 * Float64(2.0 * Float64((Float64(d / D) ^ 2.0) * Float64(Float64(c0 / w) / h)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); tmp = 0.0; if ((d * d) <= 2e-249) tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)); elseif ((d * d) <= 8.5e-7) tmp = t_0 * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D)))); elseif ((d * d) <= 1e+295) tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))); else tmp = t_0 * (2.0 * (((d / D) ^ 2.0) * ((c0 / w) / h))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(d * d), $MachinePrecision], 2e-249], N[(0.25 * N[(N[(D * N[(N[(M * M), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 8.5e-7], N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e+295], N[(0.25 * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\
\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\
\mathbf{elif}\;d \cdot d \leq 10^{+295}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\
\end{array}
\end{array}
if (*.f64 d d) < 2.00000000000000011e-249Initial program 12.5%
Taylor expanded in c0 around -inf 2.7%
fma-def2.7%
times-frac2.7%
*-commutative2.7%
unpow22.7%
unpow22.7%
unpow22.7%
associate-*r*2.7%
Simplified12.9%
Taylor expanded in c0 around 0 17.5%
unpow217.5%
unpow217.5%
unpow217.5%
Simplified17.5%
*-un-lft-identity17.5%
times-frac41.1%
Applied egg-rr41.1%
*-lft-identity41.1%
associate-/l*56.7%
unpow256.7%
associate-/l*58.9%
unpow258.9%
Simplified58.9%
associate-*l/58.3%
associate-/r/60.3%
Applied egg-rr60.3%
if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7Initial program 48.9%
times-frac45.8%
fma-def45.7%
times-frac45.7%
difference-of-squares45.7%
Simplified48.9%
fma-udef49.0%
pow249.0%
associate-*l*49.0%
div-inv49.0%
clear-num48.9%
associate-*r/45.7%
*-commutative45.7%
Applied egg-rr51.8%
distribute-lft-in51.6%
*-commutative51.6%
associate-*l/51.6%
*-commutative51.6%
associate-*r/51.6%
associate-/l*51.7%
associate-*l/51.7%
Applied egg-rr51.7%
distribute-lft-out51.9%
times-frac51.8%
associate-/r/51.8%
associate-*l/51.8%
associate-*r/51.8%
times-frac52.0%
Simplified52.0%
Taylor expanded in c0 around inf 49.2%
times-frac52.3%
unpow252.3%
unpow252.3%
times-frac58.0%
unpow258.0%
Simplified58.0%
unpow243.3%
Applied egg-rr58.0%
if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294Initial program 26.8%
Taylor expanded in c0 around -inf 9.4%
fma-def9.4%
times-frac10.8%
*-commutative10.8%
unpow210.8%
unpow210.8%
unpow210.8%
associate-*r*10.8%
Simplified35.9%
Taylor expanded in c0 around 0 53.1%
unpow253.1%
unpow253.1%
unpow253.1%
Simplified53.1%
div-inv53.1%
associate-*l*56.3%
Applied egg-rr56.3%
if 9.9999999999999998e294 < (*.f64 d d) Initial program 26.9%
times-frac27.8%
fma-def27.8%
times-frac27.8%
difference-of-squares36.5%
Simplified36.5%
fma-udef36.5%
pow236.5%
associate-*l*36.5%
div-inv36.5%
clear-num36.5%
associate-*r/36.5%
*-commutative36.5%
Applied egg-rr43.3%
distribute-lft-in43.3%
*-commutative43.3%
associate-*l/42.4%
*-commutative42.4%
associate-*r/40.5%
associate-/l*42.4%
associate-*l/42.5%
Applied egg-rr42.5%
distribute-lft-out42.5%
times-frac41.5%
associate-/r/41.5%
associate-*l/40.5%
associate-*r/41.5%
times-frac41.5%
Simplified41.5%
Taylor expanded in c0 around inf 36.2%
times-frac37.2%
unpow237.2%
unpow237.2%
times-frac49.6%
unpow249.6%
Simplified49.6%
associate-*r/48.8%
Applied egg-rr48.8%
associate-*r/49.6%
associate-/r*49.7%
Simplified49.7%
Final simplification54.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (pow (/ d D) 2.0)))
(if (<= (* d d) 2e-249)
(* 0.25 (/ (* D (* (* M M) (/ h d))) (/ d D)))
(if (<= (* d d) 8.5e-7)
(/ (* c0 (* 2.0 (* t_0 (/ c0 (* w h))))) (* 2.0 w))
(if (<= (* d d) 1e+295)
(* 0.25 (* (* D (* D (* h (* M M)))) (/ 1.0 (* d d))))
(* (/ c0 (* 2.0 w)) (* 2.0 (* t_0 (/ (/ c0 w) h)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = pow((d / D), 2.0);
double tmp;
if ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if ((d * d) <= 8.5e-7) {
tmp = (c0 * (2.0 * (t_0 * (c0 / (w * h))))) / (2.0 * w);
} else if ((d * d) <= 1e+295) {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * ((c0 / w) / h)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (d_1 / d) ** 2.0d0
if ((d_1 * d_1) <= 2d-249) then
tmp = 0.25d0 * ((d * ((m * m) * (h / d_1))) / (d_1 / d))
else if ((d_1 * d_1) <= 8.5d-7) then
tmp = (c0 * (2.0d0 * (t_0 * (c0 / (w * h))))) / (2.0d0 * w)
else if ((d_1 * d_1) <= 1d+295) then
tmp = 0.25d0 * ((d * (d * (h * (m * m)))) * (1.0d0 / (d_1 * d_1)))
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (t_0 * ((c0 / w) / h)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = Math.pow((d / D), 2.0);
double tmp;
if ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if ((d * d) <= 8.5e-7) {
tmp = (c0 * (2.0 * (t_0 * (c0 / (w * h))))) / (2.0 * w);
} else if ((d * d) <= 1e+295) {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * ((c0 / w) / h)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = math.pow((d / D), 2.0) tmp = 0 if (d * d) <= 2e-249: tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)) elif (d * d) <= 8.5e-7: tmp = (c0 * (2.0 * (t_0 * (c0 / (w * h))))) / (2.0 * w) elif (d * d) <= 1e+295: tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))) else: tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * ((c0 / w) / h))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / D) ^ 2.0 tmp = 0.0 if (Float64(d * d) <= 2e-249) tmp = Float64(0.25 * Float64(Float64(D * Float64(Float64(M * M) * Float64(h / d))) / Float64(d / D))); elseif (Float64(d * d) <= 8.5e-7) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(t_0 * Float64(c0 / Float64(w * h))))) / Float64(2.0 * w)); elseif (Float64(d * d) <= 1e+295) tmp = Float64(0.25 * Float64(Float64(D * Float64(D * Float64(h * Float64(M * M)))) * Float64(1.0 / Float64(d * d)))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(t_0 * Float64(Float64(c0 / w) / h)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) ^ 2.0; tmp = 0.0; if ((d * d) <= 2e-249) tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)); elseif ((d * d) <= 8.5e-7) tmp = (c0 * (2.0 * (t_0 * (c0 / (w * h))))) / (2.0 * w); elseif ((d * d) <= 1e+295) tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))); else tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * ((c0 / w) / h))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(d * d), $MachinePrecision], 2e-249], N[(0.25 * N[(N[(D * N[(N[(M * M), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 8.5e-7], N[(N[(c0 * N[(2.0 * N[(t$95$0 * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e+295], N[(0.25 * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(t$95$0 * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\
\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(t_0 \cdot \frac{c0}{w \cdot h}\right)\right)}{2 \cdot w}\\
\mathbf{elif}\;d \cdot d \leq 10^{+295}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\
\end{array}
\end{array}
if (*.f64 d d) < 2.00000000000000011e-249Initial program 12.5%
Taylor expanded in c0 around -inf 2.7%
fma-def2.7%
times-frac2.7%
*-commutative2.7%
unpow22.7%
unpow22.7%
unpow22.7%
associate-*r*2.7%
Simplified12.9%
Taylor expanded in c0 around 0 17.5%
unpow217.5%
unpow217.5%
unpow217.5%
Simplified17.5%
*-un-lft-identity17.5%
times-frac41.1%
Applied egg-rr41.1%
*-lft-identity41.1%
associate-/l*56.7%
unpow256.7%
associate-/l*58.9%
unpow258.9%
Simplified58.9%
associate-*l/58.3%
associate-/r/60.3%
Applied egg-rr60.3%
if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7Initial program 48.9%
times-frac45.8%
fma-def45.7%
times-frac45.7%
difference-of-squares45.7%
Simplified48.9%
fma-udef49.0%
pow249.0%
associate-*l*49.0%
div-inv49.0%
clear-num48.9%
associate-*r/45.7%
*-commutative45.7%
Applied egg-rr51.8%
distribute-lft-in51.6%
*-commutative51.6%
associate-*l/51.6%
*-commutative51.6%
associate-*r/51.6%
associate-/l*51.7%
associate-*l/51.7%
Applied egg-rr51.7%
distribute-lft-out51.9%
times-frac51.8%
associate-/r/51.8%
associate-*l/51.8%
associate-*r/51.8%
times-frac52.0%
Simplified52.0%
Taylor expanded in c0 around inf 49.2%
times-frac52.3%
unpow252.3%
unpow252.3%
times-frac58.0%
unpow258.0%
Simplified58.0%
associate-*l/58.1%
*-commutative58.1%
Applied egg-rr58.1%
if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294Initial program 26.8%
Taylor expanded in c0 around -inf 9.4%
fma-def9.4%
times-frac10.8%
*-commutative10.8%
unpow210.8%
unpow210.8%
unpow210.8%
associate-*r*10.8%
Simplified35.9%
Taylor expanded in c0 around 0 53.1%
unpow253.1%
unpow253.1%
unpow253.1%
Simplified53.1%
div-inv53.1%
associate-*l*56.3%
Applied egg-rr56.3%
if 9.9999999999999998e294 < (*.f64 d d) Initial program 26.9%
times-frac27.8%
fma-def27.8%
times-frac27.8%
difference-of-squares36.5%
Simplified36.5%
fma-udef36.5%
pow236.5%
associate-*l*36.5%
div-inv36.5%
clear-num36.5%
associate-*r/36.5%
*-commutative36.5%
Applied egg-rr43.3%
distribute-lft-in43.3%
*-commutative43.3%
associate-*l/42.4%
*-commutative42.4%
associate-*r/40.5%
associate-/l*42.4%
associate-*l/42.5%
Applied egg-rr42.5%
distribute-lft-out42.5%
times-frac41.5%
associate-/r/41.5%
associate-*l/40.5%
associate-*r/41.5%
times-frac41.5%
Simplified41.5%
Taylor expanded in c0 around inf 36.2%
times-frac37.2%
unpow237.2%
unpow237.2%
times-frac49.6%
unpow249.6%
Simplified49.6%
associate-*r/48.8%
Applied egg-rr48.8%
associate-*r/49.6%
associate-/r*49.7%
Simplified49.7%
Final simplification54.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (pow (/ d D) 2.0)) (t_1 (/ c0 (* 2.0 w))))
(if (<= (* d d) 2e-249)
(* 0.25 (/ (* D (* (* M M) (/ h d))) (/ d D)))
(if (<= (* d d) 8.5e-7)
(* t_1 (* 2.0 (* t_0 (* c0 (/ 1.0 (* w h))))))
(if (<= (* d d) 1e+295)
(* 0.25 (* (* D (* D (* h (* M M)))) (/ 1.0 (* d d))))
(* t_1 (* 2.0 (* t_0 (/ (/ c0 w) h)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = pow((d / D), 2.0);
double t_1 = c0 / (2.0 * w);
double tmp;
if ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if ((d * d) <= 8.5e-7) {
tmp = t_1 * (2.0 * (t_0 * (c0 * (1.0 / (w * h)))));
} else if ((d * d) <= 1e+295) {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
} else {
tmp = t_1 * (2.0 * (t_0 * ((c0 / w) / h)));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (d_1 / d) ** 2.0d0
t_1 = c0 / (2.0d0 * w)
if ((d_1 * d_1) <= 2d-249) then
tmp = 0.25d0 * ((d * ((m * m) * (h / d_1))) / (d_1 / d))
else if ((d_1 * d_1) <= 8.5d-7) then
tmp = t_1 * (2.0d0 * (t_0 * (c0 * (1.0d0 / (w * h)))))
else if ((d_1 * d_1) <= 1d+295) then
tmp = 0.25d0 * ((d * (d * (h * (m * m)))) * (1.0d0 / (d_1 * d_1)))
else
tmp = t_1 * (2.0d0 * (t_0 * ((c0 / w) / h)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = Math.pow((d / D), 2.0);
double t_1 = c0 / (2.0 * w);
double tmp;
if ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if ((d * d) <= 8.5e-7) {
tmp = t_1 * (2.0 * (t_0 * (c0 * (1.0 / (w * h)))));
} else if ((d * d) <= 1e+295) {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
} else {
tmp = t_1 * (2.0 * (t_0 * ((c0 / w) / h)));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = math.pow((d / D), 2.0) t_1 = c0 / (2.0 * w) tmp = 0 if (d * d) <= 2e-249: tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)) elif (d * d) <= 8.5e-7: tmp = t_1 * (2.0 * (t_0 * (c0 * (1.0 / (w * h))))) elif (d * d) <= 1e+295: tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))) else: tmp = t_1 * (2.0 * (t_0 * ((c0 / w) / h))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / D) ^ 2.0 t_1 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (Float64(d * d) <= 2e-249) tmp = Float64(0.25 * Float64(Float64(D * Float64(Float64(M * M) * Float64(h / d))) / Float64(d / D))); elseif (Float64(d * d) <= 8.5e-7) tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(c0 * Float64(1.0 / Float64(w * h)))))); elseif (Float64(d * d) <= 1e+295) tmp = Float64(0.25 * Float64(Float64(D * Float64(D * Float64(h * Float64(M * M)))) * Float64(1.0 / Float64(d * d)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(Float64(c0 / w) / h)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) ^ 2.0; t_1 = c0 / (2.0 * w); tmp = 0.0; if ((d * d) <= 2e-249) tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)); elseif ((d * d) <= 8.5e-7) tmp = t_1 * (2.0 * (t_0 * (c0 * (1.0 / (w * h))))); elseif ((d * d) <= 1e+295) tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))); else tmp = t_1 * (2.0 * (t_0 * ((c0 / w) / h))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(d * d), $MachinePrecision], 2e-249], N[(0.25 * N[(N[(D * N[(N[(M * M), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 8.5e-7], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(c0 * N[(1.0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 1e+295], N[(0.25 * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
t_1 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\
\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \left(c0 \cdot \frac{1}{w \cdot h}\right)\right)\right)\\
\mathbf{elif}\;d \cdot d \leq 10^{+295}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\
\end{array}
\end{array}
if (*.f64 d d) < 2.00000000000000011e-249Initial program 12.5%
Taylor expanded in c0 around -inf 2.7%
fma-def2.7%
times-frac2.7%
*-commutative2.7%
unpow22.7%
unpow22.7%
unpow22.7%
associate-*r*2.7%
Simplified12.9%
Taylor expanded in c0 around 0 17.5%
unpow217.5%
unpow217.5%
unpow217.5%
Simplified17.5%
*-un-lft-identity17.5%
times-frac41.1%
Applied egg-rr41.1%
*-lft-identity41.1%
associate-/l*56.7%
unpow256.7%
associate-/l*58.9%
unpow258.9%
Simplified58.9%
associate-*l/58.3%
associate-/r/60.3%
Applied egg-rr60.3%
if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7Initial program 48.9%
times-frac45.8%
fma-def45.7%
times-frac45.7%
difference-of-squares45.7%
Simplified48.9%
fma-udef49.0%
pow249.0%
associate-*l*49.0%
div-inv49.0%
clear-num48.9%
associate-*r/45.7%
*-commutative45.7%
Applied egg-rr51.8%
distribute-lft-in51.6%
*-commutative51.6%
associate-*l/51.6%
*-commutative51.6%
associate-*r/51.6%
associate-/l*51.7%
associate-*l/51.7%
Applied egg-rr51.7%
distribute-lft-out51.9%
times-frac51.8%
associate-/r/51.8%
associate-*l/51.8%
associate-*r/51.8%
times-frac52.0%
Simplified52.0%
Taylor expanded in c0 around inf 49.2%
times-frac52.3%
unpow252.3%
unpow252.3%
times-frac58.0%
unpow258.0%
Simplified58.0%
div-inv58.2%
Applied egg-rr58.2%
if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294Initial program 26.8%
Taylor expanded in c0 around -inf 9.4%
fma-def9.4%
times-frac10.8%
*-commutative10.8%
unpow210.8%
unpow210.8%
unpow210.8%
associate-*r*10.8%
Simplified35.9%
Taylor expanded in c0 around 0 53.1%
unpow253.1%
unpow253.1%
unpow253.1%
Simplified53.1%
div-inv53.1%
associate-*l*56.3%
Applied egg-rr56.3%
if 9.9999999999999998e294 < (*.f64 d d) Initial program 26.9%
times-frac27.8%
fma-def27.8%
times-frac27.8%
difference-of-squares36.5%
Simplified36.5%
fma-udef36.5%
pow236.5%
associate-*l*36.5%
div-inv36.5%
clear-num36.5%
associate-*r/36.5%
*-commutative36.5%
Applied egg-rr43.3%
distribute-lft-in43.3%
*-commutative43.3%
associate-*l/42.4%
*-commutative42.4%
associate-*r/40.5%
associate-/l*42.4%
associate-*l/42.5%
Applied egg-rr42.5%
distribute-lft-out42.5%
times-frac41.5%
associate-/r/41.5%
associate-*l/40.5%
associate-*r/41.5%
times-frac41.5%
Simplified41.5%
Taylor expanded in c0 around inf 36.2%
times-frac37.2%
unpow237.2%
unpow237.2%
times-frac49.6%
unpow249.6%
Simplified49.6%
associate-*r/48.8%
Applied egg-rr48.8%
associate-*r/49.6%
associate-/r*49.7%
Simplified49.7%
Final simplification54.5%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= (* d d) 2e-249)
(* 0.25 (/ (* D (* (* M M) (/ h d))) (/ d D)))
(if (or (<= (* d d) 8.5e-7) (not (<= (* d d) 1e+295)))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 (* w h)) (* (/ d D) (/ d D)))))
(* 0.25 (* (* D (* D (* h (* M M)))) (/ 1.0 (* d d)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if (((d * d) <= 8.5e-7) || !((d * d) <= 1e+295)) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))));
} else {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.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) :: tmp
if ((d_1 * d_1) <= 2d-249) then
tmp = 0.25d0 * ((d * ((m * m) * (h / d_1))) / (d_1 / d))
else if (((d_1 * d_1) <= 8.5d-7) .or. (.not. ((d_1 * d_1) <= 1d+295))) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / (w * h)) * ((d_1 / d) * (d_1 / d))))
else
tmp = 0.25d0 * ((d * (d * (h * (m * m)))) * (1.0d0 / (d_1 * 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 ((d * d) <= 2e-249) {
tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
} else if (((d * d) <= 8.5e-7) || !((d * d) <= 1e+295)) {
tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))));
} else {
tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d * d) <= 2e-249: tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)) elif ((d * d) <= 8.5e-7) or not ((d * d) <= 1e+295): tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D)))) else: tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(d * d) <= 2e-249) tmp = Float64(0.25 * Float64(Float64(D * Float64(Float64(M * M) * Float64(h / d))) / Float64(d / D))); elseif ((Float64(d * d) <= 8.5e-7) || !(Float64(d * d) <= 1e+295)) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d / D) * Float64(d / D))))); else tmp = Float64(0.25 * Float64(Float64(D * Float64(D * Float64(h * Float64(M * M)))) * Float64(1.0 / Float64(d * d)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d * d) <= 2e-249) tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D)); elseif (((d * d) <= 8.5e-7) || ~(((d * d) <= 1e+295))) tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D)))); else tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(d * d), $MachinePrecision], 2e-249], N[(0.25 * N[(N[(D * N[(N[(M * M), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(d * d), $MachinePrecision], 8.5e-7], N[Not[LessEqual[N[(d * d), $MachinePrecision], 1e+295]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\
\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7} \lor \neg \left(d \cdot d \leq 10^{+295}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\
\end{array}
\end{array}
if (*.f64 d d) < 2.00000000000000011e-249Initial program 12.5%
Taylor expanded in c0 around -inf 2.7%
fma-def2.7%
times-frac2.7%
*-commutative2.7%
unpow22.7%
unpow22.7%
unpow22.7%
associate-*r*2.7%
Simplified12.9%
Taylor expanded in c0 around 0 17.5%
unpow217.5%
unpow217.5%
unpow217.5%
Simplified17.5%
*-un-lft-identity17.5%
times-frac41.1%
Applied egg-rr41.1%
*-lft-identity41.1%
associate-/l*56.7%
unpow256.7%
associate-/l*58.9%
unpow258.9%
Simplified58.9%
associate-*l/58.3%
associate-/r/60.3%
Applied egg-rr60.3%
if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7 or 9.9999999999999998e294 < (*.f64 d d) Initial program 32.2%
times-frac32.1%
fma-def32.1%
times-frac32.1%
difference-of-squares38.7%
Simplified39.5%
fma-udef39.5%
pow239.5%
associate-*l*39.5%
div-inv39.5%
clear-num39.5%
associate-*r/38.7%
*-commutative38.7%
Applied egg-rr45.3%
distribute-lft-in45.3%
*-commutative45.3%
associate-*l/44.6%
*-commutative44.6%
associate-*r/43.2%
associate-/l*44.6%
associate-*l/44.7%
Applied egg-rr44.7%
distribute-lft-out44.7%
times-frac44.0%
associate-/r/44.0%
associate-*l/43.2%
associate-*r/44.0%
times-frac44.0%
Simplified44.0%
Taylor expanded in c0 around inf 39.3%
times-frac40.8%
unpow240.8%
unpow240.8%
times-frac51.7%
unpow251.7%
Simplified51.7%
unpow239.4%
Applied egg-rr51.7%
if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294Initial program 26.8%
Taylor expanded in c0 around -inf 9.4%
fma-def9.4%
times-frac10.8%
*-commutative10.8%
unpow210.8%
unpow210.8%
unpow210.8%
associate-*r*10.8%
Simplified35.9%
Taylor expanded in c0 around 0 53.1%
unpow253.1%
unpow253.1%
unpow253.1%
Simplified53.1%
div-inv53.1%
associate-*l*56.3%
Applied egg-rr56.3%
Final simplification54.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d))))
(t_1 (* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w))))))
(if (<= D -1.4e+133)
t_1
(if (<= D -2.6e-89)
(* (/ c0 (* 2.0 w)) (* 2.0 (/ (/ (* d (* c0 d)) (* D D)) (* w h))))
(if (<= D -2.1e-273)
t_0
(if (<= D 1.28e-287)
(* (/ (* d d) (* D D)) (* (/ c0 h) (/ (/ c0 w) w)))
(if (<= D 2.2e+73) t_0 t_1)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
double t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
double tmp;
if (D <= -1.4e+133) {
tmp = t_1;
} else if (D <= -2.6e-89) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h)));
} else if (D <= -2.1e-273) {
tmp = t_0;
} else if (D <= 1.28e-287) {
tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w));
} else if (D <= 2.2e+73) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.25d0 * (d * (((d * (m * m)) / (d_1 / h)) / d_1))
t_1 = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (h * (w * w)))
if (d <= (-1.4d+133)) then
tmp = t_1
else if (d <= (-2.6d-89)) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 * (c0 * d_1)) / (d * d)) / (w * h)))
else if (d <= (-2.1d-273)) then
tmp = t_0
else if (d <= 1.28d-287) then
tmp = ((d_1 * d_1) / (d * d)) * ((c0 / h) * ((c0 / w) / w))
else if (d <= 2.2d+73) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
double t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
double tmp;
if (D <= -1.4e+133) {
tmp = t_1;
} else if (D <= -2.6e-89) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h)));
} else if (D <= -2.1e-273) {
tmp = t_0;
} else if (D <= 1.28e-287) {
tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w));
} else if (D <= 2.2e+73) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d)) t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))) tmp = 0 if D <= -1.4e+133: tmp = t_1 elif D <= -2.6e-89: tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h))) elif D <= -2.1e-273: tmp = t_0 elif D <= 1.28e-287: tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w)) elif D <= 2.2e+73: tmp = t_0 else: tmp = t_1 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d))) t_1 = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))) tmp = 0.0 if (D <= -1.4e+133) tmp = t_1; elseif (D <= -2.6e-89) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d * Float64(c0 * d)) / Float64(D * D)) / Float64(w * h)))); elseif (D <= -2.1e-273) tmp = t_0; elseif (D <= 1.28e-287) tmp = Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(Float64(c0 / h) * Float64(Float64(c0 / w) / w))); elseif (D <= 2.2e+73) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d)); t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))); tmp = 0.0; if (D <= -1.4e+133) tmp = t_1; elseif (D <= -2.6e-89) tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h))); elseif (D <= -2.1e-273) tmp = t_0; elseif (D <= 1.28e-287) tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w)); elseif (D <= 2.2e+73) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[D, -1.4e+133], t$95$1, If[LessEqual[D, -2.6e-89], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, -2.1e-273], t$95$0, If[LessEqual[D, 1.28e-287], N[(N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 2.2e+73], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\
t_1 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;D \leq -1.4 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;D \leq -2.6 \cdot 10^{-89}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d \cdot \left(c0 \cdot d\right)}{D \cdot D}}{w \cdot h}\right)\\
\mathbf{elif}\;D \leq -2.1 \cdot 10^{-273}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;D \leq 1.28 \cdot 10^{-287}:\\
\;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \left(\frac{c0}{h} \cdot \frac{\frac{c0}{w}}{w}\right)\\
\mathbf{elif}\;D \leq 2.2 \cdot 10^{+73}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if D < -1.40000000000000008e133 or 2.2e73 < D Initial program 22.9%
times-frac25.3%
fma-def22.9%
times-frac23.0%
difference-of-squares25.5%
Simplified25.7%
fma-udef28.1%
pow228.1%
associate-*l*25.6%
div-inv23.2%
clear-num23.2%
associate-*r/25.3%
*-commutative25.3%
Applied egg-rr41.1%
distribute-lft-in41.1%
*-commutative41.1%
associate-*l/38.7%
*-commutative38.7%
associate-*r/36.1%
associate-/l*36.3%
associate-*l/36.3%
Applied egg-rr36.3%
distribute-lft-out36.4%
times-frac36.2%
associate-/r/33.9%
associate-*l/33.6%
associate-*r/33.9%
times-frac38.8%
Simplified38.8%
Taylor expanded in c0 around inf 25.4%
times-frac28.2%
unpow228.2%
unpow228.2%
times-frac58.6%
unpow258.6%
unpow258.6%
*-commutative58.6%
unpow258.6%
Simplified58.6%
unpow258.6%
Applied egg-rr58.6%
if -1.40000000000000008e133 < D < -2.5999999999999999e-89Initial program 41.3%
times-frac39.2%
fma-def39.2%
times-frac39.2%
difference-of-squares46.0%
Simplified43.9%
fma-udef43.9%
pow243.9%
associate-*l*43.9%
div-inv43.9%
clear-num43.9%
associate-*r/46.0%
*-commutative46.0%
Applied egg-rr48.4%
Taylor expanded in c0 around inf 55.2%
associate-/r*55.4%
unpow255.4%
associate-*l*57.7%
unpow257.7%
Simplified57.7%
if -2.5999999999999999e-89 < D < -2.1000000000000002e-273 or 1.28e-287 < D < 2.2e73Initial program 21.1%
Taylor expanded in c0 around -inf 2.2%
fma-def2.2%
times-frac2.2%
*-commutative2.2%
unpow22.2%
unpow22.2%
unpow22.2%
associate-*r*2.2%
Simplified25.4%
Taylor expanded in c0 around 0 35.5%
unpow235.5%
unpow235.5%
unpow235.5%
Simplified35.5%
*-un-lft-identity35.5%
times-frac41.4%
Applied egg-rr41.4%
*-lft-identity41.4%
associate-/l*45.8%
unpow245.8%
associate-/l*47.2%
unpow247.2%
Simplified47.2%
associate-*l/48.5%
associate-/r/49.7%
Applied egg-rr49.7%
associate-/r/54.3%
unpow254.3%
associate-*l/53.3%
*-commutative53.3%
associate-/l*53.7%
associate-*r/52.8%
unpow252.8%
Simplified52.8%
if -2.1000000000000002e-273 < D < 1.28e-287Initial program 50.0%
times-frac50.0%
fma-def50.0%
times-frac50.0%
difference-of-squares50.0%
Simplified54.5%
fma-udef54.5%
pow254.5%
associate-*l*54.5%
div-inv54.5%
clear-num54.5%
associate-*r/50.0%
*-commutative50.0%
Applied egg-rr59.1%
distribute-lft-in59.1%
*-commutative59.1%
associate-*l/59.1%
*-commutative59.1%
associate-*r/54.5%
associate-/l*59.1%
associate-*l/59.1%
Applied egg-rr59.1%
distribute-lft-out59.1%
times-frac59.1%
associate-/r/59.1%
associate-*l/54.5%
associate-*r/59.1%
times-frac59.3%
Simplified59.3%
Taylor expanded in c0 around inf 50.4%
times-frac54.9%
unpow254.9%
unpow254.9%
times-frac59.5%
unpow259.5%
Simplified59.5%
Taylor expanded in c0 around 0 41.0%
times-frac45.5%
unpow245.5%
unpow245.5%
unpow245.5%
*-commutative45.5%
times-frac45.8%
unpow245.8%
associate-/r*50.4%
Simplified50.4%
Final simplification54.3%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* D D) 5e+140) (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d))) (* (* (/ 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 * D) <= 5e+140) {
tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
} 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 * d) <= 5d+140) then
tmp = 0.25d0 * (d * (((d * (m * m)) / (d_1 / h)) / d_1))
else
tmp = ((d_1 / d) * (d_1 / 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 * D) <= 5e+140) {
tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
} 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 * D) <= 5e+140: tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d)) 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 (Float64(D * D) <= 5e+140) tmp = Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d))); 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 * D) <= 5e+140) tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d)); else tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 5e+140], N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $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 \cdot D \leq 5 \cdot 10^{+140}:\\
\;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\end{array}
\end{array}
if (*.f64 D D) < 5.00000000000000008e140Initial program 27.8%
Taylor expanded in c0 around -inf 2.6%
fma-def2.6%
times-frac3.1%
*-commutative3.1%
unpow23.1%
unpow23.1%
unpow23.1%
associate-*r*3.1%
Simplified25.7%
Taylor expanded in c0 around 0 33.6%
unpow233.6%
unpow233.6%
unpow233.6%
Simplified33.6%
*-un-lft-identity33.6%
times-frac40.2%
Applied egg-rr40.2%
*-lft-identity40.2%
associate-/l*43.4%
unpow243.4%
associate-/l*43.9%
unpow243.9%
Simplified43.9%
associate-*l/45.4%
associate-/r/45.7%
Applied egg-rr45.7%
associate-/r/49.1%
unpow249.1%
associate-*l/50.3%
*-commutative50.3%
associate-/l*48.6%
associate-*r/48.0%
unpow248.0%
Simplified48.0%
if 5.00000000000000008e140 < (*.f64 D D) Initial program 25.6%
times-frac25.5%
fma-def23.5%
times-frac23.6%
difference-of-squares25.7%
Simplified25.9%
fma-udef28.0%
pow228.0%
associate-*l*25.9%
div-inv23.9%
clear-num23.9%
associate-*r/25.6%
*-commutative25.6%
Applied egg-rr40.8%
distribute-lft-in40.7%
*-commutative40.7%
associate-*l/38.7%
*-commutative38.7%
associate-*r/34.5%
associate-/l*36.7%
associate-*l/36.7%
Applied egg-rr36.7%
distribute-lft-out36.9%
times-frac36.7%
associate-/r/34.7%
associate-*l/32.5%
associate-*r/34.7%
times-frac38.8%
Simplified38.8%
Taylor expanded in c0 around inf 25.8%
times-frac26.0%
unpow226.0%
unpow226.0%
times-frac51.6%
unpow251.6%
unpow251.6%
*-commutative51.6%
unpow251.6%
Simplified51.6%
unpow251.6%
Applied egg-rr51.6%
Final simplification48.7%
(FPCore (c0 w h D d M) :precision binary64 (* 0.25 (* (/ D (/ d D)) (/ h (/ d (* M M))))))
double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * ((D / (d / D)) * (h / (d / (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 / (d_1 / d)) * (h / (d_1 / (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)) * (h / (d / (M * M))));
}
def code(c0, w, h, D, d, M): return 0.25 * ((D / (d / D)) * (h / (d / (M * M))))
function code(c0, w, h, D, d, M) return Float64(0.25 * Float64(Float64(D / Float64(d / D)) * Float64(h / Float64(d / Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) tmp = 0.25 * ((D / (d / D)) * (h / (d / (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(N[(D / N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(h / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)
\end{array}
Initial program 27.4%
Taylor expanded in c0 around -inf 4.5%
fma-def4.5%
times-frac4.9%
*-commutative4.9%
unpow24.9%
unpow24.9%
unpow24.9%
associate-*r*4.9%
Simplified24.2%
Taylor expanded in c0 around 0 31.7%
unpow231.7%
unpow231.7%
unpow231.7%
Simplified31.7%
*-un-lft-identity31.7%
times-frac39.2%
Applied egg-rr39.2%
*-lft-identity39.2%
associate-/l*41.4%
unpow241.4%
associate-/l*41.8%
unpow241.8%
Simplified41.8%
Final simplification41.8%
(FPCore (c0 w h D d M) :precision binary64 (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d))))
double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = 0.25d0 * (d * (((d * (m * m)) / (d_1 / h)) / d_1))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
}
def code(c0, w, h, D, d, M): return 0.25 * (D * (((D * (M * M)) / (d / h)) / d))
function code(c0, w, h, D, d, M) return Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d))) end
function tmp = code(c0, w, h, D, d, M) tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d)); end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)
\end{array}
Initial program 27.4%
Taylor expanded in c0 around -inf 4.5%
fma-def4.5%
times-frac4.9%
*-commutative4.9%
unpow24.9%
unpow24.9%
unpow24.9%
associate-*r*4.9%
Simplified24.2%
Taylor expanded in c0 around 0 31.7%
unpow231.7%
unpow231.7%
unpow231.7%
Simplified31.7%
*-un-lft-identity31.7%
times-frac39.2%
Applied egg-rr39.2%
*-lft-identity39.2%
associate-/l*41.4%
unpow241.4%
associate-/l*41.8%
unpow241.8%
Simplified41.8%
associate-*l/43.1%
associate-/r/42.6%
Applied egg-rr42.6%
associate-/r/45.4%
unpow245.4%
associate-*l/47.1%
*-commutative47.1%
associate-/l*44.9%
associate-*r/44.8%
unpow244.8%
Simplified44.8%
Final simplification44.8%
(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 27.4%
times-frac26.9%
fma-def26.1%
associate-/r*26.2%
difference-of-squares31.3%
Simplified37.5%
Taylor expanded in c0 around -inf 3.1%
associate-*r*3.1%
distribute-rgt1-in3.1%
metadata-eval3.1%
mul0-lft27.0%
metadata-eval27.0%
mul0-lft3.1%
metadata-eval3.1%
distribute-lft1-in3.1%
*-commutative3.1%
distribute-lft1-in3.1%
metadata-eval3.1%
mul0-lft27.0%
Simplified27.0%
Taylor expanded in c0 around 0 32.5%
Final simplification32.5%
herbie shell --seed 2023176
(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))))))