
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ d D) (sqrt (/ c0 (* w h)))))
(t_1 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_2 (* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
(if (<= t_2 -2e-105)
(* (pow t_0 2.0) (/ c0 w))
(if (<= t_2 1e-187)
t_2
(if (<= t_2 INFINITY) (pow (* t_0 (sqrt (/ c0 w))) 2.0) 0.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * sqrt((c0 / (w * h)));
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_2 = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -2e-105) {
tmp = pow(t_0, 2.0) * (c0 / w);
} else if (t_2 <= 1e-187) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = pow((t_0 * sqrt((c0 / w))), 2.0);
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (d / D) * Math.sqrt((c0 / (w * h)));
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_2 = (c0 / (2.0 * w)) * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -2e-105) {
tmp = Math.pow(t_0, 2.0) * (c0 / w);
} else if (t_2 <= 1e-187) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow((t_0 * Math.sqrt((c0 / w))), 2.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (d / D) * math.sqrt((c0 / (w * h))) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) t_2 = (c0 / (2.0 * w)) * (t_1 + math.sqrt(((t_1 * t_1) - (M * M)))) tmp = 0 if t_2 <= -2e-105: tmp = math.pow(t_0, 2.0) * (c0 / w) elif t_2 <= 1e-187: tmp = t_2 elif t_2 <= math.inf: tmp = math.pow((t_0 * math.sqrt((c0 / w))), 2.0) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(d / D) * sqrt(Float64(c0 / Float64(w * h)))) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_2 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) tmp = 0.0 if (t_2 <= -2e-105) tmp = Float64((t_0 ^ 2.0) * Float64(c0 / w)); elseif (t_2 <= 1e-187) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(t_0 * sqrt(Float64(c0 / w))) ^ 2.0; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) * sqrt((c0 / (w * h))); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); t_2 = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M)))); tmp = 0.0; if (t_2 <= -2e-105) tmp = (t_0 ^ 2.0) * (c0 / w); elseif (t_2 <= 1e-187) tmp = t_2; elseif (t_2 <= Inf) tmp = (t_0 * sqrt((c0 / w))) ^ 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[Sqrt[N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-105], N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-187], t$95$2, If[LessEqual[t$95$2, Infinity], N[Power[N[(t$95$0 * N[Sqrt[N[(c0 / w), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \sqrt{\frac{c0}{w \cdot h}}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_2 := \frac{c0}{2 \cdot w} \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M \cdot M}\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-105}:\\
\;\;\;\;{t\_0}^{2} \cdot \frac{c0}{w}\\
\mathbf{elif}\;t\_2 \leq 10^{-187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;{\left(t\_0 \cdot \sqrt{\frac{c0}{w}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -1.99999999999999993e-105Initial program 79.8%
Simplified81.9%
Taylor expanded in c0 around inf 81.5%
*-commutative81.5%
*-commutative81.5%
associate-*r*81.5%
associate-/r*81.4%
*-commutative81.4%
Simplified81.4%
pow181.4%
associate-*r*81.4%
associate-/l/81.4%
div-inv81.4%
metadata-eval81.4%
associate-/l/81.5%
*-commutative81.5%
Applied egg-rr81.5%
unpow181.5%
*-commutative81.5%
*-commutative81.5%
associate-*r*81.5%
*-commutative81.5%
times-frac81.9%
unpow281.9%
unpow281.9%
times-frac84.4%
unpow284.4%
associate-*l*84.4%
metadata-eval84.4%
*-rgt-identity84.4%
Simplified84.4%
add-sqr-sqrt84.4%
pow284.4%
div-inv84.4%
associate-*l/84.5%
clear-num84.4%
sqrt-prod84.4%
unpow284.4%
sqrt-prod53.7%
add-sqr-sqrt92.8%
Applied egg-rr92.8%
if -1.99999999999999993e-105 < (*.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))))) < 1e-187Initial program 69.4%
if 1e-187 < (*.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 69.2%
Simplified69.2%
Taylor expanded in c0 around inf 69.3%
*-commutative69.3%
*-commutative69.3%
associate-*r*66.5%
associate-/r*66.2%
*-commutative66.2%
Simplified66.2%
pow166.2%
associate-*r*66.2%
associate-/l/66.2%
div-inv66.2%
metadata-eval66.2%
associate-/l/66.5%
*-commutative66.5%
Applied egg-rr66.5%
unpow166.5%
*-commutative66.5%
*-commutative66.5%
associate-*r*69.3%
*-commutative69.3%
times-frac74.4%
unpow274.4%
unpow274.4%
times-frac81.8%
unpow281.8%
associate-*l*81.8%
metadata-eval81.8%
*-rgt-identity81.8%
Simplified71.2%
add-sqr-sqrt71.0%
pow271.0%
sqrt-prod71.1%
div-inv71.1%
associate-*l/81.7%
clear-num81.8%
sqrt-prod84.3%
unpow284.3%
sqrt-prod43.3%
add-sqr-sqrt94.4%
Applied egg-rr94.4%
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%
Simplified3.1%
Taylor expanded in c0 around -inf 3.1%
associate-*r*3.1%
neg-mul-13.1%
distribute-lft1-in3.1%
metadata-eval3.1%
mul0-lft38.6%
distribute-lft-neg-in38.6%
distribute-rgt-neg-in38.6%
metadata-eval38.6%
Simplified38.6%
Taylor expanded in c0 around 0 45.7%
Final simplification61.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_2 (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
(if (<= t_2 -2e-105)
(* (pow (* (/ d D) (sqrt (/ c0 (* w h)))) 2.0) (/ c0 w))
(if (<= t_2 1e-187)
t_2
(if (<= t_2 INFINITY)
(/ (* 2.0 t_0) (/ h (* (/ c0 w) (pow (/ d D) 2.0))))
0.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -2e-105) {
tmp = pow(((d / D) * sqrt((c0 / (w * h)))), 2.0) * (c0 / w);
} else if (t_2 <= 1e-187) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (2.0 * t_0) / (h / ((c0 / w) * pow((d / D), 2.0)));
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_2 = t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -2e-105) {
tmp = Math.pow(((d / D) * Math.sqrt((c0 / (w * h)))), 2.0) * (c0 / w);
} else if (t_2 <= 1e-187) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (2.0 * t_0) / (h / ((c0 / w) * Math.pow((d / D), 2.0)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) t_2 = t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M)))) tmp = 0 if t_2 <= -2e-105: tmp = math.pow(((d / D) * math.sqrt((c0 / (w * h)))), 2.0) * (c0 / w) elif t_2 <= 1e-187: tmp = t_2 elif t_2 <= math.inf: tmp = (2.0 * t_0) / (h / ((c0 / w) * math.pow((d / D), 2.0))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_2 = Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) tmp = 0.0 if (t_2 <= -2e-105) tmp = Float64((Float64(Float64(d / D) * sqrt(Float64(c0 / Float64(w * h)))) ^ 2.0) * Float64(c0 / w)); elseif (t_2 <= 1e-187) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(Float64(2.0 * t_0) / Float64(h / Float64(Float64(c0 / w) * (Float64(d / D) ^ 2.0)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M)))); tmp = 0.0; if (t_2 <= -2e-105) tmp = (((d / D) * sqrt((c0 / (w * h)))) ^ 2.0) * (c0 / w); elseif (t_2 <= 1e-187) tmp = t_2; elseif (t_2 <= Inf) tmp = (2.0 * t_0) / (h / ((c0 / w) * ((d / D) ^ 2.0))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-105], N[(N[Power[N[(N[(d / D), $MachinePrecision] * N[Sqrt[N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-187], t$95$2, If[LessEqual[t$95$2, Infinity], N[(N[(2.0 * t$95$0), $MachinePrecision] / N[(h / N[(N[(c0 / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_2 := t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M \cdot M}\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-105}:\\
\;\;\;\;{\left(\frac{d}{D} \cdot \sqrt{\frac{c0}{w \cdot h}}\right)}^{2} \cdot \frac{c0}{w}\\
\mathbf{elif}\;t\_2 \leq 10^{-187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{2 \cdot t\_0}{\frac{h}{\frac{c0}{w} \cdot {\left(\frac{d}{D}\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -1.99999999999999993e-105Initial program 79.8%
Simplified81.9%
Taylor expanded in c0 around inf 81.5%
*-commutative81.5%
*-commutative81.5%
associate-*r*81.5%
associate-/r*81.4%
*-commutative81.4%
Simplified81.4%
pow181.4%
associate-*r*81.4%
associate-/l/81.4%
div-inv81.4%
metadata-eval81.4%
associate-/l/81.5%
*-commutative81.5%
Applied egg-rr81.5%
unpow181.5%
*-commutative81.5%
*-commutative81.5%
associate-*r*81.5%
*-commutative81.5%
times-frac81.9%
unpow281.9%
unpow281.9%
times-frac84.4%
unpow284.4%
associate-*l*84.4%
metadata-eval84.4%
*-rgt-identity84.4%
Simplified84.4%
add-sqr-sqrt84.4%
pow284.4%
div-inv84.4%
associate-*l/84.5%
clear-num84.4%
sqrt-prod84.4%
unpow284.4%
sqrt-prod53.7%
add-sqr-sqrt92.8%
Applied egg-rr92.8%
if -1.99999999999999993e-105 < (*.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))))) < 1e-187Initial program 69.4%
if 1e-187 < (*.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 69.2%
Simplified69.2%
Taylor expanded in c0 around inf 69.3%
*-commutative69.3%
*-commutative69.3%
associate-*r*66.5%
associate-/r*66.2%
*-commutative66.2%
Simplified66.2%
clear-num66.2%
inv-pow66.2%
*-commutative66.2%
associate-/l*63.2%
Applied egg-rr63.2%
unpow-163.2%
associate-/l*68.6%
associate-/r/74.0%
Simplified74.0%
associate-*l/71.5%
un-div-inv71.5%
associate-/r/69.1%
associate-*l/69.1%
Applied egg-rr69.1%
times-frac66.5%
associate-*r/69.1%
associate-*l/69.1%
associate-*r/69.1%
associate-/r*69.1%
associate-*l/66.2%
associate-/l*71.6%
associate-/r*69.8%
times-frac76.9%
unpow276.9%
unpow276.9%
times-frac84.3%
unpow284.3%
*-commutative84.3%
Simplified84.3%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified3.1%
Taylor expanded in c0 around -inf 3.1%
associate-*r*3.1%
neg-mul-13.1%
distribute-lft1-in3.1%
metadata-eval3.1%
mul0-lft38.6%
distribute-lft-neg-in38.6%
distribute-rgt-neg-in38.6%
metadata-eval38.6%
Simplified38.6%
Taylor expanded in c0 around 0 45.7%
Final simplification59.7%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_2 (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
(if (<= t_2 1e-187)
t_2
(if (<= t_2 INFINITY)
(/ (* 2.0 t_0) (/ h (* (/ c0 w) (pow (/ d D) 2.0))))
0.0))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= 1e-187) {
tmp = t_2;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (2.0 * t_0) / (h / ((c0 / w) * pow((d / D), 2.0)));
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_2 = t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= 1e-187) {
tmp = t_2;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (2.0 * t_0) / (h / ((c0 / w) * Math.pow((d / D), 2.0)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) t_2 = t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M)))) tmp = 0 if t_2 <= 1e-187: tmp = t_2 elif t_2 <= math.inf: tmp = (2.0 * t_0) / (h / ((c0 / w) * math.pow((d / D), 2.0))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_2 = Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) tmp = 0.0 if (t_2 <= 1e-187) tmp = t_2; elseif (t_2 <= Inf) tmp = Float64(Float64(2.0 * t_0) / Float64(h / Float64(Float64(c0 / w) * (Float64(d / D) ^ 2.0)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M)))); tmp = 0.0; if (t_2 <= 1e-187) tmp = t_2; elseif (t_2 <= Inf) tmp = (2.0 * t_0) / (h / ((c0 / w) * ((d / D) ^ 2.0))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-187], t$95$2, If[LessEqual[t$95$2, Infinity], N[(N[(2.0 * t$95$0), $MachinePrecision] / N[(h / N[(N[(c0 / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_2 := t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M \cdot M}\right)\\
\mathbf{if}\;t\_2 \leq 10^{-187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{2 \cdot t\_0}{\frac{h}{\frac{c0}{w} \cdot {\left(\frac{d}{D}\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 1e-187Initial program 76.5%
if 1e-187 < (*.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 69.2%
Simplified69.2%
Taylor expanded in c0 around inf 69.3%
*-commutative69.3%
*-commutative69.3%
associate-*r*66.5%
associate-/r*66.2%
*-commutative66.2%
Simplified66.2%
clear-num66.2%
inv-pow66.2%
*-commutative66.2%
associate-/l*63.2%
Applied egg-rr63.2%
unpow-163.2%
associate-/l*68.6%
associate-/r/74.0%
Simplified74.0%
associate-*l/71.5%
un-div-inv71.5%
associate-/r/69.1%
associate-*l/69.1%
Applied egg-rr69.1%
times-frac66.5%
associate-*r/69.1%
associate-*l/69.1%
associate-*r/69.1%
associate-/r*69.1%
associate-*l/66.2%
associate-/l*71.6%
associate-/r*69.8%
times-frac76.9%
unpow276.9%
unpow276.9%
times-frac84.3%
unpow284.3%
*-commutative84.3%
Simplified84.3%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified3.1%
Taylor expanded in c0 around -inf 3.1%
associate-*r*3.1%
neg-mul-13.1%
distribute-lft1-in3.1%
metadata-eval3.1%
mul0-lft38.6%
distribute-lft-neg-in38.6%
distribute-rgt-neg-in38.6%
metadata-eval38.6%
Simplified38.6%
Taylor expanded in c0 around 0 45.7%
Final simplification57.8%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= c0 -1.5e+275)
(* (/ c0 w) (/ (* (/ d D) (/ d D)) (* w (/ h c0))))
(if (<= c0 -2.45e+247)
0.0
(if (or (<= c0 -4e-25) (not (<= c0 1.15e-55)))
(/ (* 2.0 (/ c0 (* 2.0 w))) (/ h (* (/ c0 w) (pow (/ d D) 2.0))))
(* -0.5 (/ (pow c0 2.0) (/ w 0.0)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (c0 <= -1.5e+275) {
tmp = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0)));
} else if (c0 <= -2.45e+247) {
tmp = 0.0;
} else if ((c0 <= -4e-25) || !(c0 <= 1.15e-55)) {
tmp = (2.0 * (c0 / (2.0 * w))) / (h / ((c0 / w) * pow((d / D), 2.0)));
} else {
tmp = -0.5 * (pow(c0, 2.0) / (w / 0.0));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: tmp
if (c0 <= (-1.5d+275)) then
tmp = (c0 / w) * (((d_1 / d) * (d_1 / d)) / (w * (h / c0)))
else if (c0 <= (-2.45d+247)) then
tmp = 0.0d0
else if ((c0 <= (-4d-25)) .or. (.not. (c0 <= 1.15d-55))) then
tmp = (2.0d0 * (c0 / (2.0d0 * w))) / (h / ((c0 / w) * ((d_1 / d) ** 2.0d0)))
else
tmp = (-0.5d0) * ((c0 ** 2.0d0) / (w / 0.0d0))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (c0 <= -1.5e+275) {
tmp = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0)));
} else if (c0 <= -2.45e+247) {
tmp = 0.0;
} else if ((c0 <= -4e-25) || !(c0 <= 1.15e-55)) {
tmp = (2.0 * (c0 / (2.0 * w))) / (h / ((c0 / w) * Math.pow((d / D), 2.0)));
} else {
tmp = -0.5 * (Math.pow(c0, 2.0) / (w / 0.0));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if c0 <= -1.5e+275: tmp = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0))) elif c0 <= -2.45e+247: tmp = 0.0 elif (c0 <= -4e-25) or not (c0 <= 1.15e-55): tmp = (2.0 * (c0 / (2.0 * w))) / (h / ((c0 / w) * math.pow((d / D), 2.0))) else: tmp = -0.5 * (math.pow(c0, 2.0) / (w / 0.0)) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (c0 <= -1.5e+275) tmp = Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / Float64(w * Float64(h / c0)))); elseif (c0 <= -2.45e+247) tmp = 0.0; elseif ((c0 <= -4e-25) || !(c0 <= 1.15e-55)) tmp = Float64(Float64(2.0 * Float64(c0 / Float64(2.0 * w))) / Float64(h / Float64(Float64(c0 / w) * (Float64(d / D) ^ 2.0)))); else tmp = Float64(-0.5 * Float64((c0 ^ 2.0) / Float64(w / 0.0))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (c0 <= -1.5e+275) tmp = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0))); elseif (c0 <= -2.45e+247) tmp = 0.0; elseif ((c0 <= -4e-25) || ~((c0 <= 1.15e-55))) tmp = (2.0 * (c0 / (2.0 * w))) / (h / ((c0 / w) * ((d / D) ^ 2.0))); else tmp = -0.5 * ((c0 ^ 2.0) / (w / 0.0)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[c0, -1.5e+275], N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(w * N[(h / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -2.45e+247], 0.0, If[Or[LessEqual[c0, -4e-25], N[Not[LessEqual[c0, 1.15e-55]], $MachinePrecision]], N[(N[(2.0 * N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(h / N[(N[(c0 / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[Power[c0, 2.0], $MachinePrecision] / N[(w / 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -1.5 \cdot 10^{+275}:\\
\;\;\;\;\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot \frac{h}{c0}}\\
\mathbf{elif}\;c0 \leq -2.45 \cdot 10^{+247}:\\
\;\;\;\;0\\
\mathbf{elif}\;c0 \leq -4 \cdot 10^{-25} \lor \neg \left(c0 \leq 1.15 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{2 \cdot \frac{c0}{2 \cdot w}}{\frac{h}{\frac{c0}{w} \cdot {\left(\frac{d}{D}\right)}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{{c0}^{2}}{\frac{w}{0}}\\
\end{array}
\end{array}
if c0 < -1.50000000000000002e275Initial program 31.1%
Simplified31.1%
Taylor expanded in c0 around inf 31.1%
*-commutative31.1%
*-commutative31.1%
associate-*r*31.1%
associate-/r*31.1%
*-commutative31.1%
Simplified31.1%
pow131.1%
associate-*r*31.1%
associate-/l/31.1%
div-inv31.1%
metadata-eval31.1%
associate-/l/31.1%
*-commutative31.1%
Applied egg-rr31.1%
unpow131.1%
*-commutative31.1%
*-commutative31.1%
associate-*r*31.1%
*-commutative31.1%
times-frac31.3%
unpow231.3%
unpow231.3%
times-frac60.5%
unpow260.5%
associate-*l*60.5%
metadata-eval60.5%
*-rgt-identity60.5%
Simplified70.3%
unpow270.3%
Applied egg-rr70.3%
if -1.50000000000000002e275 < c0 < -2.4499999999999999e247Initial program 12.5%
Simplified12.5%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
neg-mul-10.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft50.2%
distribute-lft-neg-in50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in c0 around 0 76.3%
if -2.4499999999999999e247 < c0 < -4.00000000000000015e-25 or 1.15000000000000006e-55 < c0 Initial program 28.4%
Simplified30.3%
Taylor expanded in c0 around inf 38.7%
*-commutative38.7%
*-commutative38.7%
associate-*r*38.6%
associate-/r*39.3%
*-commutative39.3%
Simplified39.3%
clear-num39.3%
inv-pow39.3%
*-commutative39.3%
associate-/l*39.9%
Applied egg-rr39.9%
unpow-139.9%
associate-/l*41.6%
associate-/r/42.3%
Simplified42.3%
associate-*l/41.0%
un-div-inv41.0%
associate-/r/41.5%
associate-*l/41.6%
Applied egg-rr41.6%
times-frac42.3%
associate-*r/41.6%
associate-*l/41.4%
associate-*r/41.4%
associate-/r*41.4%
associate-*l/39.3%
associate-/l*41.0%
associate-/r*40.9%
times-frac42.9%
unpow242.9%
unpow242.9%
times-frac54.0%
unpow254.0%
*-commutative54.0%
Simplified54.0%
if -4.00000000000000015e-25 < c0 < 1.15000000000000006e-55Initial program 23.2%
Taylor expanded in c0 around -inf 6.6%
associate-/l*6.6%
distribute-lft1-in6.6%
metadata-eval6.6%
mul0-lft53.4%
Simplified53.4%
Final simplification55.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* w (/ h c0))))
(if (<= c0 -6e+274)
(* (/ c0 w) (/ (* (/ d D) (/ d D)) t_0))
(if (<= c0 -6.2e+246)
0.0
(if (or (<= c0 -2.9e-29) (not (<= c0 6.6e-55)))
(/ (* (/ c0 w) (pow (/ d D) 2.0)) t_0)
(* -0.5 (/ (pow c0 2.0) (/ w 0.0))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = w * (h / c0);
double tmp;
if (c0 <= -6e+274) {
tmp = (c0 / w) * (((d / D) * (d / D)) / t_0);
} else if (c0 <= -6.2e+246) {
tmp = 0.0;
} else if ((c0 <= -2.9e-29) || !(c0 <= 6.6e-55)) {
tmp = ((c0 / w) * pow((d / D), 2.0)) / t_0;
} else {
tmp = -0.5 * (pow(c0, 2.0) / (w / 0.0));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = w * (h / c0)
if (c0 <= (-6d+274)) then
tmp = (c0 / w) * (((d_1 / d) * (d_1 / d)) / t_0)
else if (c0 <= (-6.2d+246)) then
tmp = 0.0d0
else if ((c0 <= (-2.9d-29)) .or. (.not. (c0 <= 6.6d-55))) then
tmp = ((c0 / w) * ((d_1 / d) ** 2.0d0)) / t_0
else
tmp = (-0.5d0) * ((c0 ** 2.0d0) / (w / 0.0d0))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = w * (h / c0);
double tmp;
if (c0 <= -6e+274) {
tmp = (c0 / w) * (((d / D) * (d / D)) / t_0);
} else if (c0 <= -6.2e+246) {
tmp = 0.0;
} else if ((c0 <= -2.9e-29) || !(c0 <= 6.6e-55)) {
tmp = ((c0 / w) * Math.pow((d / D), 2.0)) / t_0;
} else {
tmp = -0.5 * (Math.pow(c0, 2.0) / (w / 0.0));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = w * (h / c0) tmp = 0 if c0 <= -6e+274: tmp = (c0 / w) * (((d / D) * (d / D)) / t_0) elif c0 <= -6.2e+246: tmp = 0.0 elif (c0 <= -2.9e-29) or not (c0 <= 6.6e-55): tmp = ((c0 / w) * math.pow((d / D), 2.0)) / t_0 else: tmp = -0.5 * (math.pow(c0, 2.0) / (w / 0.0)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(w * Float64(h / c0)) tmp = 0.0 if (c0 <= -6e+274) tmp = Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / t_0)); elseif (c0 <= -6.2e+246) tmp = 0.0; elseif ((c0 <= -2.9e-29) || !(c0 <= 6.6e-55)) tmp = Float64(Float64(Float64(c0 / w) * (Float64(d / D) ^ 2.0)) / t_0); else tmp = Float64(-0.5 * Float64((c0 ^ 2.0) / Float64(w / 0.0))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = w * (h / c0); tmp = 0.0; if (c0 <= -6e+274) tmp = (c0 / w) * (((d / D) * (d / D)) / t_0); elseif (c0 <= -6.2e+246) tmp = 0.0; elseif ((c0 <= -2.9e-29) || ~((c0 <= 6.6e-55))) tmp = ((c0 / w) * ((d / D) ^ 2.0)) / t_0; else tmp = -0.5 * ((c0 ^ 2.0) / (w / 0.0)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(w * N[(h / c0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -6e+274], N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -6.2e+246], 0.0, If[Or[LessEqual[c0, -2.9e-29], N[Not[LessEqual[c0, 6.6e-55]], $MachinePrecision]], N[(N[(N[(c0 / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(-0.5 * N[(N[Power[c0, 2.0], $MachinePrecision] / N[(w / 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \frac{h}{c0}\\
\mathbf{if}\;c0 \leq -6 \cdot 10^{+274}:\\
\;\;\;\;\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{t\_0}\\
\mathbf{elif}\;c0 \leq -6.2 \cdot 10^{+246}:\\
\;\;\;\;0\\
\mathbf{elif}\;c0 \leq -2.9 \cdot 10^{-29} \lor \neg \left(c0 \leq 6.6 \cdot 10^{-55}\right):\\
\;\;\;\;\frac{\frac{c0}{w} \cdot {\left(\frac{d}{D}\right)}^{2}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{{c0}^{2}}{\frac{w}{0}}\\
\end{array}
\end{array}
if c0 < -5.99999999999999991e274Initial program 31.1%
Simplified31.1%
Taylor expanded in c0 around inf 31.1%
*-commutative31.1%
*-commutative31.1%
associate-*r*31.1%
associate-/r*31.1%
*-commutative31.1%
Simplified31.1%
pow131.1%
associate-*r*31.1%
associate-/l/31.1%
div-inv31.1%
metadata-eval31.1%
associate-/l/31.1%
*-commutative31.1%
Applied egg-rr31.1%
unpow131.1%
*-commutative31.1%
*-commutative31.1%
associate-*r*31.1%
*-commutative31.1%
times-frac31.3%
unpow231.3%
unpow231.3%
times-frac60.5%
unpow260.5%
associate-*l*60.5%
metadata-eval60.5%
*-rgt-identity60.5%
Simplified70.3%
unpow270.3%
Applied egg-rr70.3%
if -5.99999999999999991e274 < c0 < -6.19999999999999977e246Initial program 12.5%
Simplified12.5%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
neg-mul-10.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft50.2%
distribute-lft-neg-in50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in c0 around 0 76.3%
if -6.19999999999999977e246 < c0 < -2.90000000000000024e-29 or 6.5999999999999999e-55 < c0 Initial program 28.4%
Simplified30.3%
Taylor expanded in c0 around inf 38.7%
*-commutative38.7%
*-commutative38.7%
associate-*r*38.6%
associate-/r*39.3%
*-commutative39.3%
Simplified39.3%
pow139.3%
associate-*r*39.3%
associate-/l/39.3%
div-inv39.3%
metadata-eval39.3%
associate-/l/38.6%
*-commutative38.6%
Applied egg-rr38.6%
unpow138.6%
*-commutative38.6%
*-commutative38.6%
associate-*r*38.7%
*-commutative38.7%
times-frac40.2%
unpow240.2%
unpow240.2%
times-frac49.9%
unpow249.9%
associate-*l*49.9%
metadata-eval49.9%
*-rgt-identity49.9%
Simplified52.0%
associate-*l/52.0%
Applied egg-rr52.0%
if -2.90000000000000024e-29 < c0 < 6.5999999999999999e-55Initial program 23.2%
Taylor expanded in c0 around -inf 6.6%
associate-/l*6.6%
distribute-lft1-in6.6%
metadata-eval6.6%
mul0-lft53.4%
Simplified53.4%
Final simplification54.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* w (/ h c0))) (t_1 (pow (/ d D) 2.0)))
(if (<= c0 -1.65e+274)
(* (/ c0 w) (/ (* (/ d D) (/ d D)) t_0))
(if (<= c0 -6.5e+247)
0.0
(if (<= c0 -3.9e-29)
(/ (* (/ c0 w) t_1) t_0)
(if (<= c0 6.8e-56)
(* -0.5 (/ (pow c0 2.0) (/ w 0.0)))
(/ c0 (/ w (/ t_1 t_0)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = w * (h / c0);
double t_1 = pow((d / D), 2.0);
double tmp;
if (c0 <= -1.65e+274) {
tmp = (c0 / w) * (((d / D) * (d / D)) / t_0);
} else if (c0 <= -6.5e+247) {
tmp = 0.0;
} else if (c0 <= -3.9e-29) {
tmp = ((c0 / w) * t_1) / t_0;
} else if (c0 <= 6.8e-56) {
tmp = -0.5 * (pow(c0, 2.0) / (w / 0.0));
} else {
tmp = c0 / (w / (t_1 / 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) :: t_1
real(8) :: tmp
t_0 = w * (h / c0)
t_1 = (d_1 / d) ** 2.0d0
if (c0 <= (-1.65d+274)) then
tmp = (c0 / w) * (((d_1 / d) * (d_1 / d)) / t_0)
else if (c0 <= (-6.5d+247)) then
tmp = 0.0d0
else if (c0 <= (-3.9d-29)) then
tmp = ((c0 / w) * t_1) / t_0
else if (c0 <= 6.8d-56) then
tmp = (-0.5d0) * ((c0 ** 2.0d0) / (w / 0.0d0))
else
tmp = c0 / (w / (t_1 / 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 = w * (h / c0);
double t_1 = Math.pow((d / D), 2.0);
double tmp;
if (c0 <= -1.65e+274) {
tmp = (c0 / w) * (((d / D) * (d / D)) / t_0);
} else if (c0 <= -6.5e+247) {
tmp = 0.0;
} else if (c0 <= -3.9e-29) {
tmp = ((c0 / w) * t_1) / t_0;
} else if (c0 <= 6.8e-56) {
tmp = -0.5 * (Math.pow(c0, 2.0) / (w / 0.0));
} else {
tmp = c0 / (w / (t_1 / t_0));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = w * (h / c0) t_1 = math.pow((d / D), 2.0) tmp = 0 if c0 <= -1.65e+274: tmp = (c0 / w) * (((d / D) * (d / D)) / t_0) elif c0 <= -6.5e+247: tmp = 0.0 elif c0 <= -3.9e-29: tmp = ((c0 / w) * t_1) / t_0 elif c0 <= 6.8e-56: tmp = -0.5 * (math.pow(c0, 2.0) / (w / 0.0)) else: tmp = c0 / (w / (t_1 / t_0)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(w * Float64(h / c0)) t_1 = Float64(d / D) ^ 2.0 tmp = 0.0 if (c0 <= -1.65e+274) tmp = Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / t_0)); elseif (c0 <= -6.5e+247) tmp = 0.0; elseif (c0 <= -3.9e-29) tmp = Float64(Float64(Float64(c0 / w) * t_1) / t_0); elseif (c0 <= 6.8e-56) tmp = Float64(-0.5 * Float64((c0 ^ 2.0) / Float64(w / 0.0))); else tmp = Float64(c0 / Float64(w / Float64(t_1 / t_0))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = w * (h / c0); t_1 = (d / D) ^ 2.0; tmp = 0.0; if (c0 <= -1.65e+274) tmp = (c0 / w) * (((d / D) * (d / D)) / t_0); elseif (c0 <= -6.5e+247) tmp = 0.0; elseif (c0 <= -3.9e-29) tmp = ((c0 / w) * t_1) / t_0; elseif (c0 <= 6.8e-56) tmp = -0.5 * ((c0 ^ 2.0) / (w / 0.0)); else tmp = c0 / (w / (t_1 / t_0)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(w * N[(h / c0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[c0, -1.65e+274], N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -6.5e+247], 0.0, If[LessEqual[c0, -3.9e-29], N[(N[(N[(c0 / w), $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[c0, 6.8e-56], N[(-0.5 * N[(N[Power[c0, 2.0], $MachinePrecision] / N[(w / 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(w / N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \frac{h}{c0}\\
t_1 := {\left(\frac{d}{D}\right)}^{2}\\
\mathbf{if}\;c0 \leq -1.65 \cdot 10^{+274}:\\
\;\;\;\;\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{t\_0}\\
\mathbf{elif}\;c0 \leq -6.5 \cdot 10^{+247}:\\
\;\;\;\;0\\
\mathbf{elif}\;c0 \leq -3.9 \cdot 10^{-29}:\\
\;\;\;\;\frac{\frac{c0}{w} \cdot t\_1}{t\_0}\\
\mathbf{elif}\;c0 \leq 6.8 \cdot 10^{-56}:\\
\;\;\;\;-0.5 \cdot \frac{{c0}^{2}}{\frac{w}{0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{w}{\frac{t\_1}{t\_0}}}\\
\end{array}
\end{array}
if c0 < -1.65000000000000007e274Initial program 31.1%
Simplified31.1%
Taylor expanded in c0 around inf 31.1%
*-commutative31.1%
*-commutative31.1%
associate-*r*31.1%
associate-/r*31.1%
*-commutative31.1%
Simplified31.1%
pow131.1%
associate-*r*31.1%
associate-/l/31.1%
div-inv31.1%
metadata-eval31.1%
associate-/l/31.1%
*-commutative31.1%
Applied egg-rr31.1%
unpow131.1%
*-commutative31.1%
*-commutative31.1%
associate-*r*31.1%
*-commutative31.1%
times-frac31.3%
unpow231.3%
unpow231.3%
times-frac60.5%
unpow260.5%
associate-*l*60.5%
metadata-eval60.5%
*-rgt-identity60.5%
Simplified70.3%
unpow270.3%
Applied egg-rr70.3%
if -1.65000000000000007e274 < c0 < -6.50000000000000023e247Initial program 12.5%
Simplified12.5%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
neg-mul-10.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft50.2%
distribute-lft-neg-in50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in c0 around 0 76.3%
if -6.50000000000000023e247 < c0 < -3.8999999999999998e-29Initial program 30.2%
Simplified31.7%
Taylor expanded in c0 around inf 42.2%
*-commutative42.2%
*-commutative42.2%
associate-*r*43.7%
associate-/r*45.0%
*-commutative45.0%
Simplified45.0%
pow145.0%
associate-*r*45.0%
associate-/l/45.0%
div-inv45.0%
metadata-eval45.0%
associate-/l/43.7%
*-commutative43.7%
Applied egg-rr43.7%
unpow143.7%
*-commutative43.7%
*-commutative43.7%
associate-*r*42.2%
*-commutative42.2%
times-frac43.0%
unpow243.0%
unpow243.0%
times-frac50.8%
unpow250.8%
associate-*l*50.8%
metadata-eval50.8%
*-rgt-identity50.8%
Simplified55.0%
associate-*l/55.0%
Applied egg-rr55.0%
if -3.8999999999999998e-29 < c0 < 6.79999999999999964e-56Initial program 23.2%
Taylor expanded in c0 around -inf 6.6%
associate-/l*6.6%
distribute-lft1-in6.6%
metadata-eval6.6%
mul0-lft53.4%
Simplified53.4%
if 6.79999999999999964e-56 < c0 Initial program 26.9%
Simplified29.2%
Taylor expanded in c0 around inf 35.8%
*-commutative35.8%
*-commutative35.8%
associate-*r*34.4%
associate-/r*34.4%
*-commutative34.4%
Simplified34.4%
associate-*l/34.6%
associate-/l/34.6%
*-commutative34.6%
*-commutative34.6%
Applied egg-rr34.6%
associate-/l*35.8%
*-commutative35.8%
*-commutative35.8%
associate-*r*37.2%
times-frac37.2%
metadata-eval37.2%
*-commutative37.2%
times-frac39.0%
unpow239.0%
unpow239.0%
times-frac50.4%
unpow250.4%
associate-*r/48.2%
times-frac51.8%
associate-/r/53.0%
associate-/r/50.6%
Simplified50.6%
Final simplification54.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ c0 w) (/ (* (/ d D) (/ d D)) (* w (/ h c0))))))
(if (<= c0 -5.1e+277)
t_0
(if (<= c0 -5.5e+246)
0.0
(if (or (<= c0 -8.8e-29) (not (<= c0 2.7e-55)))
t_0
(* -0.5 (/ (pow c0 2.0) (/ w 0.0))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0)));
double tmp;
if (c0 <= -5.1e+277) {
tmp = t_0;
} else if (c0 <= -5.5e+246) {
tmp = 0.0;
} else if ((c0 <= -8.8e-29) || !(c0 <= 2.7e-55)) {
tmp = t_0;
} else {
tmp = -0.5 * (pow(c0, 2.0) / (w / 0.0));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (c0 / w) * (((d_1 / d) * (d_1 / d)) / (w * (h / c0)))
if (c0 <= (-5.1d+277)) then
tmp = t_0
else if (c0 <= (-5.5d+246)) then
tmp = 0.0d0
else if ((c0 <= (-8.8d-29)) .or. (.not. (c0 <= 2.7d-55))) then
tmp = t_0
else
tmp = (-0.5d0) * ((c0 ** 2.0d0) / (w / 0.0d0))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0)));
double tmp;
if (c0 <= -5.1e+277) {
tmp = t_0;
} else if (c0 <= -5.5e+246) {
tmp = 0.0;
} else if ((c0 <= -8.8e-29) || !(c0 <= 2.7e-55)) {
tmp = t_0;
} else {
tmp = -0.5 * (Math.pow(c0, 2.0) / (w / 0.0));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0))) tmp = 0 if c0 <= -5.1e+277: tmp = t_0 elif c0 <= -5.5e+246: tmp = 0.0 elif (c0 <= -8.8e-29) or not (c0 <= 2.7e-55): tmp = t_0 else: tmp = -0.5 * (math.pow(c0, 2.0) / (w / 0.0)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / Float64(w * Float64(h / c0)))) tmp = 0.0 if (c0 <= -5.1e+277) tmp = t_0; elseif (c0 <= -5.5e+246) tmp = 0.0; elseif ((c0 <= -8.8e-29) || !(c0 <= 2.7e-55)) tmp = t_0; else tmp = Float64(-0.5 * Float64((c0 ^ 2.0) / Float64(w / 0.0))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0))); tmp = 0.0; if (c0 <= -5.1e+277) tmp = t_0; elseif (c0 <= -5.5e+246) tmp = 0.0; elseif ((c0 <= -8.8e-29) || ~((c0 <= 2.7e-55))) tmp = t_0; else tmp = -0.5 * ((c0 ^ 2.0) / (w / 0.0)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(w * N[(h / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -5.1e+277], t$95$0, If[LessEqual[c0, -5.5e+246], 0.0, If[Or[LessEqual[c0, -8.8e-29], N[Not[LessEqual[c0, 2.7e-55]], $MachinePrecision]], t$95$0, N[(-0.5 * N[(N[Power[c0, 2.0], $MachinePrecision] / N[(w / 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot \frac{h}{c0}}\\
\mathbf{if}\;c0 \leq -5.1 \cdot 10^{+277}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;c0 \leq -5.5 \cdot 10^{+246}:\\
\;\;\;\;0\\
\mathbf{elif}\;c0 \leq -8.8 \cdot 10^{-29} \lor \neg \left(c0 \leq 2.7 \cdot 10^{-55}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{{c0}^{2}}{\frac{w}{0}}\\
\end{array}
\end{array}
if c0 < -5.0999999999999998e277 or -5.50000000000000028e246 < c0 < -8.79999999999999961e-29 or 2.70000000000000004e-55 < c0 Initial program 28.6%
Simplified30.4%
Taylor expanded in c0 around inf 38.2%
*-commutative38.2%
*-commutative38.2%
associate-*r*38.2%
associate-/r*38.7%
*-commutative38.7%
Simplified38.7%
pow138.7%
associate-*r*38.7%
associate-/l/38.7%
div-inv38.7%
metadata-eval38.7%
associate-/l/38.2%
*-commutative38.2%
Applied egg-rr38.2%
unpow138.2%
*-commutative38.2%
*-commutative38.2%
associate-*r*38.2%
*-commutative38.2%
times-frac39.6%
unpow239.6%
unpow239.6%
times-frac50.6%
unpow250.6%
associate-*l*50.6%
metadata-eval50.6%
*-rgt-identity50.6%
Simplified53.2%
unpow253.2%
Applied egg-rr53.2%
if -5.0999999999999998e277 < c0 < -5.50000000000000028e246Initial program 12.5%
Simplified12.5%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
neg-mul-10.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft50.2%
distribute-lft-neg-in50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in c0 around 0 76.3%
if -8.79999999999999961e-29 < c0 < 2.70000000000000004e-55Initial program 23.2%
Taylor expanded in c0 around -inf 6.6%
associate-/l*6.6%
distribute-lft1-in6.6%
metadata-eval6.6%
mul0-lft53.4%
Simplified53.4%
Final simplification54.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ c0 w) (/ (* (/ d D) (/ d D)) (* w (/ h c0))))))
(if (<= c0 -2.6e+273)
t_0
(if (<= c0 -4.1e+247)
0.0
(if (or (<= c0 -1.4e-26) (not (<= c0 2.65e-55)))
t_0
(* (/ c0 (* 2.0 w)) (* c0 0.0)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0)));
double tmp;
if (c0 <= -2.6e+273) {
tmp = t_0;
} else if (c0 <= -4.1e+247) {
tmp = 0.0;
} else if ((c0 <= -1.4e-26) || !(c0 <= 2.65e-55)) {
tmp = t_0;
} else {
tmp = (c0 / (2.0 * w)) * (c0 * 0.0);
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (c0 / w) * (((d_1 / d) * (d_1 / d)) / (w * (h / c0)))
if (c0 <= (-2.6d+273)) then
tmp = t_0
else if (c0 <= (-4.1d+247)) then
tmp = 0.0d0
else if ((c0 <= (-1.4d-26)) .or. (.not. (c0 <= 2.65d-55))) then
tmp = t_0
else
tmp = (c0 / (2.0d0 * w)) * (c0 * 0.0d0)
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0)));
double tmp;
if (c0 <= -2.6e+273) {
tmp = t_0;
} else if (c0 <= -4.1e+247) {
tmp = 0.0;
} else if ((c0 <= -1.4e-26) || !(c0 <= 2.65e-55)) {
tmp = t_0;
} else {
tmp = (c0 / (2.0 * w)) * (c0 * 0.0);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0))) tmp = 0 if c0 <= -2.6e+273: tmp = t_0 elif c0 <= -4.1e+247: tmp = 0.0 elif (c0 <= -1.4e-26) or not (c0 <= 2.65e-55): tmp = t_0 else: tmp = (c0 / (2.0 * w)) * (c0 * 0.0) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / w) * Float64(Float64(Float64(d / D) * Float64(d / D)) / Float64(w * Float64(h / c0)))) tmp = 0.0 if (c0 <= -2.6e+273) tmp = t_0; elseif (c0 <= -4.1e+247) tmp = 0.0; elseif ((c0 <= -1.4e-26) || !(c0 <= 2.65e-55)) tmp = t_0; else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(c0 * 0.0)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / w) * (((d / D) * (d / D)) / (w * (h / c0))); tmp = 0.0; if (c0 <= -2.6e+273) tmp = t_0; elseif (c0 <= -4.1e+247) tmp = 0.0; elseif ((c0 <= -1.4e-26) || ~((c0 <= 2.65e-55))) tmp = t_0; else tmp = (c0 / (2.0 * w)) * (c0 * 0.0); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(w * N[(h / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.6e+273], t$95$0, If[LessEqual[c0, -4.1e+247], 0.0, If[Or[LessEqual[c0, -1.4e-26], N[Not[LessEqual[c0, 2.65e-55]], $MachinePrecision]], t$95$0, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot \frac{h}{c0}}\\
\mathbf{if}\;c0 \leq -2.6 \cdot 10^{+273}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;c0 \leq -4.1 \cdot 10^{+247}:\\
\;\;\;\;0\\
\mathbf{elif}\;c0 \leq -1.4 \cdot 10^{-26} \lor \neg \left(c0 \leq 2.65 \cdot 10^{-55}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\
\end{array}
\end{array}
if c0 < -2.59999999999999993e273 or -4.1000000000000002e247 < c0 < -1.4000000000000001e-26 or 2.6500000000000001e-55 < c0 Initial program 28.6%
Simplified30.4%
Taylor expanded in c0 around inf 38.2%
*-commutative38.2%
*-commutative38.2%
associate-*r*38.2%
associate-/r*38.7%
*-commutative38.7%
Simplified38.7%
pow138.7%
associate-*r*38.7%
associate-/l/38.7%
div-inv38.7%
metadata-eval38.7%
associate-/l/38.2%
*-commutative38.2%
Applied egg-rr38.2%
unpow138.2%
*-commutative38.2%
*-commutative38.2%
associate-*r*38.2%
*-commutative38.2%
times-frac39.6%
unpow239.6%
unpow239.6%
times-frac50.6%
unpow250.6%
associate-*l*50.6%
metadata-eval50.6%
*-rgt-identity50.6%
Simplified53.2%
unpow253.2%
Applied egg-rr53.2%
if -2.59999999999999993e273 < c0 < -4.1000000000000002e247Initial program 12.5%
Simplified12.5%
Taylor expanded in c0 around -inf 0.0%
associate-*r*0.0%
neg-mul-10.0%
distribute-lft1-in0.0%
metadata-eval0.0%
mul0-lft50.2%
distribute-lft-neg-in50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in c0 around 0 76.3%
if -1.4000000000000001e-26 < c0 < 2.6500000000000001e-55Initial program 23.2%
Simplified23.3%
Taylor expanded in c0 around -inf 6.6%
associate-*r*6.6%
neg-mul-16.6%
distribute-lft1-in6.6%
metadata-eval6.6%
mul0-lft53.4%
distribute-lft-neg-in53.4%
distribute-rgt-neg-in53.4%
metadata-eval53.4%
Simplified53.4%
Final simplification54.0%
(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 26.1%
Simplified27.3%
Taylor expanded in c0 around -inf 6.0%
associate-*r*6.0%
neg-mul-16.0%
distribute-lft1-in6.0%
metadata-eval6.0%
mul0-lft30.0%
distribute-lft-neg-in30.0%
distribute-rgt-neg-in30.0%
metadata-eval30.0%
Simplified30.0%
Taylor expanded in c0 around 0 34.6%
Final simplification34.6%
herbie shell --seed 2024034
(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))))))