
(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 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ (* c0 (* d d)) (* (* D D) (* w h))))
(t_2 (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
(if (<= t_2 -5e-142)
(/ (/ (* 2.0 (pow (* c0 d) 2.0)) (* (pow D 2.0) (* w h))) (* 2.0 w))
(if (<= t_2 0.0)
(*
(/ (/ c0 w) 2.0)
(+
(* c0 0.0)
(*
0.5
(/ (* (* w h) (* (pow D 2.0) (pow M 2.0))) (* c0 (pow d 2.0))))))
(if (<= t_2 INFINITY)
(* t_0 (* 2.0 (/ c0 (* h (* 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)) / ((D * D) * (w * h));
double t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -5e-142) {
tmp = ((2.0 * pow((c0 * d), 2.0)) / (pow(D, 2.0) * (w * h))) / (2.0 * w);
} else if (t_2 <= 0.0) {
tmp = ((c0 / w) / 2.0) * ((c0 * 0.0) + (0.5 * (((w * h) * (pow(D, 2.0) * pow(M, 2.0))) / (c0 * pow(d, 2.0)))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * (c0 / (h * (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)) / ((D * D) * (w * h));
double t_2 = t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
double tmp;
if (t_2 <= -5e-142) {
tmp = ((2.0 * Math.pow((c0 * d), 2.0)) / (Math.pow(D, 2.0) * (w * h))) / (2.0 * w);
} else if (t_2 <= 0.0) {
tmp = ((c0 / w) / 2.0) * ((c0 * 0.0) + (0.5 * (((w * h) * (Math.pow(D, 2.0) * Math.pow(M, 2.0))) / (c0 * Math.pow(d, 2.0)))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (2.0 * (c0 / (h * (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)) / ((D * D) * (w * h)) t_2 = t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M)))) tmp = 0 if t_2 <= -5e-142: tmp = ((2.0 * math.pow((c0 * d), 2.0)) / (math.pow(D, 2.0) * (w * h))) / (2.0 * w) elif t_2 <= 0.0: tmp = ((c0 / w) / 2.0) * ((c0 * 0.0) + (0.5 * (((w * h) * (math.pow(D, 2.0) * math.pow(M, 2.0))) / (c0 * math.pow(d, 2.0))))) elif t_2 <= math.inf: tmp = t_0 * (2.0 * (c0 / (h * (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(D * D) * Float64(w * h))) t_2 = Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) tmp = 0.0 if (t_2 <= -5e-142) tmp = Float64(Float64(Float64(2.0 * (Float64(c0 * d) ^ 2.0)) / Float64((D ^ 2.0) * Float64(w * h))) / Float64(2.0 * w)); elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(c0 / w) / 2.0) * Float64(Float64(c0 * 0.0) + Float64(0.5 * Float64(Float64(Float64(w * h) * Float64((D ^ 2.0) * (M ^ 2.0))) / Float64(c0 * (d ^ 2.0)))))); elseif (t_2 <= Inf) tmp = Float64(t_0 * Float64(2.0 * Float64(c0 / Float64(h * Float64(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)) / ((D * D) * (w * h)); t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M)))); tmp = 0.0; if (t_2 <= -5e-142) tmp = ((2.0 * ((c0 * d) ^ 2.0)) / ((D ^ 2.0) * (w * h))) / (2.0 * w); elseif (t_2 <= 0.0) tmp = ((c0 / w) / 2.0) * ((c0 * 0.0) + (0.5 * (((w * h) * ((D ^ 2.0) * (M ^ 2.0))) / (c0 * (d ^ 2.0))))); elseif (t_2 <= Inf) tmp = t_0 * (2.0 * (c0 / (h * (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[(D * D), $MachinePrecision] * N[(w * h), $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, -5e-142], N[(N[(N[(2.0 * N[Power[N[(c0 * d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[D, 2.0], $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[(c0 / w), $MachinePrecision] / 2.0), $MachinePrecision] * N[(N[(c0 * 0.0), $MachinePrecision] + N[(0.5 * N[(N[(N[(w * h), $MachinePrecision] * N[(N[Power[D, 2.0], $MachinePrecision] * N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c0 * N[Power[d, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * N[(2.0 * N[(c0 / N[(h * N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $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(D \cdot D\right) \cdot \left(w \cdot h\right)}\\
t_2 := t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M \cdot M}\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-142}:\\
\;\;\;\;\frac{\frac{2 \cdot {\left(c0 \cdot d\right)}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}{2 \cdot w}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{c0}{w}}{2} \cdot \left(c0 \cdot 0 + 0.5 \cdot \frac{\left(w \cdot h\right) \cdot \left({D}^{2} \cdot {M}^{2}\right)}{c0 \cdot {d}^{2}}\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \frac{c0}{h \cdot \left(w \cdot {\left(\frac{d}{D}\right)}^{-2}\right)}\right)\\
\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))))) < -5.0000000000000002e-142Initial program 84.5%
Simplified81.3%
Taylor expanded in c0 around inf 87.5%
*-commutative87.5%
associate-/l/84.4%
associate-*l/84.4%
associate-/l*85.3%
associate-/r*85.3%
associate-/r*85.4%
*-commutative85.4%
associate-/l/85.4%
*-commutative85.4%
Simplified85.4%
associate-*l/85.4%
associate-/r*85.4%
clear-num84.3%
unpow284.3%
unpow284.3%
frac-times84.2%
pow284.2%
pow-flip85.4%
metadata-eval85.4%
*-commutative85.4%
Applied egg-rr85.4%
Taylor expanded in c0 around 0 81.0%
unpow281.0%
unpow281.0%
swap-sqr87.2%
unpow287.2%
associate-*r/87.2%
Simplified87.2%
if -5.0000000000000002e-142 < (*.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))))) < 0.0Initial program 44.4%
Simplified17.3%
Applied egg-rr15.1%
Taylor expanded in c0 around -inf 75.4%
associate-*r*75.4%
mul-1-neg75.4%
distribute-lft1-in75.4%
metadata-eval75.4%
mul0-lft75.4%
distribute-lft-neg-in75.4%
distribute-rgt-neg-in75.4%
metadata-eval75.4%
associate-*r*78.0%
Simplified78.0%
if 0.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))))) < +inf.0Initial program 79.6%
Simplified73.4%
Taylor expanded in c0 around inf 82.1%
*-commutative82.1%
associate-/l/81.1%
associate-*l/78.0%
associate-/l*77.1%
associate-/r*77.1%
associate-/r*80.0%
*-commutative80.0%
associate-/l/77.3%
*-commutative77.3%
Simplified77.3%
*-un-lft-identity77.3%
clear-num76.1%
unpow276.1%
unpow276.1%
frac-times76.1%
pow276.1%
pow-flip77.3%
metadata-eval77.3%
Applied egg-rr77.3%
*-lft-identity77.3%
Simplified77.3%
pow177.3%
associate-*l*82.1%
Applied egg-rr82.1%
unpow182.1%
*-commutative82.1%
Simplified82.1%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified2.2%
Taylor expanded in c0 around -inf 3.0%
associate-*r*3.0%
neg-mul-13.0%
distribute-lft1-in3.0%
metadata-eval3.0%
mul0-lft35.7%
distribute-lft-neg-in35.7%
distribute-rgt-neg-in35.7%
metadata-eval35.7%
Simplified35.7%
Taylor expanded in c0 around 0 45.9%
Final simplification56.8%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* c0 (* d d)) (* (* D D) (* w h))))
(t_1 (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
(if (<= t_1 INFINITY) t_1 0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((D * D) * (w * h));
double t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} 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 * (d * d)) / ((D * D) * (w * h));
double t_1 = (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((D * D) * (w * h)) t_1 = (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M)))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(D * D) * Float64(w * h))) t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((D * D) * (w * h)); t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, Infinity], t$95$1, 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\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))))) < +inf.0Initial program 76.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%
Simplified2.2%
Taylor expanded in c0 around -inf 3.0%
associate-*r*3.0%
neg-mul-13.0%
distribute-lft1-in3.0%
metadata-eval3.0%
mul0-lft35.7%
distribute-lft-neg-in35.7%
distribute-rgt-neg-in35.7%
metadata-eval35.7%
Simplified35.7%
Taylor expanded in c0 around 0 45.9%
Final simplification54.7%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 7.2e-247)
0.0
(if (or (<= M 2.25e-160) (not (<= M 5000000000.0)))
(* (/ c0 (* 2.0 w)) (* 2.0 (/ c0 (* h (* w (pow (/ d D) -2.0))))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 7.2e-247) {
tmp = 0.0;
} else if ((M <= 2.25e-160) || !(M <= 5000000000.0)) {
tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * pow((d / D), -2.0)))));
} else {
tmp = 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 (m <= 7.2d-247) then
tmp = 0.0d0
else if ((m <= 2.25d-160) .or. (.not. (m <= 5000000000.0d0))) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (c0 / (h * (w * ((d_1 / d) ** (-2.0d0))))))
else
tmp = 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 (M <= 7.2e-247) {
tmp = 0.0;
} else if ((M <= 2.25e-160) || !(M <= 5000000000.0)) {
tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * Math.pow((d / D), -2.0)))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 7.2e-247: tmp = 0.0 elif (M <= 2.25e-160) or not (M <= 5000000000.0): tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * math.pow((d / D), -2.0))))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 7.2e-247) tmp = 0.0; elseif ((M <= 2.25e-160) || !(M <= 5000000000.0)) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(c0 / Float64(h * Float64(w * (Float64(d / D) ^ -2.0)))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 7.2e-247) tmp = 0.0; elseif ((M <= 2.25e-160) || ~((M <= 5000000000.0))) tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * ((d / D) ^ -2.0))))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 7.2e-247], 0.0, If[Or[LessEqual[M, 2.25e-160], N[Not[LessEqual[M, 5000000000.0]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(c0 / N[(h * N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.2 \cdot 10^{-247}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 2.25 \cdot 10^{-160} \lor \neg \left(M \leq 5000000000\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{c0}{h \cdot \left(w \cdot {\left(\frac{d}{D}\right)}^{-2}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if M < 7.1999999999999994e-247 or 2.25000000000000013e-160 < M < 5e9Initial program 19.9%
Simplified20.5%
Taylor expanded in c0 around -inf 5.1%
associate-*r*5.1%
neg-mul-15.1%
distribute-lft1-in5.1%
metadata-eval5.1%
mul0-lft32.5%
distribute-lft-neg-in32.5%
distribute-rgt-neg-in32.5%
metadata-eval32.5%
Simplified32.5%
Taylor expanded in c0 around 0 41.9%
if 7.1999999999999994e-247 < M < 2.25000000000000013e-160 or 5e9 < M Initial program 27.9%
Simplified27.9%
Taylor expanded in c0 around inf 47.2%
*-commutative47.2%
associate-/l/47.1%
associate-*l/47.1%
associate-/l*47.1%
associate-/r*48.6%
associate-/r*50.0%
*-commutative50.0%
associate-/l/48.7%
*-commutative48.7%
Simplified48.7%
*-un-lft-identity48.7%
clear-num48.7%
unpow248.7%
unpow248.7%
frac-times59.2%
pow259.2%
pow-flip59.2%
metadata-eval59.2%
Applied egg-rr59.2%
*-lft-identity59.2%
Simplified59.2%
pow159.2%
associate-*l*60.7%
Applied egg-rr60.7%
unpow160.7%
*-commutative60.7%
Simplified60.7%
Final simplification47.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (pow (/ d D) -2.0)))
(if (<= M 3.2e-246)
0.0
(if (<= M 3.2e-160)
(* (/ c0 (* 2.0 w)) (* 2.0 (/ c0 (* h (* w t_0)))))
(if (<= M 98000000.0)
0.0
(/ (* c0 (* 2.0 (/ (/ c0 (* h t_0)) w))) (* 2.0 w)))))))
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 (M <= 3.2e-246) {
tmp = 0.0;
} else if (M <= 3.2e-160) {
tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0))));
} else if (M <= 98000000.0) {
tmp = 0.0;
} else {
tmp = (c0 * (2.0 * ((c0 / (h * t_0)) / w))) / (2.0 * w);
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (d_1 / d) ** (-2.0d0)
if (m <= 3.2d-246) then
tmp = 0.0d0
else if (m <= 3.2d-160) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (c0 / (h * (w * t_0))))
else if (m <= 98000000.0d0) then
tmp = 0.0d0
else
tmp = (c0 * (2.0d0 * ((c0 / (h * t_0)) / w))) / (2.0d0 * w)
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = Math.pow((d / D), -2.0);
double tmp;
if (M <= 3.2e-246) {
tmp = 0.0;
} else if (M <= 3.2e-160) {
tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0))));
} else if (M <= 98000000.0) {
tmp = 0.0;
} else {
tmp = (c0 * (2.0 * ((c0 / (h * t_0)) / w))) / (2.0 * w);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = math.pow((d / D), -2.0) tmp = 0 if M <= 3.2e-246: tmp = 0.0 elif M <= 3.2e-160: tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0)))) elif M <= 98000000.0: tmp = 0.0 else: tmp = (c0 * (2.0 * ((c0 / (h * t_0)) / w))) / (2.0 * w) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / D) ^ -2.0 tmp = 0.0 if (M <= 3.2e-246) tmp = 0.0; elseif (M <= 3.2e-160) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(c0 / Float64(h * Float64(w * t_0))))); elseif (M <= 98000000.0) tmp = 0.0; else tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(c0 / Float64(h * t_0)) / w))) / Float64(2.0 * w)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) ^ -2.0; tmp = 0.0; if (M <= 3.2e-246) tmp = 0.0; elseif (M <= 3.2e-160) tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0)))); elseif (M <= 98000000.0) tmp = 0.0; else tmp = (c0 * (2.0 * ((c0 / (h * t_0)) / w))) / (2.0 * w); 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[M, 3.2e-246], 0.0, If[LessEqual[M, 3.2e-160], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(c0 / N[(h * N[(w * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 98000000.0], 0.0, N[(N[(c0 * N[(2.0 * N[(N[(c0 / N[(h * t$95$0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{-2}\\
\mathbf{if}\;M \leq 3.2 \cdot 10^{-246}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 3.2 \cdot 10^{-160}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{c0}{h \cdot \left(w \cdot t\_0\right)}\right)\\
\mathbf{elif}\;M \leq 98000000:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{\frac{c0}{h \cdot t\_0}}{w}\right)}{2 \cdot w}\\
\end{array}
\end{array}
if M < 3.2000000000000001e-246 or 3.20000000000000009e-160 < M < 9.8e7Initial program 19.9%
Simplified20.5%
Taylor expanded in c0 around -inf 5.1%
associate-*r*5.1%
neg-mul-15.1%
distribute-lft1-in5.1%
metadata-eval5.1%
mul0-lft32.5%
distribute-lft-neg-in32.5%
distribute-rgt-neg-in32.5%
metadata-eval32.5%
Simplified32.5%
Taylor expanded in c0 around 0 41.9%
if 3.2000000000000001e-246 < M < 3.20000000000000009e-160Initial program 67.1%
Simplified67.1%
Taylor expanded in c0 around inf 56.4%
*-commutative56.4%
associate-/l/56.4%
associate-*l/56.4%
associate-/l*56.4%
associate-/r*56.4%
associate-/r*56.4%
*-commutative56.4%
associate-/l/56.4%
*-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
clear-num56.4%
unpow256.4%
unpow256.4%
frac-times61.9%
pow261.9%
pow-flip61.9%
metadata-eval61.9%
Applied egg-rr61.9%
*-lft-identity61.9%
Simplified61.9%
pow161.9%
associate-*l*67.4%
Applied egg-rr67.4%
unpow167.4%
*-commutative67.4%
Simplified67.4%
if 9.8e7 < M Initial program 14.1%
Simplified14.1%
Taylor expanded in c0 around inf 43.9%
*-commutative43.9%
associate-/l/43.9%
associate-*l/43.9%
associate-/l*43.9%
associate-/r*45.9%
associate-/r*47.8%
*-commutative47.8%
associate-/l/46.0%
*-commutative46.0%
Simplified46.0%
associate-*l/46.1%
associate-/r*47.8%
clear-num47.8%
unpow247.8%
unpow247.8%
frac-times59.9%
pow259.9%
pow-flip59.9%
metadata-eval59.9%
*-commutative59.9%
Applied egg-rr59.9%
Final simplification47.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (pow (/ d D) -2.0)))
(if (<= M 4e-248)
0.0
(if (<= M 2.8e-160)
(* (/ c0 (* 2.0 w)) (* 2.0 (/ c0 (* h (* w t_0)))))
(if (<= M 2450000000.0)
0.0
(/ (/ (* (* c0 2.0) (/ c0 (* h t_0))) w) (* 2.0 w)))))))
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 (M <= 4e-248) {
tmp = 0.0;
} else if (M <= 2.8e-160) {
tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0))));
} else if (M <= 2450000000.0) {
tmp = 0.0;
} else {
tmp = (((c0 * 2.0) * (c0 / (h * t_0))) / w) / (2.0 * w);
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (d_1 / d) ** (-2.0d0)
if (m <= 4d-248) then
tmp = 0.0d0
else if (m <= 2.8d-160) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (c0 / (h * (w * t_0))))
else if (m <= 2450000000.0d0) then
tmp = 0.0d0
else
tmp = (((c0 * 2.0d0) * (c0 / (h * t_0))) / w) / (2.0d0 * w)
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = Math.pow((d / D), -2.0);
double tmp;
if (M <= 4e-248) {
tmp = 0.0;
} else if (M <= 2.8e-160) {
tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0))));
} else if (M <= 2450000000.0) {
tmp = 0.0;
} else {
tmp = (((c0 * 2.0) * (c0 / (h * t_0))) / w) / (2.0 * w);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = math.pow((d / D), -2.0) tmp = 0 if M <= 4e-248: tmp = 0.0 elif M <= 2.8e-160: tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0)))) elif M <= 2450000000.0: tmp = 0.0 else: tmp = (((c0 * 2.0) * (c0 / (h * t_0))) / w) / (2.0 * w) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(d / D) ^ -2.0 tmp = 0.0 if (M <= 4e-248) tmp = 0.0; elseif (M <= 2.8e-160) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(c0 / Float64(h * Float64(w * t_0))))); elseif (M <= 2450000000.0) tmp = 0.0; else tmp = Float64(Float64(Float64(Float64(c0 * 2.0) * Float64(c0 / Float64(h * t_0))) / w) / Float64(2.0 * w)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (d / D) ^ -2.0; tmp = 0.0; if (M <= 4e-248) tmp = 0.0; elseif (M <= 2.8e-160) tmp = (c0 / (2.0 * w)) * (2.0 * (c0 / (h * (w * t_0)))); elseif (M <= 2450000000.0) tmp = 0.0; else tmp = (((c0 * 2.0) * (c0 / (h * t_0))) / w) / (2.0 * w); 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[M, 4e-248], 0.0, If[LessEqual[M, 2.8e-160], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(c0 / N[(h * N[(w * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2450000000.0], 0.0, N[(N[(N[(N[(c0 * 2.0), $MachinePrecision] * N[(c0 / N[(h * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{-2}\\
\mathbf{if}\;M \leq 4 \cdot 10^{-248}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 2.8 \cdot 10^{-160}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{c0}{h \cdot \left(w \cdot t\_0\right)}\right)\\
\mathbf{elif}\;M \leq 2450000000:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(c0 \cdot 2\right) \cdot \frac{c0}{h \cdot t\_0}}{w}}{2 \cdot w}\\
\end{array}
\end{array}
if M < 3.99999999999999992e-248 or 2.80000000000000016e-160 < M < 2.45e9Initial program 19.9%
Simplified20.5%
Taylor expanded in c0 around -inf 5.1%
associate-*r*5.1%
neg-mul-15.1%
distribute-lft1-in5.1%
metadata-eval5.1%
mul0-lft32.5%
distribute-lft-neg-in32.5%
distribute-rgt-neg-in32.5%
metadata-eval32.5%
Simplified32.5%
Taylor expanded in c0 around 0 41.9%
if 3.99999999999999992e-248 < M < 2.80000000000000016e-160Initial program 67.1%
Simplified67.1%
Taylor expanded in c0 around inf 56.4%
*-commutative56.4%
associate-/l/56.4%
associate-*l/56.4%
associate-/l*56.4%
associate-/r*56.4%
associate-/r*56.4%
*-commutative56.4%
associate-/l/56.4%
*-commutative56.4%
Simplified56.4%
*-un-lft-identity56.4%
clear-num56.4%
unpow256.4%
unpow256.4%
frac-times61.9%
pow261.9%
pow-flip61.9%
metadata-eval61.9%
Applied egg-rr61.9%
*-lft-identity61.9%
Simplified61.9%
pow161.9%
associate-*l*67.4%
Applied egg-rr67.4%
unpow167.4%
*-commutative67.4%
Simplified67.4%
if 2.45e9 < M Initial program 14.1%
Simplified14.1%
Taylor expanded in c0 around inf 43.9%
*-commutative43.9%
associate-/l/43.9%
associate-*l/43.9%
associate-/l*43.9%
associate-/r*45.9%
associate-/r*47.8%
*-commutative47.8%
associate-/l/46.0%
*-commutative46.0%
Simplified46.0%
associate-*l/46.1%
associate-/r*47.8%
clear-num47.8%
unpow247.8%
unpow247.8%
frac-times59.9%
pow259.9%
pow-flip59.9%
metadata-eval59.9%
*-commutative59.9%
Applied egg-rr59.9%
pow159.9%
associate-*r*59.9%
associate-/r*60.0%
Applied egg-rr60.0%
unpow160.0%
associate-*r/60.1%
associate-/l/60.0%
*-commutative60.0%
Simplified60.0%
Final simplification47.3%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 7.5e-249)
0.0
(if (or (<= M 2.2e-160) (not (<= M 1500000000.0)))
(* (/ c0 w) (/ (/ (/ c0 h) (pow (/ d D) -2.0)) w))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 7.5e-249) {
tmp = 0.0;
} else if ((M <= 2.2e-160) || !(M <= 1500000000.0)) {
tmp = (c0 / w) * (((c0 / h) / pow((d / D), -2.0)) / w);
} else {
tmp = 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 (m <= 7.5d-249) then
tmp = 0.0d0
else if ((m <= 2.2d-160) .or. (.not. (m <= 1500000000.0d0))) then
tmp = (c0 / w) * (((c0 / h) / ((d_1 / d) ** (-2.0d0))) / w)
else
tmp = 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 (M <= 7.5e-249) {
tmp = 0.0;
} else if ((M <= 2.2e-160) || !(M <= 1500000000.0)) {
tmp = (c0 / w) * (((c0 / h) / Math.pow((d / D), -2.0)) / w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 7.5e-249: tmp = 0.0 elif (M <= 2.2e-160) or not (M <= 1500000000.0): tmp = (c0 / w) * (((c0 / h) / math.pow((d / D), -2.0)) / w) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 7.5e-249) tmp = 0.0; elseif ((M <= 2.2e-160) || !(M <= 1500000000.0)) tmp = Float64(Float64(c0 / w) * Float64(Float64(Float64(c0 / h) / (Float64(d / D) ^ -2.0)) / w)); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 7.5e-249) tmp = 0.0; elseif ((M <= 2.2e-160) || ~((M <= 1500000000.0))) tmp = (c0 / w) * (((c0 / h) / ((d / D) ^ -2.0)) / w); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 7.5e-249], 0.0, If[Or[LessEqual[M, 2.2e-160], N[Not[LessEqual[M, 1500000000.0]], $MachinePrecision]], N[(N[(c0 / w), $MachinePrecision] * N[(N[(N[(c0 / h), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.5 \cdot 10^{-249}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 2.2 \cdot 10^{-160} \lor \neg \left(M \leq 1500000000\right):\\
\;\;\;\;\frac{c0}{w} \cdot \frac{\frac{\frac{c0}{h}}{{\left(\frac{d}{D}\right)}^{-2}}}{w}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if M < 7.50000000000000034e-249 or 2.2e-160 < M < 1.5e9Initial program 19.9%
Simplified20.5%
Taylor expanded in c0 around -inf 5.1%
associate-*r*5.1%
neg-mul-15.1%
distribute-lft1-in5.1%
metadata-eval5.1%
mul0-lft32.5%
distribute-lft-neg-in32.5%
distribute-rgt-neg-in32.5%
metadata-eval32.5%
Simplified32.5%
Taylor expanded in c0 around 0 41.9%
if 7.50000000000000034e-249 < M < 2.2e-160 or 1.5e9 < M Initial program 27.9%
Simplified27.9%
Taylor expanded in c0 around inf 47.2%
*-commutative47.2%
associate-/l/47.1%
associate-*l/47.1%
associate-/l*47.1%
associate-/r*48.6%
associate-/r*50.0%
*-commutative50.0%
associate-/l/48.7%
*-commutative48.7%
Simplified48.7%
*-un-lft-identity48.7%
clear-num48.7%
unpow248.7%
unpow248.7%
frac-times59.2%
pow259.2%
pow-flip59.2%
metadata-eval59.2%
Applied egg-rr59.2%
*-lft-identity59.2%
Simplified59.2%
pow159.2%
associate-*r*59.2%
associate-/l/59.2%
div-inv59.2%
metadata-eval59.2%
associate-/r*60.4%
associate-/r*60.5%
Applied egg-rr60.5%
unpow160.5%
*-commutative60.5%
associate-*l*60.5%
metadata-eval60.5%
*-rgt-identity60.5%
Simplified60.5%
Final simplification46.9%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= M 5e-248)
0.0
(if (or (<= M 1.9e-160) (not (<= M 21500000.0)))
(* (/ c0 w) (/ (/ c0 h) (* w (pow (/ d D) -2.0))))
0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= 5e-248) {
tmp = 0.0;
} else if ((M <= 1.9e-160) || !(M <= 21500000.0)) {
tmp = (c0 / w) * ((c0 / h) / (w * pow((d / D), -2.0)));
} else {
tmp = 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 (m <= 5d-248) then
tmp = 0.0d0
else if ((m <= 1.9d-160) .or. (.not. (m <= 21500000.0d0))) then
tmp = (c0 / w) * ((c0 / h) / (w * ((d_1 / d) ** (-2.0d0))))
else
tmp = 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 (M <= 5e-248) {
tmp = 0.0;
} else if ((M <= 1.9e-160) || !(M <= 21500000.0)) {
tmp = (c0 / w) * ((c0 / h) / (w * Math.pow((d / D), -2.0)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if M <= 5e-248: tmp = 0.0 elif (M <= 1.9e-160) or not (M <= 21500000.0): tmp = (c0 / w) * ((c0 / h) / (w * math.pow((d / D), -2.0))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (M <= 5e-248) tmp = 0.0; elseif ((M <= 1.9e-160) || !(M <= 21500000.0)) tmp = Float64(Float64(c0 / w) * Float64(Float64(c0 / h) / Float64(w * (Float64(d / D) ^ -2.0)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if (M <= 5e-248) tmp = 0.0; elseif ((M <= 1.9e-160) || ~((M <= 21500000.0))) tmp = (c0 / w) * ((c0 / h) / (w * ((d / D) ^ -2.0))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 5e-248], 0.0, If[Or[LessEqual[M, 1.9e-160], N[Not[LessEqual[M, 21500000.0]], $MachinePrecision]], N[(N[(c0 / w), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] / N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5 \cdot 10^{-248}:\\
\;\;\;\;0\\
\mathbf{elif}\;M \leq 1.9 \cdot 10^{-160} \lor \neg \left(M \leq 21500000\right):\\
\;\;\;\;\frac{c0}{w} \cdot \frac{\frac{c0}{h}}{w \cdot {\left(\frac{d}{D}\right)}^{-2}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if M < 5.0000000000000001e-248 or 1.8999999999999999e-160 < M < 2.15e7Initial program 19.9%
Simplified20.5%
Taylor expanded in c0 around -inf 5.1%
associate-*r*5.1%
neg-mul-15.1%
distribute-lft1-in5.1%
metadata-eval5.1%
mul0-lft32.5%
distribute-lft-neg-in32.5%
distribute-rgt-neg-in32.5%
metadata-eval32.5%
Simplified32.5%
Taylor expanded in c0 around 0 41.9%
if 5.0000000000000001e-248 < M < 1.8999999999999999e-160 or 2.15e7 < M Initial program 27.9%
Simplified27.9%
Taylor expanded in c0 around inf 47.2%
*-commutative47.2%
associate-/l/47.1%
associate-*l/47.1%
associate-/l*47.1%
associate-/r*48.6%
associate-/r*50.0%
*-commutative50.0%
associate-/l/48.7%
*-commutative48.7%
Simplified48.7%
*-un-lft-identity48.7%
clear-num48.7%
unpow248.7%
unpow248.7%
frac-times59.2%
pow259.2%
pow-flip59.2%
metadata-eval59.2%
Applied egg-rr59.2%
*-lft-identity59.2%
Simplified59.2%
pow159.2%
associate-*r*59.2%
associate-/l/59.2%
div-inv59.2%
metadata-eval59.2%
associate-/r*60.4%
associate-/r*60.5%
Applied egg-rr60.5%
unpow160.5%
*-commutative60.5%
associate-/l/60.5%
associate-*l*60.5%
metadata-eval60.5%
Simplified60.5%
Final simplification46.9%
(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 22.1%
Simplified22.5%
Taylor expanded in c0 around -inf 4.5%
associate-*r*4.5%
neg-mul-14.5%
distribute-lft1-in4.5%
metadata-eval4.5%
mul0-lft28.1%
distribute-lft-neg-in28.1%
distribute-rgt-neg-in28.1%
metadata-eval28.1%
Simplified28.1%
Taylor expanded in c0 around 0 35.4%
Final simplification35.4%
herbie shell --seed 2024030
(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))))))