
(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 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M))))) INFINITY)
(* t_0 (* 2.0 (* (/ (* c0 d) D) (/ d (* h (* w D))))))
(* 0.25 (/ (* M (* h M)) (pow (/ d D) 2.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 tmp;
if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
} else {
tmp = 0.25 * ((M * (h * M)) / pow((d / D), 2.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 tmp;
if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
} else {
tmp = 0.25 * ((M * (h * M)) / Math.pow((d / D), 2.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)) tmp = 0 if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M))))) <= math.inf: tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))) else: tmp = 0.25 * ((M * (h * M)) / math.pow((d / D), 2.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))) tmp = 0.0 if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) <= Inf) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 * d) / D) * Float64(d / Float64(h * Float64(w * D)))))); else tmp = Float64(0.25 * Float64(Float64(M * Float64(h * M)) / (Float64(d / D) ^ 2.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)); tmp = 0.0; if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= Inf) tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))); else tmp = 0.25 * ((M * (h * M)) / ((d / D) ^ 2.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]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision] * N[(d / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{h \cdot \left(w \cdot D\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot M\right)}{{\left(\frac{d}{D}\right)}^{2}}\\
\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 73.3%
Simplified74.0%
Taylor expanded in c0 around inf 74.4%
unpow274.4%
*-commutative74.4%
associate-/l/75.2%
associate-*r*76.0%
associate-*r/74.7%
unpow274.7%
times-frac77.4%
*-commutative77.4%
Simplified77.4%
add-cbrt-cube73.9%
associate-/l/73.9%
associate-/l/73.8%
associate-/l/73.9%
Applied egg-rr73.9%
associate-*l*73.9%
associate-/r*74.0%
associate-/r*73.9%
associate-/r*73.9%
Simplified73.9%
Taylor expanded in d around 0 79.9%
associate-*r*78.7%
Simplified78.7%
Taylor expanded in d around 0 79.9%
associate-*r*78.7%
*-commutative78.7%
associate-*l*81.1%
Simplified81.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%
Simplified1.8%
flip-+0.1%
Applied egg-rr1.6%
associate--r-4.3%
+-inverses27.4%
associate-/r*28.6%
associate-/r*29.5%
Simplified29.5%
Taylor expanded in c0 around -inf 25.5%
mul-1-neg25.5%
associate-/r*25.4%
distribute-neg-frac25.4%
unpow225.4%
sub-neg25.4%
mul-1-neg25.4%
distribute-rgt-out25.4%
Simplified36.0%
Taylor expanded in c0 around 0 39.5%
*-commutative39.5%
associate-/l*40.1%
*-commutative40.1%
unpow240.1%
associate-*r*40.7%
unpow240.7%
unpow240.7%
times-frac58.3%
unpow258.3%
Simplified58.3%
Final simplification65.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (* t_0 (* 2.0 (* (/ (* c0 d) D) (/ d (* h (* w D)))))))
(t_2 (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))))
(if (<= h -2.9e-290)
t_1
(if (<= h 4e-295)
t_2
(if (<= h 1.7e-154)
(* (* (/ c0 D) (/ c0 D)) (* (/ d w) (/ (/ d w) h)))
(if (<= h 2.8e+35)
0.0
(if (<= h 1.01e+180)
t_1
(if (<= h 2.55e+210)
t_2
(* t_0 (* 2.0 (* (/ (/ d D) (* w h)) (* d (/ c0 D)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
double t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double tmp;
if (h <= -2.9e-290) {
tmp = t_1;
} else if (h <= 4e-295) {
tmp = t_2;
} else if (h <= 1.7e-154) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} else if (h <= 2.8e+35) {
tmp = 0.0;
} else if (h <= 1.01e+180) {
tmp = t_1;
} else if (h <= 2.55e+210) {
tmp = t_2;
} else {
tmp = t_0 * (2.0 * (((d / D) / (w * h)) * (d * (c0 / D))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = t_0 * (2.0d0 * (((c0 * d_1) / d) * (d_1 / (h * (w * d)))))
t_2 = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
if (h <= (-2.9d-290)) then
tmp = t_1
else if (h <= 4d-295) then
tmp = t_2
else if (h <= 1.7d-154) then
tmp = ((c0 / d) * (c0 / d)) * ((d_1 / w) * ((d_1 / w) / h))
else if (h <= 2.8d+35) then
tmp = 0.0d0
else if (h <= 1.01d+180) then
tmp = t_1
else if (h <= 2.55d+210) then
tmp = t_2
else
tmp = t_0 * (2.0d0 * (((d_1 / d) / (w * h)) * (d_1 * (c0 / d))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
double t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double tmp;
if (h <= -2.9e-290) {
tmp = t_1;
} else if (h <= 4e-295) {
tmp = t_2;
} else if (h <= 1.7e-154) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} else if (h <= 2.8e+35) {
tmp = 0.0;
} else if (h <= 1.01e+180) {
tmp = t_1;
} else if (h <= 2.55e+210) {
tmp = t_2;
} else {
tmp = t_0 * (2.0 * (((d / D) / (w * h)) * (d * (c0 / D))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))) t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) tmp = 0 if h <= -2.9e-290: tmp = t_1 elif h <= 4e-295: tmp = t_2 elif h <= 1.7e-154: tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)) elif h <= 2.8e+35: tmp = 0.0 elif h <= 1.01e+180: tmp = t_1 elif h <= 2.55e+210: tmp = t_2 else: tmp = t_0 * (2.0 * (((d / D) / (w * h)) * (d * (c0 / D)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 * d) / D) * Float64(d / Float64(h * Float64(w * D)))))) t_2 = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))) tmp = 0.0 if (h <= -2.9e-290) tmp = t_1; elseif (h <= 4e-295) tmp = t_2; elseif (h <= 1.7e-154) tmp = Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(Float64(d / w) * Float64(Float64(d / w) / h))); elseif (h <= 2.8e+35) tmp = 0.0; elseif (h <= 1.01e+180) tmp = t_1; elseif (h <= 2.55e+210) tmp = t_2; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(d / D) / Float64(w * h)) * Float64(d * Float64(c0 / D))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))); t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); tmp = 0.0; if (h <= -2.9e-290) tmp = t_1; elseif (h <= 4e-295) tmp = t_2; elseif (h <= 1.7e-154) tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)); elseif (h <= 2.8e+35) tmp = 0.0; elseif (h <= 1.01e+180) tmp = t_1; elseif (h <= 2.55e+210) tmp = t_2; else tmp = t_0 * (2.0 * (((d / D) / (w * h)) * (d * (c0 / D)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision] * N[(d / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -2.9e-290], t$95$1, If[LessEqual[h, 4e-295], t$95$2, If[LessEqual[h, 1.7e-154], N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.8e+35], 0.0, If[LessEqual[h, 1.01e+180], t$95$1, If[LessEqual[h, 2.55e+210], t$95$2, N[(t$95$0 * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(d * N[(c0 / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := t_0 \cdot \left(2 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{h \cdot \left(w \cdot D\right)}\right)\right)\\
t_2 := 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{if}\;h \leq -2.9 \cdot 10^{-290}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;h \leq 4 \cdot 10^{-295}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;h \leq 1.7 \cdot 10^{-154}:\\
\;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \left(\frac{d}{w} \cdot \frac{\frac{d}{w}}{h}\right)\\
\mathbf{elif}\;h \leq 2.8 \cdot 10^{+35}:\\
\;\;\;\;0\\
\mathbf{elif}\;h \leq 1.01 \cdot 10^{+180}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;h \leq 2.55 \cdot 10^{+210}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{\frac{d}{D}}{w \cdot h} \cdot \left(d \cdot \frac{c0}{D}\right)\right)\right)\\
\end{array}
\end{array}
if h < -2.89999999999999994e-290 or 2.79999999999999999e35 < h < 1.01000000000000003e180Initial program 26.6%
Simplified28.6%
Taylor expanded in c0 around inf 35.5%
unpow235.5%
*-commutative35.5%
associate-/l/36.2%
associate-*r*40.9%
associate-*r/43.6%
unpow243.6%
times-frac51.7%
*-commutative51.7%
Simplified51.7%
add-cbrt-cube46.9%
associate-/l/46.9%
associate-/l/46.9%
associate-/l/46.9%
Applied egg-rr46.9%
associate-*l*46.9%
associate-/r*46.2%
associate-/r*46.2%
associate-/r*46.2%
Simplified46.2%
Taylor expanded in d around 0 53.8%
associate-*r*55.4%
Simplified55.4%
Taylor expanded in d around 0 53.8%
associate-*r*55.4%
*-commutative55.4%
associate-*l*56.1%
Simplified56.1%
if -2.89999999999999994e-290 < h < 4.00000000000000024e-295 or 1.01000000000000003e180 < h < 2.55e210Initial program 5.6%
Simplified5.6%
flip-+0.0%
Applied egg-rr0.0%
associate--r-0.0%
+-inverses61.1%
associate-/r*61.4%
associate-/r*66.9%
Simplified66.9%
Taylor expanded in c0 around -inf 61.1%
mul-1-neg61.1%
associate-/r*61.1%
distribute-neg-frac61.1%
unpow261.1%
sub-neg61.1%
mul-1-neg61.1%
distribute-rgt-out61.1%
Simplified61.1%
Taylor expanded in c0 around 0 88.9%
associate-/l*88.8%
unpow288.8%
unpow288.8%
*-commutative88.8%
unpow288.8%
Simplified88.8%
if 4.00000000000000024e-295 < h < 1.6999999999999999e-154Initial program 30.8%
Simplified33.3%
Taylor expanded in c0 around inf 50.4%
unpow250.4%
*-commutative50.4%
associate-/l/50.6%
associate-*r*50.6%
associate-*r/58.9%
unpow258.9%
times-frac64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in c0 around 0 34.0%
times-frac35.8%
unpow235.8%
unpow235.8%
unpow235.8%
unpow235.8%
Simplified35.8%
times-frac47.0%
Applied egg-rr47.0%
Taylor expanded in d around 0 47.0%
unpow247.0%
unpow247.0%
associate-*r*60.6%
times-frac68.8%
*-commutative68.8%
associate-/r*68.7%
Simplified68.7%
if 1.6999999999999999e-154 < h < 2.79999999999999999e35Initial program 12.9%
Simplified12.8%
Taylor expanded in c0 around -inf 5.5%
mul-1-neg5.5%
distribute-rgt-in3.0%
Simplified48.6%
Taylor expanded in c0 around 0 51.4%
if 2.55e210 < h Initial program 21.3%
Simplified21.1%
Taylor expanded in c0 around inf 32.1%
unpow232.1%
*-commutative32.1%
associate-/l/32.0%
associate-*r*32.3%
associate-*r/32.9%
unpow232.9%
times-frac49.0%
*-commutative49.0%
Simplified49.0%
pow149.0%
*-commutative49.0%
associate-/l/43.7%
associate-/l*48.7%
Applied egg-rr48.7%
unpow148.7%
associate-/r*53.7%
associate-/r/53.6%
Simplified53.6%
Final simplification59.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (* t_0 (* 2.0 (* (/ (* c0 d) D) (/ d (* h (* w D)))))))
(t_2 (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))))
(if (<= h -2.6e-290)
t_1
(if (<= h 2.1e-295)
t_2
(if (<= h 2.6e-155)
(* (* (/ c0 D) (/ c0 D)) (* (/ d w) (/ (/ d w) h)))
(if (<= h 2.7e+34)
0.0
(if (<= h 2.9e+179)
t_1
(if (<= h 1.55e+212)
t_2
(* t_0 (* 2.0 (/ (* (/ c0 (/ D d)) (/ d (* w h))) D)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
double t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double tmp;
if (h <= -2.6e-290) {
tmp = t_1;
} else if (h <= 2.1e-295) {
tmp = t_2;
} else if (h <= 2.6e-155) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} else if (h <= 2.7e+34) {
tmp = 0.0;
} else if (h <= 2.9e+179) {
tmp = t_1;
} else if (h <= 1.55e+212) {
tmp = t_2;
} else {
tmp = t_0 * (2.0 * (((c0 / (D / d)) * (d / (w * h))) / D));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = t_0 * (2.0d0 * (((c0 * d_1) / d) * (d_1 / (h * (w * d)))))
t_2 = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
if (h <= (-2.6d-290)) then
tmp = t_1
else if (h <= 2.1d-295) then
tmp = t_2
else if (h <= 2.6d-155) then
tmp = ((c0 / d) * (c0 / d)) * ((d_1 / w) * ((d_1 / w) / h))
else if (h <= 2.7d+34) then
tmp = 0.0d0
else if (h <= 2.9d+179) then
tmp = t_1
else if (h <= 1.55d+212) then
tmp = t_2
else
tmp = t_0 * (2.0d0 * (((c0 / (d / d_1)) * (d_1 / (w * h))) / d))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
double t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double tmp;
if (h <= -2.6e-290) {
tmp = t_1;
} else if (h <= 2.1e-295) {
tmp = t_2;
} else if (h <= 2.6e-155) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} else if (h <= 2.7e+34) {
tmp = 0.0;
} else if (h <= 2.9e+179) {
tmp = t_1;
} else if (h <= 1.55e+212) {
tmp = t_2;
} else {
tmp = t_0 * (2.0 * (((c0 / (D / d)) * (d / (w * h))) / D));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))) t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) tmp = 0 if h <= -2.6e-290: tmp = t_1 elif h <= 2.1e-295: tmp = t_2 elif h <= 2.6e-155: tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)) elif h <= 2.7e+34: tmp = 0.0 elif h <= 2.9e+179: tmp = t_1 elif h <= 1.55e+212: tmp = t_2 else: tmp = t_0 * (2.0 * (((c0 / (D / d)) * (d / (w * h))) / D)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 * d) / D) * Float64(d / Float64(h * Float64(w * D)))))) t_2 = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))) tmp = 0.0 if (h <= -2.6e-290) tmp = t_1; elseif (h <= 2.1e-295) tmp = t_2; elseif (h <= 2.6e-155) tmp = Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(Float64(d / w) * Float64(Float64(d / w) / h))); elseif (h <= 2.7e+34) tmp = 0.0; elseif (h <= 2.9e+179) tmp = t_1; elseif (h <= 1.55e+212) tmp = t_2; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 / Float64(D / d)) * Float64(d / Float64(w * h))) / D))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))); t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); tmp = 0.0; if (h <= -2.6e-290) tmp = t_1; elseif (h <= 2.1e-295) tmp = t_2; elseif (h <= 2.6e-155) tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)); elseif (h <= 2.7e+34) tmp = 0.0; elseif (h <= 2.9e+179) tmp = t_1; elseif (h <= 1.55e+212) tmp = t_2; else tmp = t_0 * (2.0 * (((c0 / (D / d)) * (d / (w * h))) / D)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision] * N[(d / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -2.6e-290], t$95$1, If[LessEqual[h, 2.1e-295], t$95$2, If[LessEqual[h, 2.6e-155], N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.7e+34], 0.0, If[LessEqual[h, 2.9e+179], t$95$1, If[LessEqual[h, 1.55e+212], t$95$2, N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 / N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := t_0 \cdot \left(2 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{h \cdot \left(w \cdot D\right)}\right)\right)\\
t_2 := 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{if}\;h \leq -2.6 \cdot 10^{-290}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;h \leq 2.1 \cdot 10^{-295}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;h \leq 2.6 \cdot 10^{-155}:\\
\;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \left(\frac{d}{w} \cdot \frac{\frac{d}{w}}{h}\right)\\
\mathbf{elif}\;h \leq 2.7 \cdot 10^{+34}:\\
\;\;\;\;0\\
\mathbf{elif}\;h \leq 2.9 \cdot 10^{+179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;h \leq 1.55 \cdot 10^{+212}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{\frac{c0}{\frac{D}{d}} \cdot \frac{d}{w \cdot h}}{D}\right)\\
\end{array}
\end{array}
if h < -2.60000000000000001e-290 or 2.7e34 < h < 2.90000000000000019e179Initial program 26.6%
Simplified28.6%
Taylor expanded in c0 around inf 35.5%
unpow235.5%
*-commutative35.5%
associate-/l/36.2%
associate-*r*40.9%
associate-*r/43.6%
unpow243.6%
times-frac51.7%
*-commutative51.7%
Simplified51.7%
add-cbrt-cube46.9%
associate-/l/46.9%
associate-/l/46.9%
associate-/l/46.9%
Applied egg-rr46.9%
associate-*l*46.9%
associate-/r*46.2%
associate-/r*46.2%
associate-/r*46.2%
Simplified46.2%
Taylor expanded in d around 0 53.8%
associate-*r*55.4%
Simplified55.4%
Taylor expanded in d around 0 53.8%
associate-*r*55.4%
*-commutative55.4%
associate-*l*56.1%
Simplified56.1%
if -2.60000000000000001e-290 < h < 2.09999999999999993e-295 or 2.90000000000000019e179 < h < 1.54999999999999999e212Initial program 5.6%
Simplified5.6%
flip-+0.0%
Applied egg-rr0.0%
associate--r-0.0%
+-inverses61.1%
associate-/r*61.4%
associate-/r*66.9%
Simplified66.9%
Taylor expanded in c0 around -inf 61.1%
mul-1-neg61.1%
associate-/r*61.1%
distribute-neg-frac61.1%
unpow261.1%
sub-neg61.1%
mul-1-neg61.1%
distribute-rgt-out61.1%
Simplified61.1%
Taylor expanded in c0 around 0 88.9%
associate-/l*88.8%
unpow288.8%
unpow288.8%
*-commutative88.8%
unpow288.8%
Simplified88.8%
if 2.09999999999999993e-295 < h < 2.60000000000000008e-155Initial program 30.8%
Simplified33.3%
Taylor expanded in c0 around inf 50.4%
unpow250.4%
*-commutative50.4%
associate-/l/50.6%
associate-*r*50.6%
associate-*r/58.9%
unpow258.9%
times-frac64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in c0 around 0 34.0%
times-frac35.8%
unpow235.8%
unpow235.8%
unpow235.8%
unpow235.8%
Simplified35.8%
times-frac47.0%
Applied egg-rr47.0%
Taylor expanded in d around 0 47.0%
unpow247.0%
unpow247.0%
associate-*r*60.6%
times-frac68.8%
*-commutative68.8%
associate-/r*68.7%
Simplified68.7%
if 2.60000000000000008e-155 < h < 2.7e34Initial program 12.9%
Simplified12.8%
Taylor expanded in c0 around -inf 5.5%
mul-1-neg5.5%
distribute-rgt-in3.0%
Simplified48.6%
Taylor expanded in c0 around 0 51.4%
if 1.54999999999999999e212 < h Initial program 21.3%
Simplified21.1%
Taylor expanded in c0 around inf 32.1%
unpow232.1%
*-commutative32.1%
associate-/l/32.0%
associate-*r*32.3%
associate-*r/32.9%
unpow232.9%
times-frac49.0%
*-commutative49.0%
Simplified49.0%
associate-*r/48.9%
associate-/l*54.0%
Applied egg-rr54.0%
Final simplification59.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M))))))
(t_2 (/ c0 (/ D d))))
(if (<= h -3.8e-290)
(* t_0 (* 2.0 (* (/ (* c0 d) D) (/ d (* h (* w D))))))
(if (<= h 3.6e-295)
t_1
(if (<= h 2.05e-155)
(* (* (/ c0 D) (/ c0 D)) (* (/ d w) (/ (/ d w) h)))
(if (<= h 2.55e+33)
0.0
(if (<= h 2.2e+186)
(/ (* c0 (* 2.0 (* (/ d (* w (* h D))) t_2))) (* 2.0 w))
(if (<= h 3.4e+212)
t_1
(* t_0 (* 2.0 (/ (* t_2 (/ d (* w h))) D)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double t_2 = c0 / (D / d);
double tmp;
if (h <= -3.8e-290) {
tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
} else if (h <= 3.6e-295) {
tmp = t_1;
} else if (h <= 2.05e-155) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} else if (h <= 2.55e+33) {
tmp = 0.0;
} else if (h <= 2.2e+186) {
tmp = (c0 * (2.0 * ((d / (w * (h * D))) * t_2))) / (2.0 * w);
} else if (h <= 3.4e+212) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((t_2 * (d / (w * h))) / D));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = c0 / (2.0d0 * w)
t_1 = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
t_2 = c0 / (d / d_1)
if (h <= (-3.8d-290)) then
tmp = t_0 * (2.0d0 * (((c0 * d_1) / d) * (d_1 / (h * (w * d)))))
else if (h <= 3.6d-295) then
tmp = t_1
else if (h <= 2.05d-155) then
tmp = ((c0 / d) * (c0 / d)) * ((d_1 / w) * ((d_1 / w) / h))
else if (h <= 2.55d+33) then
tmp = 0.0d0
else if (h <= 2.2d+186) then
tmp = (c0 * (2.0d0 * ((d_1 / (w * (h * d))) * t_2))) / (2.0d0 * w)
else if (h <= 3.4d+212) then
tmp = t_1
else
tmp = t_0 * (2.0d0 * ((t_2 * (d_1 / (w * h))) / d))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double t_2 = c0 / (D / d);
double tmp;
if (h <= -3.8e-290) {
tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
} else if (h <= 3.6e-295) {
tmp = t_1;
} else if (h <= 2.05e-155) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} else if (h <= 2.55e+33) {
tmp = 0.0;
} else if (h <= 2.2e+186) {
tmp = (c0 * (2.0 * ((d / (w * (h * D))) * t_2))) / (2.0 * w);
} else if (h <= 3.4e+212) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((t_2 * (d / (w * h))) / D));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) t_2 = c0 / (D / d) tmp = 0 if h <= -3.8e-290: tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))) elif h <= 3.6e-295: tmp = t_1 elif h <= 2.05e-155: tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)) elif h <= 2.55e+33: tmp = 0.0 elif h <= 2.2e+186: tmp = (c0 * (2.0 * ((d / (w * (h * D))) * t_2))) / (2.0 * w) elif h <= 3.4e+212: tmp = t_1 else: tmp = t_0 * (2.0 * ((t_2 * (d / (w * h))) / D)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))) t_2 = Float64(c0 / Float64(D / d)) tmp = 0.0 if (h <= -3.8e-290) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 * d) / D) * Float64(d / Float64(h * Float64(w * D)))))); elseif (h <= 3.6e-295) tmp = t_1; elseif (h <= 2.05e-155) tmp = Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(Float64(d / w) * Float64(Float64(d / w) / h))); elseif (h <= 2.55e+33) tmp = 0.0; elseif (h <= 2.2e+186) tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(d / Float64(w * Float64(h * D))) * t_2))) / Float64(2.0 * w)); elseif (h <= 3.4e+212) tmp = t_1; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(t_2 * Float64(d / Float64(w * h))) / D))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); t_2 = c0 / (D / d); tmp = 0.0; if (h <= -3.8e-290) tmp = t_0 * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))); elseif (h <= 3.6e-295) tmp = t_1; elseif (h <= 2.05e-155) tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)); elseif (h <= 2.55e+33) tmp = 0.0; elseif (h <= 2.2e+186) tmp = (c0 * (2.0 * ((d / (w * (h * D))) * t_2))) / (2.0 * w); elseif (h <= 3.4e+212) tmp = t_1; else tmp = t_0 * (2.0 * ((t_2 * (d / (w * h))) / D)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(D / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.8e-290], N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision] * N[(d / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 3.6e-295], t$95$1, If[LessEqual[h, 2.05e-155], N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.55e+33], 0.0, If[LessEqual[h, 2.2e+186], N[(N[(c0 * N[(2.0 * N[(N[(d / N[(w * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 3.4e+212], t$95$1, N[(t$95$0 * N[(2.0 * N[(N[(t$95$2 * N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
t_2 := \frac{c0}{\frac{D}{d}}\\
\mathbf{if}\;h \leq -3.8 \cdot 10^{-290}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{h \cdot \left(w \cdot D\right)}\right)\right)\\
\mathbf{elif}\;h \leq 3.6 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;h \leq 2.05 \cdot 10^{-155}:\\
\;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \left(\frac{d}{w} \cdot \frac{\frac{d}{w}}{h}\right)\\
\mathbf{elif}\;h \leq 2.55 \cdot 10^{+33}:\\
\;\;\;\;0\\
\mathbf{elif}\;h \leq 2.2 \cdot 10^{+186}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{w \cdot \left(h \cdot D\right)} \cdot t_2\right)\right)}{2 \cdot w}\\
\mathbf{elif}\;h \leq 3.4 \cdot 10^{+212}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{t_2 \cdot \frac{d}{w \cdot h}}{D}\right)\\
\end{array}
\end{array}
if h < -3.79999999999999975e-290Initial program 26.8%
Simplified28.3%
Taylor expanded in c0 around inf 34.7%
unpow234.7%
*-commutative34.7%
associate-/l/35.5%
associate-*r*40.4%
associate-*r/42.8%
unpow242.8%
times-frac52.5%
*-commutative52.5%
Simplified52.5%
add-cbrt-cube47.5%
associate-/l/47.5%
associate-/l/47.5%
associate-/l/47.5%
Applied egg-rr47.5%
associate-*l*47.5%
associate-/r*46.7%
associate-/r*46.7%
associate-/r*46.7%
Simplified46.7%
Taylor expanded in d around 0 54.2%
associate-*r*55.0%
Simplified55.0%
Taylor expanded in d around 0 54.2%
associate-*r*55.0%
*-commutative55.0%
associate-*l*55.8%
Simplified55.8%
if -3.79999999999999975e-290 < h < 3.6000000000000001e-295 or 2.1999999999999998e186 < h < 3.40000000000000037e212Initial program 5.9%
Simplified5.9%
flip-+0.0%
Applied egg-rr0.0%
associate--r-0.0%
+-inverses64.7%
associate-/r*64.7%
associate-/r*70.6%
Simplified70.6%
Taylor expanded in c0 around -inf 64.7%
mul-1-neg64.7%
associate-/r*64.7%
distribute-neg-frac64.7%
unpow264.7%
sub-neg64.7%
mul-1-neg64.7%
distribute-rgt-out64.7%
Simplified64.7%
Taylor expanded in c0 around 0 94.1%
associate-/l*94.0%
unpow294.0%
unpow294.0%
*-commutative94.0%
unpow294.0%
Simplified94.0%
if 3.6000000000000001e-295 < h < 2.0499999999999999e-155Initial program 30.8%
Simplified33.3%
Taylor expanded in c0 around inf 50.4%
unpow250.4%
*-commutative50.4%
associate-/l/50.6%
associate-*r*50.6%
associate-*r/58.9%
unpow258.9%
times-frac64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in c0 around 0 34.0%
times-frac35.8%
unpow235.8%
unpow235.8%
unpow235.8%
unpow235.8%
Simplified35.8%
times-frac47.0%
Applied egg-rr47.0%
Taylor expanded in d around 0 47.0%
unpow247.0%
unpow247.0%
associate-*r*60.6%
times-frac68.8%
*-commutative68.8%
associate-/r*68.7%
Simplified68.7%
if 2.0499999999999999e-155 < h < 2.5499999999999999e33Initial program 12.9%
Simplified12.8%
Taylor expanded in c0 around -inf 5.5%
mul-1-neg5.5%
distribute-rgt-in3.0%
Simplified48.6%
Taylor expanded in c0 around 0 51.4%
if 2.5499999999999999e33 < h < 2.1999999999999998e186Initial program 25.0%
Simplified29.0%
Taylor expanded in c0 around inf 38.0%
unpow238.0%
*-commutative38.0%
associate-/l/37.9%
associate-*r*41.7%
associate-*r/45.7%
unpow245.7%
times-frac45.9%
*-commutative45.9%
Simplified45.9%
associate-*l/45.9%
*-commutative45.9%
associate-/l/49.8%
associate-/l*50.0%
*-commutative50.0%
Applied egg-rr50.0%
pow150.0%
Applied egg-rr50.0%
unpow150.0%
associate-*r*55.2%
Simplified55.2%
if 3.40000000000000037e212 < h Initial program 21.3%
Simplified21.1%
Taylor expanded in c0 around inf 32.1%
unpow232.1%
*-commutative32.1%
associate-/l/32.0%
associate-*r*32.3%
associate-*r/32.9%
unpow232.9%
times-frac49.0%
*-commutative49.0%
Simplified49.0%
associate-*r/48.9%
associate-/l*54.0%
Applied egg-rr54.0%
Final simplification59.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (* (/ c0 D) (/ c0 D)) (* (/ d w) (/ (/ d w) h))))
(t_1
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ (* c0 d) D) (/ d (* h (* w D)))))))
(t_2 (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))))
(if (<= h -4.8e-289)
t_1
(if (<= h 1.65e-294)
t_2
(if (<= h 3.5e-155)
t_0
(if (<= h 3.9e+33)
0.0
(if (<= h 2.45e+179) t_1 (if (<= h 4.6e+212) t_2 t_0))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
double t_1 = (c0 / (2.0 * w)) * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
double t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double tmp;
if (h <= -4.8e-289) {
tmp = t_1;
} else if (h <= 1.65e-294) {
tmp = t_2;
} else if (h <= 3.5e-155) {
tmp = t_0;
} else if (h <= 3.9e+33) {
tmp = 0.0;
} else if (h <= 2.45e+179) {
tmp = t_1;
} else if (h <= 4.6e+212) {
tmp = t_2;
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_0 = ((c0 / d) * (c0 / d)) * ((d_1 / w) * ((d_1 / w) / h))
t_1 = (c0 / (2.0d0 * w)) * (2.0d0 * (((c0 * d_1) / d) * (d_1 / (h * (w * d)))))
t_2 = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
if (h <= (-4.8d-289)) then
tmp = t_1
else if (h <= 1.65d-294) then
tmp = t_2
else if (h <= 3.5d-155) then
tmp = t_0
else if (h <= 3.9d+33) then
tmp = 0.0d0
else if (h <= 2.45d+179) then
tmp = t_1
else if (h <= 4.6d+212) then
tmp = t_2
else
tmp = 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 = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
double t_1 = (c0 / (2.0 * w)) * (2.0 * (((c0 * d) / D) * (d / (h * (w * D)))));
double t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
double tmp;
if (h <= -4.8e-289) {
tmp = t_1;
} else if (h <= 1.65e-294) {
tmp = t_2;
} else if (h <= 3.5e-155) {
tmp = t_0;
} else if (h <= 3.9e+33) {
tmp = 0.0;
} else if (h <= 2.45e+179) {
tmp = t_1;
} else if (h <= 4.6e+212) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)) t_1 = (c0 / (2.0 * w)) * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))) t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) tmp = 0 if h <= -4.8e-289: tmp = t_1 elif h <= 1.65e-294: tmp = t_2 elif h <= 3.5e-155: tmp = t_0 elif h <= 3.9e+33: tmp = 0.0 elif h <= 2.45e+179: tmp = t_1 elif h <= 4.6e+212: tmp = t_2 else: tmp = t_0 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(Float64(d / w) * Float64(Float64(d / w) / h))) t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(c0 * d) / D) * Float64(d / Float64(h * Float64(w * D)))))) t_2 = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))) tmp = 0.0 if (h <= -4.8e-289) tmp = t_1; elseif (h <= 1.65e-294) tmp = t_2; elseif (h <= 3.5e-155) tmp = t_0; elseif (h <= 3.9e+33) tmp = 0.0; elseif (h <= 2.45e+179) tmp = t_1; elseif (h <= 4.6e+212) tmp = t_2; else tmp = t_0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)); t_1 = (c0 / (2.0 * w)) * (2.0 * (((c0 * d) / D) * (d / (h * (w * D))))); t_2 = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); tmp = 0.0; if (h <= -4.8e-289) tmp = t_1; elseif (h <= 1.65e-294) tmp = t_2; elseif (h <= 3.5e-155) tmp = t_0; elseif (h <= 3.9e+33) tmp = 0.0; elseif (h <= 2.45e+179) tmp = t_1; elseif (h <= 4.6e+212) tmp = t_2; else tmp = t_0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision] * N[(d / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -4.8e-289], t$95$1, If[LessEqual[h, 1.65e-294], t$95$2, If[LessEqual[h, 3.5e-155], t$95$0, If[LessEqual[h, 3.9e+33], 0.0, If[LessEqual[h, 2.45e+179], t$95$1, If[LessEqual[h, 4.6e+212], t$95$2, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \left(\frac{d}{w} \cdot \frac{\frac{d}{w}}{h}\right)\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{h \cdot \left(w \cdot D\right)}\right)\right)\\
t_2 := 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{if}\;h \leq -4.8 \cdot 10^{-289}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;h \leq 1.65 \cdot 10^{-294}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;h \leq 3.5 \cdot 10^{-155}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;h \leq 3.9 \cdot 10^{+33}:\\
\;\;\;\;0\\
\mathbf{elif}\;h \leq 2.45 \cdot 10^{+179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;h \leq 4.6 \cdot 10^{+212}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if h < -4.79999999999999988e-289 or 3.9000000000000002e33 < h < 2.4499999999999999e179Initial program 26.6%
Simplified28.6%
Taylor expanded in c0 around inf 35.5%
unpow235.5%
*-commutative35.5%
associate-/l/36.2%
associate-*r*40.9%
associate-*r/43.6%
unpow243.6%
times-frac51.7%
*-commutative51.7%
Simplified51.7%
add-cbrt-cube46.9%
associate-/l/46.9%
associate-/l/46.9%
associate-/l/46.9%
Applied egg-rr46.9%
associate-*l*46.9%
associate-/r*46.2%
associate-/r*46.2%
associate-/r*46.2%
Simplified46.2%
Taylor expanded in d around 0 53.8%
associate-*r*55.4%
Simplified55.4%
Taylor expanded in d around 0 53.8%
associate-*r*55.4%
*-commutative55.4%
associate-*l*56.1%
Simplified56.1%
if -4.79999999999999988e-289 < h < 1.65e-294 or 2.4499999999999999e179 < h < 4.5999999999999997e212Initial program 5.6%
Simplified5.6%
flip-+0.0%
Applied egg-rr0.0%
associate--r-0.0%
+-inverses61.1%
associate-/r*61.4%
associate-/r*66.9%
Simplified66.9%
Taylor expanded in c0 around -inf 61.1%
mul-1-neg61.1%
associate-/r*61.1%
distribute-neg-frac61.1%
unpow261.1%
sub-neg61.1%
mul-1-neg61.1%
distribute-rgt-out61.1%
Simplified61.1%
Taylor expanded in c0 around 0 88.9%
associate-/l*88.8%
unpow288.8%
unpow288.8%
*-commutative88.8%
unpow288.8%
Simplified88.8%
if 1.65e-294 < h < 3.50000000000000015e-155 or 4.5999999999999997e212 < h Initial program 27.5%
Simplified29.1%
Taylor expanded in c0 around inf 44.1%
unpow244.1%
*-commutative44.1%
associate-/l/44.2%
associate-*r*44.3%
associate-*r/49.9%
unpow249.9%
times-frac59.2%
*-commutative59.2%
Simplified59.2%
Taylor expanded in c0 around 0 33.3%
times-frac34.4%
unpow234.4%
unpow234.4%
unpow234.4%
unpow234.4%
Simplified34.4%
times-frac43.6%
Applied egg-rr43.6%
Taylor expanded in d around 0 43.6%
unpow243.6%
unpow243.6%
associate-*r*52.5%
times-frac63.5%
*-commutative63.5%
associate-/r*63.5%
Simplified63.5%
if 3.50000000000000015e-155 < h < 3.9000000000000002e33Initial program 12.9%
Simplified12.8%
Taylor expanded in c0 around -inf 5.5%
mul-1-neg5.5%
distribute-rgt-in3.0%
Simplified48.6%
Taylor expanded in c0 around 0 51.4%
Final simplification59.2%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= c0 -1.25e-107) (not (<= c0 1.8e-144))) (* (* (/ c0 D) (/ c0 D)) (* (/ d h) (/ d (* w w)))) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -1.25e-107) || !(c0 <= 1.8e-144)) {
tmp = ((c0 / D) * (c0 / D)) * ((d / h) * (d / (w * 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 ((c0 <= (-1.25d-107)) .or. (.not. (c0 <= 1.8d-144))) then
tmp = ((c0 / d) * (c0 / d)) * ((d_1 / h) * (d_1 / (w * 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 ((c0 <= -1.25e-107) || !(c0 <= 1.8e-144)) {
tmp = ((c0 / D) * (c0 / D)) * ((d / h) * (d / (w * w)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (c0 <= -1.25e-107) or not (c0 <= 1.8e-144): tmp = ((c0 / D) * (c0 / D)) * ((d / h) * (d / (w * w))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((c0 <= -1.25e-107) || !(c0 <= 1.8e-144)) tmp = Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(Float64(d / h) * Float64(d / Float64(w * w)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((c0 <= -1.25e-107) || ~((c0 <= 1.8e-144))) tmp = ((c0 / D) * (c0 / D)) * ((d / h) * (d / (w * w))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[c0, -1.25e-107], N[Not[LessEqual[c0, 1.8e-144]], $MachinePrecision]], N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] * N[(d / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -1.25 \cdot 10^{-107} \lor \neg \left(c0 \leq 1.8 \cdot 10^{-144}\right):\\
\;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \left(\frac{d}{h} \cdot \frac{d}{w \cdot w}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if c0 < -1.24999999999999993e-107 or 1.8e-144 < c0 Initial program 23.6%
Simplified24.9%
Taylor expanded in c0 around inf 37.9%
unpow237.9%
*-commutative37.9%
associate-/l/38.3%
associate-*r*40.1%
associate-*r/43.6%
unpow243.6%
times-frac50.4%
*-commutative50.4%
Simplified50.4%
Taylor expanded in c0 around 0 32.7%
times-frac33.8%
unpow233.8%
unpow233.8%
unpow233.8%
unpow233.8%
Simplified33.8%
times-frac37.2%
Applied egg-rr37.2%
times-frac44.4%
Applied egg-rr44.4%
if -1.24999999999999993e-107 < c0 < 1.8e-144Initial program 21.6%
Simplified23.7%
Taylor expanded in c0 around -inf 4.2%
mul-1-neg4.2%
distribute-rgt-in4.2%
Simplified54.5%
Taylor expanded in c0 around 0 54.5%
Final simplification46.5%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= c0 -4e-156) (not (<= c0 8.8e-145))) (* (* (/ c0 D) (/ c0 D)) (* (/ d w) (/ (/ d w) h))) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -4e-156) || !(c0 <= 8.8e-145)) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} 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 ((c0 <= (-4d-156)) .or. (.not. (c0 <= 8.8d-145))) then
tmp = ((c0 / d) * (c0 / d)) * ((d_1 / w) * ((d_1 / w) / h))
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 ((c0 <= -4e-156) || !(c0 <= 8.8e-145)) {
tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (c0 <= -4e-156) or not (c0 <= 8.8e-145): tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((c0 <= -4e-156) || !(c0 <= 8.8e-145)) tmp = Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(Float64(d / w) * Float64(Float64(d / w) / h))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((c0 <= -4e-156) || ~((c0 <= 8.8e-145))) tmp = ((c0 / D) * (c0 / D)) * ((d / w) * ((d / w) / h)); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[c0, -4e-156], N[Not[LessEqual[c0, 8.8e-145]], $MachinePrecision]], N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] * N[(N[(d / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -4 \cdot 10^{-156} \lor \neg \left(c0 \leq 8.8 \cdot 10^{-145}\right):\\
\;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \left(\frac{d}{w} \cdot \frac{\frac{d}{w}}{h}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if c0 < -4.00000000000000016e-156 or 8.79999999999999996e-145 < c0 Initial program 24.7%
Simplified26.4%
Taylor expanded in c0 around inf 37.6%
unpow237.6%
*-commutative37.6%
associate-/l/38.0%
associate-*r*39.7%
associate-*r/43.4%
unpow243.4%
times-frac50.2%
*-commutative50.2%
Simplified50.2%
Taylor expanded in c0 around 0 31.9%
times-frac33.1%
unpow233.1%
unpow233.1%
unpow233.1%
unpow233.1%
Simplified33.1%
times-frac36.8%
Applied egg-rr36.8%
Taylor expanded in d around 0 36.8%
unpow236.8%
unpow236.8%
associate-*r*40.0%
times-frac47.7%
*-commutative47.7%
associate-/r*50.4%
Simplified50.4%
if -4.00000000000000016e-156 < c0 < 8.79999999999999996e-145Initial program 14.1%
Simplified14.4%
Taylor expanded in c0 around -inf 0.6%
mul-1-neg0.6%
distribute-rgt-in0.6%
Simplified61.0%
Taylor expanded in c0 around 0 61.0%
Final simplification51.9%
(FPCore (c0 w h D d M) :precision binary64 (if (<= (* d d) 1.22e+294) (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M))))) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((d * d) <= 1.22e+294) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} 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 ((d_1 * d_1) <= 1.22d+294) then
tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
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 ((d * d) <= 1.22e+294) {
tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (d * d) <= 1.22e+294: tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))) else: tmp = 0.0 return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(d * d) <= 1.22e+294) tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((d * d) <= 1.22e+294) tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M)))); else tmp = 0.0; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(d * d), $MachinePrecision], 1.22e+294], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \cdot d \leq 1.22 \cdot 10^{+294}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if (*.f64 d d) < 1.2199999999999999e294Initial program 24.0%
Simplified26.3%
flip-+2.3%
Applied egg-rr3.1%
associate--r-5.2%
+-inverses21.6%
associate-/r*22.3%
associate-/r*23.9%
Simplified23.9%
Taylor expanded in c0 around -inf 21.2%
mul-1-neg21.2%
associate-/r*21.8%
distribute-neg-frac21.8%
unpow221.8%
sub-neg21.8%
mul-1-neg21.8%
distribute-rgt-out21.8%
Simplified27.1%
Taylor expanded in c0 around 0 36.2%
associate-/l*37.4%
unpow237.4%
unpow237.4%
*-commutative37.4%
unpow237.4%
Simplified37.4%
if 1.2199999999999999e294 < (*.f64 d d) Initial program 22.0%
Simplified22.1%
Taylor expanded in c0 around -inf 0.0%
mul-1-neg0.0%
distribute-rgt-in0.0%
Simplified31.5%
Taylor expanded in c0 around 0 35.7%
Final simplification36.7%
(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 23.2%
Simplified24.6%
Taylor expanded in c0 around -inf 3.5%
mul-1-neg3.5%
distribute-rgt-in3.1%
Simplified27.8%
Taylor expanded in c0 around 0 30.6%
Final simplification30.6%
herbie shell --seed 2023279
(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))))))